Article View: comp.os.ms-windows.programmer.misc
Article #1601Re: My own DialogBox call
From: Tom W. Brown
Date: Wed, 14 Oct 1992 20:14
Date: Wed, 14 Oct 1992 20:14
36 lines
1751 bytes
1751 bytes
In article <1992Oct13.143600.13108@fics.uucp>, kro@fics.uucp writes:
|> I would like to create an ordinary window containing the exact same items
|> that a dialogbox would, and then call some function which should return
|> when a specified event occurrs.
|>
|> I need to know what I should put into this function to make it appear as
|> a blocking operation (like the DialogBox call).
|>
|> Knut
Your function needs its own message loop, something like this...
...
while (!time_to_exit)
{
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
...
where 'time_to_exit' may be a global variable that is set when an appropriate
action occurs in your "dialog" window. Note that you may need more than just
the translate/dispatch here depending on your application -- e.g. you may
need to check for dialog messages and/or accelerators.
----------------------------------------------------------------------------
Tom Brown | "Strange women, lying in ponds, distributing
PE Nelson Systems | swords is no basis for a system of government."
twbrown@pe-nelson.com | Monty Python and the Holy Grail
----------------------------------------------------------------------------
Technical Details
Message-ID:
<634@lax.lax.pe-nelson.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrownReferences:
<1992Oct13.143600.13108@fics.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown From: twbrown@PE-Nelson.COM (Tom W. Brown) Newsgroups: comp.os.ms-windows.programmer.misc Subject: Re: My own DialogBox call Message-ID: <634@lax.lax.pe-nelson.com> Date: 14 Oct 92 20:14:33 GMT References: <1992Oct13.143600.13108@fics.uucp> Sender: news@lax.pe-nelson.com Organization: PE-Nelson Lines: 36