Im making my first file editor. I have a find dialog and a go to line dialog. In the dialogs, if you want to press tab to go to the next control you have to call IsDialogMessage in your loop. Do i have to call it for every dialog i have, or is there some better way?
Posted on 2001-07-26 15:19:43 by ChimpFace9000
if you make dialog with dialogbox(..) you already have all the keyboard functionality so you dont need any isdialogmessage
Posted on 2001-07-26 18:21:50 by Geecko
Yes i know that, but when you use CreateDialogParam, you have to use IsDialogMessage.
Posted on 2001-07-26 19:57:40 by ChimpFace9000
AFAICT, you only need one per active modeless dialog. So if you have three modeless dialogs, you need three calls to IsDialogMessage.
Posted on 2001-07-27 12:02:00 by tank
Thats what i thought, but i wasnt sure. Thanks.
Posted on 2001-07-27 12:27:15 by ChimpFace9000
I have had similar concerns. Have'nt gotten around to trying it yet but I figured I could store the "active" Dialog's hWnd in a global variable and use this var in the IsDialogMessage.

When you get the WM_SETFOCUS message in your dialog proc you retrive and store it's hWnd!


G. Falen
Posted on 2001-07-27 13:17:15 by gfalen
gfalen is correct, or at least it worked for me. :alright:
Posted on 2001-07-27 14:18:28 by anon
To avoid calling IsDialogMessage several times, handle WM_ACTIVATE in all modeless dialog procs:



case WM_ACTIVATE:
if (LOWORD(wparam) != WA_INACTIVE)
hWndDlg = hWnd;
break;


hWndDlg is a global variable and the hWnd parameter of IsDialogMessage.
Posted on 2001-07-28 11:36:29 by japheth