- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to nest three to four layers of modeless dialog boxes with several dialog boxes on each level. My question is do you need to setup a message loop for each modeless dialog box created, for each level or just one at the top to handle the whole thing ?? The message loop I'm talking about is
do while( GetMessage (mesg, NULL, 0, 0) )
if ( DlgIsDlgMessage(mesg) .EQV. .FALSE. ) then
Lret = TranslateMessage( mesg )
Iret = DispatchMessage( mesg )
end if
end do
Thanks
Ray
do while( GetMessage (mesg, NULL, 0, 0) )
if ( DlgIsDlgMessage(mesg) .EQV. .FALSE. ) then
Lret = TranslateMessage( mesg )
Iret = DispatchMessage( mesg )
end if
end do
Thanks
Ray
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you mean "nested modeless dialogs"? Are those actually child dialogs (as in tab controls)? Whatever, that message loop you posted looks fine to me. One message loop is enough.
Jugoslav
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Huh, I was wrong. I just checked modeless dialogs in my app and found that they don't respond to tab properly (which I didn't know for two years ;-)).
Now, I don't know what DlgIsDlgMessage exactly does (I have an old CVF version) so perhaps it does the stuff correctly. IsDialogMessage is actually related with processing of tab key, default buttons (Return and Esc) and similar. However, I dug out an article in MS's knowledge base (Q71450) which explains the way. So, if your code above
doesn't work (remind you, regarding tab key), the following line does:
Jugoslav
Now, I don't know what DlgIsDlgMessage exactly does (I have an old CVF version) so perhaps it does the stuff correctly. IsDialogMessage is actually related with processing of tab key, default buttons (Return and Esc) and similar. However, I dug out an article in MS's knowledge base (Q71450) which explains the way. So, if your code above
doesn't work (remind you, regarding tab key), the following line does:
if (.not.IsDialogMessage(GetActiveWindow(), mesg))
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page