   Dialog Boxes
  I''ve got the basic code from nehe for a OpenGl window. I have also created a couple of dialog boxes that allow for settings to be changed. However whenever the program is run it jumps right to the OpenGL window. How can I make it so that my dialog boxes are displayed before the window and then the window is created on the settings from the dialog box?Thanks Uni  
  Anybody???  ;  Something like this..?? Make sure you put the call to DialogBox(...) at the top of your winmain function    #include <windows.h>#include "resource.h" // If you're using MSVC's resource editorBOOL CALLBACK DlgProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam){    switch(msg)    {case WM_INITDIALOG:{  // Do stuff you need to init your dialogbox here    return TRUE;   }    case WM_COMMAND:   {    switch(LOWORD(wparam))  {  case IDOK:{DestroyWindow(hwnd);   return TRUE;}// Check the rest of your dialog box controls here  }   }    default:   return FALSE;    }return TRUE;} INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){    DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);    // Insert the rest of your code here..    return 0;}  God speed..    [edited by - Rickmeister on May 30, 2002 8:08:39 AM];  Thanks very much! :-)  ;  Naw...it still ain''t working..this is what I''ve got:rc1.rc    -This has just got my dialog IDD_DIALOG1 in, not typing just the design of itresource.h  -   With #define IDD_DIALOG1  1 in it and that''s itCan''t I just put just after my WinMain start this:int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,LPSTR lpcmdline,int nshowcmd){MAKEINTRESOURCE(IDD_DIALOG1);...but then it says that IDD_DIALOG1 is an undeclared identifyer. Any ideas? I''ve done it before and it didn''t involve any sort of messaging.ThanksUni;  Okies...update ...I''ve got just the same before except in my WinMain I now have:int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,LPSTR lpcmdline,int nshowcmd){"IDD_DIALOG1"::ShowWindow(hwnd,SW_SHOW);...But I''m getting:error C2065: ''hwnd'' : undeclared identifiererror C2143: syntax error : missing '';'' before ''tag::id''what goes in place of that hwnd? and what is up with the other one?Thanks Uni  ;  I''ve managed to iron out the error about the missing '';''. But I don''t know what to put instead of the hwnd???Thanks Uni  ;  Right...I''ve now fixed that error but it still isn''t showing up the dialog box. Here''s the code I''ve got:"IDD_DIALOG1";::ShowWindow(hwnd,SW_SHOW);Although it still ain''t working;  ok.. let me try to explain it again..and don't accuse me for beeing a good teacher..  I assume that you're using MSVCStep 1  Insert a resource script into your current project (Insert->Resource or CTRL+R). Choose "Dialog" and save the script into your current project folder.Step 2  Include the "resource.h" header-file into your project.Step 3  Write the message handling function (I called it DlgProc in my previous post, but you may call it whatever you want..)Step 4  Before any other calls to the windows API, create and show the Dialog using the line DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);   Step 5  To check if any of the controls in the dialog (buttons, switches etc) is activated you check the LOWORD of wparam.To find out more about window controls/Dialog boxes check out DialogBoxes reference at MSDNAnother great site for learning how to use the Win32 API is www.winprog.org[edit] damn tags....    #define   Email Lex & Yacc Function Pointers Virtual Terrain Knowledge Base Real Programmers"Strong typing is for the weak minded!"  [edited by - Rickmeister on May 30, 2002 3:42:50 PM];  Thanks Rickmeister...you''re an ace teacher! :-)Thanks againUni!  