Huw D M Davies wrote:
Huw Davies <[EMAIL PROTECTED]> For modal propsheets we should run our own message loop rather than use a modal dialogbox just like Windows does. This helps apps that subclass the propsheet's wndproc.
+static INT do_loop(PropSheetInfo *psInfo) +{ + MSG msg; + INT ret = 0; + HWND hwnd = psInfo->hwnd; + + while(IsWindow(hwnd) && !psInfo->ended && (ret = GetMessageW(&msg, NULL, 0, 0))) + { + if(ret == -1) + break; + + if(!IsDialogMessageW(hwnd, &msg)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + } + if(ret == 0) ret = -1; + + DestroyWindow(hwnd); + return ret; +}
If you get a WM_QUIT message while in the loop, then you have to repost it so that the application sees it and shuts down properly.
-- Rob Shearman