propsheet: run our own message loop for modal propsheets
Robert Shearman
rob at codeweavers.com
Wed Jun 15 09:12:12 CDT 2005
Huw D M Davies wrote:
> Huw Davies <huw at codeweavers.com>
> 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
More information about the wine-devel
mailing list