Archived

This topic is now archived and is closed to further replies.

pandabear114

Making a Dialog appear..

Recommended Posts

I don''t know who told you such a silly thing !! But all I can say is that you will avoid a lot of useless work, you could have to do without MFC !

Building dialogs/menu/icons... using the VC++ resources editor is usually (if not always) done for MFC developments !

Try it and make your own opinion about MFC, I''m not sure the guy who adviced you, has really tried anything with them...

__________________________



Bruno Wieckowski
Lead Programmer
Exood4 Studios

Share this post


Link to post
Share on other sites
Well im trying to make a game actually,
I already have an OpenGL window I am working with but I wanted another little window on the side that would have buttons like New Game / Save Game / etc
Rather than trying to do all the coding for that in the OpenGL window.

It was easy to do that with VB before but would it be easier to do it a different way in this case?

Share this post


Link to post
Share on other sites
In WIN32 API (which I presume you''re using). To make a dialogue appear, you need to add your menu item to the procedure.
IE:

  
case WM_COMMAND:
switch(LOWORD(wParam))
{
case ID_GAME_LOAD: //Or whatever the ID for the menu item is

int aboutint = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(THE_DIALOG_YOU_WANT), hwnd, X);
break;
// Other menu commands...

}
break;


Then you need a dialogue procedure matching X above.(change X for the name of the procedure)

IE:

  
BOOL CALLBACK X(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
{
switch(message)
{
case WM_INITDIALOG:
return true;
case WM_COMMAND:
switch(LOWORD(wparam))
{
//THE BUTTONS/OTHER DEVICES IN YOUR DIALOGUE''S ACTIONS

}
break;
default:
return false;
}
return true;
}



If you don''t know the WINAPI this is very confusing to you. I don''t know OPEN-GL so I don''t have a clue how it operates but this is how its done in the WINAPI.




And the Dark Lord shall DESTROY Middle Earth


But Ilthigore will save you

Share this post


Link to post
Share on other sites
hrmm
I am trying to get the dialog box i made to pop up as one window, and the NeHe OpenGL window to pop up next to it

I am trying to use win32 api but the window handles are already used by the gl window
so I tried making new window handles and a new class and everything to try to get the dialog to be seperate but its getting all crazy

ive probably stopped making sense but lets just say if anyone can give me some example code where it will pop up one window using a dialog and the nehegl window next to it, that would be great

or even have the dialog window appear and then pressing a button on it would close it and make the gl window appear

Share this post


Link to post
Share on other sites