Creating a New Window From Main WndProc

Hello, I am making a program for a contest and I need some help. What I want is to be able to click on a drop down like this one:

http://img685.imageshack.us/img685/4093/45650080.png

and have a new window pop up. Anyone know how to do this?
Creating a new window/form/dialog in Windows if you are doing Api style Sdk code is just like creating your first or main program window - you call CreateWindow() or CreateWindowEx() and pass in the name of a valid Window Class. If you register ( RegisterClassEx ) another window class for your pop up you can use that. You need to set the window styles and so forth naturally.
Do I do all of this in the case statement? Like:

1
2
3
case IDM_MENU_OPTION_ONE:
// Would I write all of it here ?
break;


Thanks

Edit:

Is it possible to 'clear the screen' my main goal is to have the users select a tab and then display some text like a guide or a button with a input field. Any ideas on the best way to go about that ?

Thanks again
Last edited on

Do I do all of this in the case statement? Like:


Its not all that much to do (relatively speaking). I'd register a new Window Class in a WM_CREATE handler for my main program window, then call CreateWindow(), ShowWindow() in whatever handler runs when you want to create a new window. What you'll soon find out is that the registration of a new window class will require a new window procedure for your new class (so your program will have as many window procedures in it as you have registered window classes). Code there will run when the new window is created and when the user does anything with your new window.
Ok, thanks, umm how do I use ShowWindow (hwnd, nCmdShow); if nCmdShow wasn't defined ?
The 2nd parameter of the ShowWindow() function is an equate/define. SW_SHOWNORMAL will probably be what you want, but if you are going to do this type of coding you need to become familiar with the Windows Api documentation. Type 'ShowWindow' in your browser and you should eventually end up at the MSDN docs and you'll see the defines there.
Alright I got it working, thank you so much dude :D
Topic archived. No new replies allowed.