PRB: Modeless Dialog Box in a DLL Does Not Process TAB Key (233263)
The information in this article applies to:
- Microsoft Platform Software Development Kit (SDK) 1.0
This article was previously published under Q233263 SYMPTOMS
When 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.
CAUSE
For 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.
RESOLUTION
To 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.
STATUS
This behavior is by design.
Modification Type: | Minor | Last Reviewed: | 7/11/2005 |
---|
Keywords: | kbDlg kbHook kbprb KB233263 |
---|
|