Subject: Re: Win32 Word Count dialog
From: Henrik Berg (henrik@lansen.se)
Date: Fri Jun 23 2000 - 11:52:40 CDT
> I still cannot for the life of me get the focus to move between controls
> in the dialog with the tab button. I've spent far too much time on it this
> week, so unless anybody has suggestions on what to try I'm going to give up
> on this one for a while and move on to other things (namely the Go To
> dialog).
There is a way, silly of me to send a reply without full info, but I in the middle of somethings. The basic (from the top of my head) is that you need to call a a function before TranslateMessage().
Okey, I surrender, I have to take the time to do this right. I't like this:
for( ;; )
{
// GetMessage returns zero only when WM_QUIT occurs
if( !GetMessage( &msg, NULL, 0, 0 ) )
break;
if( m_hModeless && IsDialogMessage( m_hModeless, &msg ) )
continue;
// Translate and dispatch message
TranslateMessage( &msg );
DispatchMessage( &msg );
}
This is the message loop. The new thing is IsDialogMessage that must be called for the currently active modeless dialog.
Set m_hModeless to the Dialog hWnd when we get WM_ACTIVATE=true and set it to NULL when WM_ACTIVATE=false. WM_ACTIVATE recived at the modeless dialog that is.
This works, and solved the exact same problem for a friend of mine.
--hb
This archive was generated by hypermail 2b25 : Fri Jun 23 2000 - 13:57:36 CDT