PRB: TAB Key, Mnemonics with FindText and ReplaceText Dialogs

ID: Q96134

The information in this article applies to:

SYMPTOMS

When implementing the FindText and/or ReplaceText common dialog box, the dialog box is displayed but the TAB key and mnemonics do not work properly.

CAUSE

The FindText and ReplaceText common dialog boxes are modeless dialog boxes. Therefore, a call to IsDialogMessage must be made in the application's main message loop in order for the TAB key and mnemonics to work properly.

RESOLUTION

This problem can be corrected by adding a call to IsDialogMessage() in the application's main message loop.

MORE INFORMATION

A typical message loop might resemble the following:

   while (GetMessage(&msg,NULL,NULL,NULL))
     {
        if ( ghFFRDlg==NULL || !IsDialogMessage(ghFFRDlg, &msg) )
           {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
           }
     }

Where ghFFRDlg is a global window handle for the currently active modeless common dialog box.

Additional query words:

Keywords          : kbCmnDlg kbCmnDlgFind kbCmnDlgRepl kbNTOS kbGrpUser kbWinOS 
Issue type        : kbprb

Last Reviewed: December 26, 1998