Results 1 to 4 of 4

Thread: dialog boxes

  1. #1

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    dialog boxes

    hah...my question's will never cease

    I added a dialog box, added everything I want to it...but I can't get it to show up.

    I have my WinMain stuff, and I want the dialog box to show up first thing so the user can select resolution/fullscreen/see the controls.

    And if they click 'ok', the dialog box closes (the values are stored in globals, right?), 'exit' well...exits.

    The dialog box is called "IDD_OPTIONS"

    Thanks Alot
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    If you keep asking, you should remove that large picture from your signation. It's really annoying when every post of yours is two thirds signature, and it makes the threads hard to read.

    The values are not automatically saved in globals, you must do that yourself in the command handler routine of your DialogProc.

    A modal dialog box (one that hinders other execution) is created with the DialogBox function. A modeless is created with the CreateDialog function.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    Originally posted by CornedBee
    If you keep asking, you should remove that large picture from your signation. It's really annoying when every post of yours is two thirds signature, and it makes the threads hard to read.

    The values are not automatically saved in globals, you must do that yourself in the command handler routine of your DialogProc.

    A modal dialog box (one that hinders other execution) is created with the DialogBox function. A modeless is created with the CreateDialog function.
    sorry i changed it to something smaller


    and...

    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    If you refer to your OpenGL cube...
    Code:
    BOOL g_bFullscreen;
    
    BOOL CALLBACK DialogProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
    
    int WinMain(HINSTANCE hInst, ...)
    {
      int dlgresult = DialogBox(hInst, MAKEINTRESOURCE(IDD_OPTIONS), NULL, DialogProc);
    
      if(dlgresult == IDOK)
      {//...
      }
      //...
    }
    
    BOOL CALLBACK DialogProc(...)
    {
      switch(message)
      {
      case WM_COMMAND:
        switch(LOWORD(wParam))
        {
        case IDOK:
          g_bFullscreen = (BST_CHECKED == SendMessage(GetDlgItem(hdlg, IDC_FULLSCREEN), WM_GETCHECK, 0L, 0L));
          EndDialog(hdlg, IDOK);
      }
    }
    You get the idea. It may be that NULL is an invalid hwnd parameter to DialogBox, in this case you'd have to create the main window first (don't show it) and pass this hwnd, or pass the desktop hwnd (not a good idea)
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width