Re: Processing a specific user message during a non UI function
You could do what MFC does to simulate a modal dialog.
Disable the app's main window for the duration of the operation.
Perform the lengthy operation on another thread.
Process your app-specific message as usual.
Enable the main window when it's OK for the user to use the UI.
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"Dave Moran" <dmoran@nospam.nospam> wrote in message
news:5F35CABD-7862-4A67-BCE4-0EC1EB1A9729@microsoft.com...
In my MFC application if a data item is added, a user defined message is
posted to update a map. I've written a new feature which imports data in a
single thread, ignoring all windows messages until the end. This is
necessary
otherwise the user could continue using the UI and probably crash the
program. However I now realise that I need to process the user defined
message during the import, but ignore the other messages or the things can
get out of sync.
I've looked at PeekMessage & PumpMessage, but they seems to be wasteful of
resources and tricky to target at a specific message. How can I look for
the
specific message and force it be processed? I seen hooks mentioned, but
I'm
not sure what is meant by them.
Dave