Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making TAB key work on Windows dialog

I'm working on a Windows project with a simple dialog created with CreateWindowEx() it contains multiple panes loaded with CreateDialog() to load the layout from a resource file. On the child panes there are a number of controls including text boxes and buttons which I would like to use TAB to navigate around but all I get is the Windows 'bing' telling me that the key does not do anything. My message loop looks like this:

while( PeekMessage(&msg, 0, 0, 0, PM_REMOVE) )
{
    if( !IsDialogMessage(0, &msg) )
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
}

And each control window has WS_TABSTOP set in the style as well as the owner pane having WS_EX_CONTROLPARENT set.

Is there anything else I need to do to make the tab key work?

Thanks, J

like image 753
JWood Avatar asked Feb 26 '23 04:02

JWood


1 Answers

Try this:

http://support.microsoft.com/kb/71450 (How To Use One IsDialogMessage() Call for Many Modeless Dialogs)

You panes are modeless dialogs, and IsDialogMessage is responsible for handling Tab keys. I hope that this article exactly matches your case.

like image 109
Alex F Avatar answered Mar 05 '23 17:03

Alex F