I have a small application that has a message only WTL window which does the background processing. But under some circumstances I would like to show a window that should behave as modal, that is, the message handler of message only window should not return until the user has clicked the button.
I was thinking that I could do it like this (pseudocode):
LRESULT OnMessageWndHandler1(...)
{
CModalWindow wnd;
wnd.create(...)
while(GetMessageLoop){}
}
But when I try, the window is created just fine, but pressing a key outputs tens of characters in modal windows editbox, not a single one like in regular window.
Most likely I'm doing something wrong, but I don't know what and what should be the correct approach. The modal window is completely code generated.
In my Unusual but Useful Dialog-based Classes Designed for Specialization you will find the way to call DoModal() on any control or homemade window.