Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MDI app doesn't close

MDI app doesn't close

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
15 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex Cutovoi
    wrote on last edited by
    #1

    Hi for all I'm developing a single MDI app. I have the following matter: When I click the close button on the parent window, teorically it will send a WM_CLOSE and process the PostQuitMessage(0). But this is not occuring. What I really want to know is how can I close and MDI app carrectly. Look at the code below. This is the code of a class that I've create to create windows: /*Loop da janela*/ WPARAM TemplateWindow::MessageLoop() { while(!m_bQuit) { if(PeekMessage(&msg, m_hwnd, NULL, NULL, PM_REMOVE)) { if(msg.message == WM_QUIT) { if(m_uiType == MDI)DestroyWindow(m_hwndFrame); m_bQuit = true; //UnregisterClass(wnd.lpszClassName, m_hInstance); break; } else { if(m_uiType == MDI) { if(!TranslateMDISysAccel(m_hwndFrame, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } if(m_uiType == SDI) { TranslateMessage(&msg); DispatchMessage(&msg); } } } else if(m_uiChildCount > 0) { SendMessage(childsInfo[0].hwnd, WM_PAINT, NULL, NULL); } SwapBuffers(m_hdc); } return msg.wParam; } This is my code in the callback of the main window: LRESULT CALLBACK MainWindowCallback(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { HMENU hMainMenu; hMainMenu = CreateMenu(); static int siRuler = IDM_NEWRULER, siText = IDM_NEWTEXT, siNodule = IDM_NEWNODULE, siPath = IDM_NEWRULERPATH; switch(uiMessage) { case WM_CREATE: { ... break; } case WM_CLOSE: { delete TextMenu; delete RulerMenu; delete PathMenu; delete NoduleMenu; delete ProceedingMenu; delete ScreenShotMenu; PostQuitMessage(0); break; } ... default: return DefFrameProc(hwnd, g_hwndClient, uiMessage, wParam, lParam); } } The WM_CLOSE message is processed, BUT the PostQuitMessage(0) not. It process some part of this function. I'm debugging the app and when it enters in this part: 7E419483 call 7E418860 The app doesn't process, it doesn't freeze, just doesn't continue to process other register. Anyone can help.

    M 1 Reply Last reply
    0
    • A Alex Cutovoi

      Hi for all I'm developing a single MDI app. I have the following matter: When I click the close button on the parent window, teorically it will send a WM_CLOSE and process the PostQuitMessage(0). But this is not occuring. What I really want to know is how can I close and MDI app carrectly. Look at the code below. This is the code of a class that I've create to create windows: /*Loop da janela*/ WPARAM TemplateWindow::MessageLoop() { while(!m_bQuit) { if(PeekMessage(&msg, m_hwnd, NULL, NULL, PM_REMOVE)) { if(msg.message == WM_QUIT) { if(m_uiType == MDI)DestroyWindow(m_hwndFrame); m_bQuit = true; //UnregisterClass(wnd.lpszClassName, m_hInstance); break; } else { if(m_uiType == MDI) { if(!TranslateMDISysAccel(m_hwndFrame, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } if(m_uiType == SDI) { TranslateMessage(&msg); DispatchMessage(&msg); } } } else if(m_uiChildCount > 0) { SendMessage(childsInfo[0].hwnd, WM_PAINT, NULL, NULL); } SwapBuffers(m_hdc); } return msg.wParam; } This is my code in the callback of the main window: LRESULT CALLBACK MainWindowCallback(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { HMENU hMainMenu; hMainMenu = CreateMenu(); static int siRuler = IDM_NEWRULER, siText = IDM_NEWTEXT, siNodule = IDM_NEWNODULE, siPath = IDM_NEWRULERPATH; switch(uiMessage) { case WM_CREATE: { ... break; } case WM_CLOSE: { delete TextMenu; delete RulerMenu; delete PathMenu; delete NoduleMenu; delete ProceedingMenu; delete ScreenShotMenu; PostQuitMessage(0); break; } ... default: return DefFrameProc(hwnd, g_hwndClient, uiMessage, wParam, lParam); } } The WM_CLOSE message is processed, BUT the PostQuitMessage(0) not. It process some part of this function. I'm debugging the app and when it enters in this part: 7E419483 call 7E418860 The app doesn't process, it doesn't freeze, just doesn't continue to process other register. Anyone can help.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      You post the quit message before you destroy the window and exit the message loop before the window is destoyed. From WM_CLOSE, you should call DestroyWindow().  Then when you get the WM_DESTROY message, call PostQuitMessage. Also, your message loop is really inefficient.  You should use GetMessage(), not PeekMessage(). Also, why are you sending invalid WM_PAINT messages directly to windows?  You should never send a WM_PAINT message. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      A 1 Reply Last reply
      0
      • M Mark Salsbery

        You post the quit message before you destroy the window and exit the message loop before the window is destoyed. From WM_CLOSE, you should call DestroyWindow().  Then when you get the WM_DESTROY message, call PostQuitMessage. Also, your message loop is really inefficient.  You should use GetMessage(), not PeekMessage(). Also, why are you sending invalid WM_PAINT messages directly to windows?  You should never send a WM_PAINT message. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        A Offline
        A Offline
        Alex Cutovoi
        wrote on last edited by
        #3

        Mark, the window is destroyed, but when I look in the task manager the process continues in there. Do I need to close the mdi childs first? One of them is create with the RichEdit style. Is there a relation between the loaded dll("RichEd20.dll") and this fact? I putting the PeekMessage because in the RenderHwnd(an HWND that modified to receive OpenGL), I have some images that should be show in this window. I'm sending the WM_PAINT because if I don't do this, the RenderHwnd remains static, the WM_PAINT message is just processed if I move the window. Because this fact occurs, I send the WM_PAINT.

        M 1 Reply Last reply
        0
        • A Alex Cutovoi

          Mark, the window is destroyed, but when I look in the task manager the process continues in there. Do I need to close the mdi childs first? One of them is create with the RichEdit style. Is there a relation between the loaded dll("RichEd20.dll") and this fact? I putting the PeekMessage because in the RenderHwnd(an HWND that modified to receive OpenGL), I have some images that should be show in this window. I'm sending the WM_PAINT because if I don't do this, the RenderHwnd remains static, the WM_PAINT message is just processed if I move the window. Because this fact occurs, I send the WM_PAINT.

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          There's MANY messages that need to be processed before the windows are completely destroyed. You are exiting your message loop before these are processed. As far as the process not ending, I have no idea what you do after your message loop terminates. Again, you should NEVER send a WM_PAINT yourself.  There are other ways to properly mark a window for repainting.  See InvalidateRect(), UpdateWindow(), RedrawWindow(), etc. Your message loop is VERY inefficient (well, it should be efficient at using all your CPU cycles). Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          A 1 Reply Last reply
          0
          • M Mark Salsbery

            There's MANY messages that need to be processed before the windows are completely destroyed. You are exiting your message loop before these are processed. As far as the process not ending, I have no idea what you do after your message loop terminates. Again, you should NEVER send a WM_PAINT yourself.  There are other ways to properly mark a window for repainting.  See InvalidateRect(), UpdateWindow(), RedrawWindow(), etc. Your message loop is VERY inefficient (well, it should be efficient at using all your CPU cycles). Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            A Offline
            A Offline
            Alex Cutovoi
            wrote on last edited by
            #5

            Right, can you say what messages I need to handle to increase the code?

            M 1 Reply Last reply
            0
            • A Alex Cutovoi

              Right, can you say what messages I need to handle to increase the code?

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              Except for messages you need to handle, the default window proc is fine. The point is they'll never get processed if you exit your message loop. Here's an example of what I'm talking about - problems/changes marked in red. Note where I put PostQuitMessage() and where DestroyWindow() is called.

              /*Loop da janela*/
              WPARAM TemplateWindow::MessageLoop()
              {
                  while(GetMessage(&msg, m_hwnd, NULL, NULL))
                  {
                      if(m_uiType == MDI)
                      {
                          if(!TranslateMDISysAccel(m_hwndFrame, &msg))
                          {
                              TranslateMessage(&msg);
                              DispatchMessage(&msg);
                          }
                      }
                      if(m_uiType == SDI)
                      {
                          TranslateMessage(&msg);
                          DispatchMessage(&msg);
                      }

              // This is bad design - Using a timer is WAY more efficient
              //   than spinning in a loop that mostly does nothing except
              //   consume CPU
              //            }
              //        }
              //        else
              //        if(m_uiChildCount > 0)
              //        {
              //            SendMessage(childsInfo[0].hwnd, WM_PAINT, NULL, NULL);
              //        }
              //        SwapBuffers(m_hdc);
                  }

              return msg.wParam;
              }

              LRESULT CALLBACK MainWindowCallback(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
              {
                  HMENU hMainMenu;
                  hMainMenu = CreateMenu(); //<-- MAJOR resource leak!!!
                  static int siRuler = IDM_NEWRULER, siText = IDM_NEWTEXT, siNodule = IDM_NEWNODULE, siPath = IDM_NEWRULERPATH;
                  switch(uiMessage)
                  {
                  case WM_CREATE:
                  {
                &nb

              A 1 Reply Last reply
              0
              • M Mark Salsbery

                Except for messages you need to handle, the default window proc is fine. The point is they'll never get processed if you exit your message loop. Here's an example of what I'm talking about - problems/changes marked in red. Note where I put PostQuitMessage() and where DestroyWindow() is called.

                /*Loop da janela*/
                WPARAM TemplateWindow::MessageLoop()
                {
                    while(GetMessage(&msg, m_hwnd, NULL, NULL))
                    {
                        if(m_uiType == MDI)
                        {
                            if(!TranslateMDISysAccel(m_hwndFrame, &msg))
                            {
                                TranslateMessage(&msg);
                                DispatchMessage(&msg);
                            }
                        }
                        if(m_uiType == SDI)
                        {
                            TranslateMessage(&msg);
                            DispatchMessage(&msg);
                        }

                // This is bad design - Using a timer is WAY more efficient
                //   than spinning in a loop that mostly does nothing except
                //   consume CPU
                //            }
                //        }
                //        else
                //        if(m_uiChildCount > 0)
                //        {
                //            SendMessage(childsInfo[0].hwnd, WM_PAINT, NULL, NULL);
                //        }
                //        SwapBuffers(m_hdc);
                    }

                return msg.wParam;
                }

                LRESULT CALLBACK MainWindowCallback(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
                {
                    HMENU hMainMenu;
                    hMainMenu = CreateMenu(); //<-- MAJOR resource leak!!!
                    static int siRuler = IDM_NEWRULER, siText = IDM_NEWTEXT, siNodule = IDM_NEWNODULE, siPath = IDM_NEWRULERPATH;
                    switch(uiMessage)
                    {
                    case WM_CREATE:
                    {
                  &nb

                A Offline
                A Offline
                Alex Cutovoi
                wrote on last edited by
                #7

                Well Mike, I made the changes that you said to me, nut unhapilly it doesn't work. Any other suggestion? Thanks for the support man.

                M 1 Reply Last reply
                0
                • A Alex Cutovoi

                  Well Mike, I made the changes that you said to me, nut unhapilly it doesn't work. Any other suggestion? Thanks for the support man.

                  M Offline
                  M Offline
                  Mark Salsbery
                  wrote on last edited by
                  #8

                  I'm Mark :) How far is it getting?  If you set a breakpoint in your WM_CLOSE handler, does it get there? How about WM_NCDESTROY? Mark

                  Mark Salsbery Microsoft MVP - Visual C++ :java:

                  A 1 Reply Last reply
                  0
                  • M Mark Salsbery

                    I'm Mark :) How far is it getting?  If you set a breakpoint in your WM_CLOSE handler, does it get there? How about WM_NCDESTROY? Mark

                    Mark Salsbery Microsoft MVP - Visual C++ :java:

                    A Offline
                    A Offline
                    Alex Cutovoi
                    wrote on last edited by
                    #9

                    Either the WM_CLOSE and the WM_NCDESTROY stops on the place that I show to you. The code below is the code when it's debugged. 7E41DACF push 0 7E41DAD1 push 0Ch 7E41DAD3 pop edx 7E41DAD4 lea ecx,[ebp-0Ch] 7E41DAD7 mov dword ptr [ebp-0Ch],edi 7E41DADA call 7E4194A4 <==that is the place where it stops This thing is confusing my brain.

                    M 1 Reply Last reply
                    0
                    • A Alex Cutovoi

                      Either the WM_CLOSE and the WM_NCDESTROY stops on the place that I show to you. The code below is the code when it's debugged. 7E41DACF push 0 7E41DAD1 push 0Ch 7E41DAD3 pop edx 7E41DAD4 lea ecx,[ebp-0Ch] 7E41DAD7 mov dword ptr [ebp-0Ch],edi 7E41DADA call 7E4194A4 <==that is the place where it stops This thing is confusing my brain.

                      M Offline
                      M Offline
                      Mark Salsbery
                      wrote on last edited by
                      #10

                      Heh.  I have NO idea where that assembly code is :) Can you post the code for your current message loop and your window procedures for the frame and the child windows? I'd be happy to look at it, but witout it I can only guess. Mark

                      Mark Salsbery Microsoft MVP - Visual C++ :java:

                      A 1 Reply Last reply
                      0
                      • M Mark Salsbery

                        Heh.  I have NO idea where that assembly code is :) Can you post the code for your current message loop and your window procedures for the frame and the child windows? I'd be happy to look at it, but witout it I can only guess. Mark

                        Mark Salsbery Microsoft MVP - Visual C++ :java:

                        A Offline
                        A Offline
                        Alex Cutovoi
                        wrote on last edited by
                        #11

                        Sure, I post now. The first code is for the message loop: WPARAM TemplateWindow::MessageLoop() { while(!m_bQuit) { if(PeekMessage(&msg, m_hwnd, NULL, NULL, PM_REMOVE)) { if(msg.message == WM_QUIT) { if(m_uiType == MDI)DestroyWindow(m_hwndFrame); m_bQuit = true; //UnregisterClass(wnd.lpszClassName, m_hInstance); break; } else { if(m_uiType == MDI) { if(!TranslateMDISysAccel(m_hwndFrame, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } if(m_uiType == SDI) { TranslateMessage(&msg); DispatchMessage(&msg); } } } else if(m_uiChildCount > 0) { SendMessage(childsInfo[0].hwnd, WM_PAINT, NULL, NULL); } SwapBuffers(m_hdc); } return msg.wParam; } And the following codes is the callback for my windows. Look at the codes. Again, thanks for your help. #ifndef CALLBACKS_H #define CALLBACKS_H #include #include #include #include WindowInfo windowInfos; //this is a struct that have the hwnd, hdc and the hglrc of child //windows GLUquadricObj * Cilinder; unsigned int uiList = 0; int iValueSelected = -1; HINSTANCE hRichEdit; //HINSTANCE used to load theRichEdit's dll control HWND g_hwndClient, FrameHwnd, RenderHwnd, InstructHwnd, DialogHwnd; LRESULT CALLBACK MainWindowCallback(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK InstructorWindowCallback(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK RenderWindowCallback(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK DialogWindowCallback(HWND, UINT, WPARAM, LPARAM); static bool bShow = false, bTrue = false; /*Instructor callback. Just a single callback defined to a richedit*/ LRESULT CALLBACK InstructorWindowCallback(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { HWND textBox = NULL, editBox = NULL; HFONT textFont = 0; switch(uiMessage) { case WM_CREATE: { RECT richEditSize; hRichEdit = LoadLibrary("RichEd20.dll"); InstructHwnd = hwnd; GetClientRect(hwnd, &richEditSize); HINSTANCE hInst = ((LPCREATESTRUCT)lParam)->hInstance; if(hRichEdit != NULL) { editBox = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("RICHEDIT20A"), "", WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_HSCROLL|

                        M 1 Reply Last reply
                        0
                        • A Alex Cutovoi

                          Sure, I post now. The first code is for the message loop: WPARAM TemplateWindow::MessageLoop() { while(!m_bQuit) { if(PeekMessage(&msg, m_hwnd, NULL, NULL, PM_REMOVE)) { if(msg.message == WM_QUIT) { if(m_uiType == MDI)DestroyWindow(m_hwndFrame); m_bQuit = true; //UnregisterClass(wnd.lpszClassName, m_hInstance); break; } else { if(m_uiType == MDI) { if(!TranslateMDISysAccel(m_hwndFrame, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } if(m_uiType == SDI) { TranslateMessage(&msg); DispatchMessage(&msg); } } } else if(m_uiChildCount > 0) { SendMessage(childsInfo[0].hwnd, WM_PAINT, NULL, NULL); } SwapBuffers(m_hdc); } return msg.wParam; } And the following codes is the callback for my windows. Look at the codes. Again, thanks for your help. #ifndef CALLBACKS_H #define CALLBACKS_H #include #include #include #include WindowInfo windowInfos; //this is a struct that have the hwnd, hdc and the hglrc of child //windows GLUquadricObj * Cilinder; unsigned int uiList = 0; int iValueSelected = -1; HINSTANCE hRichEdit; //HINSTANCE used to load theRichEdit's dll control HWND g_hwndClient, FrameHwnd, RenderHwnd, InstructHwnd, DialogHwnd; LRESULT CALLBACK MainWindowCallback(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK InstructorWindowCallback(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK RenderWindowCallback(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK DialogWindowCallback(HWND, UINT, WPARAM, LPARAM); static bool bShow = false, bTrue = false; /*Instructor callback. Just a single callback defined to a richedit*/ LRESULT CALLBACK InstructorWindowCallback(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { HWND textBox = NULL, editBox = NULL; HFONT textFont = 0; switch(uiMessage) { case WM_CREATE: { RECT richEditSize; hRichEdit = LoadLibrary("RichEd20.dll"); InstructHwnd = hwnd; GetClientRect(hwnd, &richEditSize); HINSTANCE hInst = ((LPCREATESTRUCT)lParam)->hInstance; if(hRichEdit != NULL) { editBox = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("RICHEDIT20A"), "", WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_HSCROLL|

                          M Offline
                          M Offline
                          Mark Salsbery
                          wrote on last edited by
                          #12

                          Honestly, there's so many problems here it could take hours to reply. Many of the window messages are not handled correctly, proper return values aren't considered. You don't seem to want to fix your message loop - again, the way you have it now is BAD. It's going to perform terribly, and slow the rest of the system down. This has nothing to do with opengl.  It has everything to do with fundamental Windows messaging. I would recommend getting a basic MDI app up and running.  Just a frame window, an MDI client, and child windows.  You should be able to create windows, destroy windows, and cleanly terminate the application.  The few messages related to these tasks should be handled properly, with the unhandled messages being handled by the default window procedure. Mark

                          Mark Salsbery Microsoft MVP - Visual C++ :java:

                          A 1 Reply Last reply
                          0
                          • M Mark Salsbery

                            Honestly, there's so many problems here it could take hours to reply. Many of the window messages are not handled correctly, proper return values aren't considered. You don't seem to want to fix your message loop - again, the way you have it now is BAD. It's going to perform terribly, and slow the rest of the system down. This has nothing to do with opengl.  It has everything to do with fundamental Windows messaging. I would recommend getting a basic MDI app up and running.  Just a frame window, an MDI client, and child windows.  You should be able to create windows, destroy windows, and cleanly terminate the application.  The few messages related to these tasks should be handled properly, with the unhandled messages being handled by the default window procedure. Mark

                            Mark Salsbery Microsoft MVP - Visual C++ :java:

                            A Offline
                            A Offline
                            Alex Cutovoi
                            wrote on last edited by
                            #13

                            man, I would be very happy if you point me out some errors about the messages that are not handled correctly. I'm a little bit new in MDI with Win32. The strange is in my machine, this code works fine. But in other 2 machines not.

                            M 1 Reply Last reply
                            0
                            • A Alex Cutovoi

                              man, I would be very happy if you point me out some errors about the messages that are not handled correctly. I'm a little bit new in MDI with Win32. The strange is in my machine, this code works fine. But in other 2 machines not.

                              M Offline
                              M Offline
                              Mark Salsbery
                              wrote on last edited by
                              #14

                              I posted a project (zipped) here[^] The project is for VS 205 - if you're using a lower version and you want to run the code in the debugger, , you can just extract the 3 header files, 2 cpp fles, 1 rc file, and 2 ico files and put them in an empty project created with your VS. It's a simple Win32 MDI app with the frame/MDI client and one child window class. The project started as a Win32 wizard-generated project and I changed the appropriate window stuff to MDI. All the code's in one CPP file.  I added comments in the window procedures (callbacks). Some of the key things are: Make sure you return the proper value after handling messages - many are the same, some are different. Make sure you call the default window procedure for certain messages that require it in MDI - They are documented here[^] Proper DestroyWindow()/PostQuitMessage sequence Also shown is a proper message loop.  Once you get your windows working properly I should be able to help you get your painting and redrawing up and running.  You definitely don't need to spin in a loop, nor do you want to - you'll get really bad graphics and system performance :)  I think you'll be much happier using all those CPU cycles for drawing instead of spinning in a loop doing nothing. Feel free to email me as well as posting here - just click the email link at the bottom of my posts. Cheers, Mark

                              Mark Salsbery Microsoft MVP - Visual C++ :java:

                              A 1 Reply Last reply
                              0
                              • M Mark Salsbery

                                I posted a project (zipped) here[^] The project is for VS 205 - if you're using a lower version and you want to run the code in the debugger, , you can just extract the 3 header files, 2 cpp fles, 1 rc file, and 2 ico files and put them in an empty project created with your VS. It's a simple Win32 MDI app with the frame/MDI client and one child window class. The project started as a Win32 wizard-generated project and I changed the appropriate window stuff to MDI. All the code's in one CPP file.  I added comments in the window procedures (callbacks). Some of the key things are: Make sure you return the proper value after handling messages - many are the same, some are different. Make sure you call the default window procedure for certain messages that require it in MDI - They are documented here[^] Proper DestroyWindow()/PostQuitMessage sequence Also shown is a proper message loop.  Once you get your windows working properly I should be able to help you get your painting and redrawing up and running.  You definitely don't need to spin in a loop, nor do you want to - you'll get really bad graphics and system performance :)  I think you'll be much happier using all those CPU cycles for drawing instead of spinning in a loop doing nothing. Feel free to email me as well as posting here - just click the email link at the bottom of my posts. Cheers, Mark

                                Mark Salsbery Microsoft MVP - Visual C++ :java:

                                A Offline
                                A Offline
                                Alex Cutovoi
                                wrote on last edited by
                                #15

                                Thanks for your post man. I'll look the code.

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups