OK, I've read the faq's, the tutorials, and the posts. But while I can create a basic, standard window, I don't understand what the commands do. I don't like to use code unless I know how it works, so can anyone give me a step by step explanation?
Printable View
OK, I've read the faq's, the tutorials, and the posts. But while I can create a basic, standard window, I don't understand what the commands do. I don't like to use code unless I know how it works, so can anyone give me a step by step explanation?
What commands? The message commands? Did you start into windows programming with out doing console?
No, I've done some console programming. My problem is that, while I understand the commands of to use OpenGL, It requires a window, and while I can make one (the announcement at the top of this forum tells one how), I'm not sure about many of the commands that make the window and what they do. I just want to know what each step in making a standard window is for.
Well from the tutorial
This what you wanted?PHP Code:hwnd = CreateWindow( "My Window", //This is The Class That Is Registered For The Window
"Skeleton Window", //This Is The Title Of The Window
WS_OVERLAPPEDWINDOW, //The Flags To Change The Properties Of The Window. In This Case Its Telling Us To Make A Overlapped Window, Which Is The Default Window Flag
CW_USEDEFAULT, //This Is The X Position For The Window. You Could Put An Int In There Like 10 or 100
CW_USEDEFAULT, //This Is The Y Position For The Window. You Could Put An Int In There Like 10 or 100
CW_USEDEFAULT, //This Is The Width For The Window. You Could Put An Int In There Like 10 or 100
CW_USEDEFAULT, //This Is The Height For The Window. You Could Put An Int In There Like 10 or 100
HWND_DESKTOP, //This Is The HWND For The Window. This Important When Making Buttons Or Other Items That You Put On The Window. In This Case Its The HWND For The Desktop, Since The Window Will Be A Child Of The Desktop
NULL, //This Is Where You Would Tie In A Menu, Or A Menu Value. Its NULL Because There Is No Menu On The Default
hThisInst, //This Is The Instance For The Window. Generally Passed To It In WinMain()
NULL ); //This Is Generally Not Used
Exactly!!! thanks a lot, but 1 more thing. All those words, such as CW_USEDEFAULT are commands, or constants?
Thanks again!
CW_USEDEFAULT is a constant, but I dont know what the value is. I don't use it. If you look up CreateWindow in MSDN you should find more info on all the constants
Great, thanks a lot for all your help!
NP, its what were are here for ;)
MSDN is the best reference for this sort of stuff:
http://msdn.microsoft.com/library/
I always go there and search for the description of any function, constant, structure, etc.
Hi,
I have just spent the past week reading and programming with all of the C++ tutorials for DevC++ and Win32 on the http://www.gametutorials.com/ site. Each line of code is well documented. I had only a C background from 7 years ago and lots of VB time. I found these tutorials to be the thing to get the basics down. Of course, I am looking for other good material on the web. Any suggestions are always appreciated.
I actually understand what a lot of you guys are saying now compared to last week. Whew! I finally blasted through this C++ barrier with the help of you fine folks on the internet.
Regards,