The information in this article applies to:
SYMPTOMSWhen a modeless dialog box is launched from a dynamic-link library (DLL), the TAB key and the arrow keys do not move the focus from control to control as you would expect. CAUSEFor a modeless dialog box to process a TAB key, the message pump needs to call the IsDialogMessage API. However, if you are writing a DLL and do not have access to the .exe's source code, you cannot modify the message pump to do this. RESOLUTIONTo work around this problem, you can use a WH_GETMESSAGE hook to capture the keystroke messages and call the IsDialogMessage API. If IsDialogMessage returns TRUE, then do not pass the message on to the message pump. Set the hook when handling WM_INITDIALOG and unset it when handling the WM_DESTROY message. STATUSThis behavior is by design. MORE INFORMATIONThe following code illustrates how to set and unset the hook as well as how to use IsDialogMessage() to process TAB key messages:
The hook procedure, GetMsgProc, should resemble the following:
Additional query words: usrwndw usrdlg usrhooks usrhkgm usrtab
Keywords : kbDlg kbHook kbNTOS400 kbWinOS2000 kbSDKPlatform kbSDKWin32 kbGrpUser kbWinOS95 kbWinOS98 kbDSupport |
Last Reviewed: August 5, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |