This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
RE: Setup query for Gary: InSendMessage/ReplyMessage
- From: "Gary R. Van Sickle" <g dot r dot vansickle at worldnet dot att dot net>
- To: <cygwin-apps at cygwin dot com>
- Date: Mon, 28 Jul 2003 21:01:53 -0500
- Subject: RE: Setup query for Gary: InSendMessage/ReplyMessage
> Gary,
>
> If I understand the Microsoft Docs, this is only necessary if a WndProc will
> receive SendMessages from other threads in the same app. None of our
> secondary threads call SendMessage - are you just adding it on a "better
> safe than sorry" basis, or is there something I've overlooked?
>
> Max.
>
IIRC, and I think I do, that is an artifact from my travails in trying to get
the "modalized modeless" propsheet to destry its window when you hit "Finish".
It turned out that in the message loop you have to do this:
if(!PropSheet_IsDialogMessage (GetHWND(), &msg))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
if (PropSheet_GetCurrentPageHwnd(GetHWND()) == NULL)
{
// No active page. This means the user hit "finish",
// so we're done here. Exit the loop.
return true;
}
instead of the MICROSOFT-DOCUMENTED WAY WHICH IS WRONG:
if (PropSheet_GetCurrentPageHwnd(GetHWND()) == NULL)
{
// No active page. This means the user hit "finish",
// so we're done here. Exit the loop.
return true;
}
if(!PropSheet_IsDialogMessage (GetHWND(), &msg))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
I was trying anything and everything, and I ran across the InSendMessage() docs
in the SDK so I figured it couldn't hurt. It doesn't, and since we do have
other threads that post messages, it'll probably only be a matter of time before
we're sending them too, so I'd recommend keeping this.
--
Gary R. Van Sickle
Brewer. Patriot.