Not able to navigate to dialog controls by using the tab key
-
Tuesday, April 03, 2012 7:45 AM
Hi
I have created a modeless dialog by using the MFC and created various Edit controls, buttons, group boxes, Radio buttons, Check boxes to the dialog box, but I am not be able to navigate to the various dialog controls by using the TAB key.
I have set the TAB order by using the "CTRL+D" and tabstop property of the controls are true.
Please suggest how we can navigate to the dialog controls by using the TAB key.
Thank You
All Replies
-
Tuesday, April 03, 2012 11:13 AM
From your description, it is difficult to diagnose the problem. Can you give more details? Which kind of control cannot be accessed by <Tab>? Is it enabled? Are there child dialogs or property sheets? Is there any custom handler that intercepts the <Tab> key?
-
Tuesday, April 03, 2012 11:37 AM
Thanks for the response.
I am not able to navigate any of the controls (controls are enabled), and there is only one simple modeless dialog and no child windows and property sheets are there and also there is no any custom handlers are present.
I have created a COM component (ATL dll) with MFC support, which displays a button in the command bar of ms outlook and when user clicks the button the Modeless dialog will appears, everything is working fine but I am not be able to navigate to various dialog controls by using the TAB key.
Thank You
-
Tuesday, April 03, 2012 12:56 PM
I have created a modeless dialog by using the MFC and created various Edit controls, buttons, group boxes, Radio buttons, Check boxes to the dialog box, but I am not be able to navigate to the various dialog controls by using the TAB key.
I have set the TAB order by using the "CTRL+D" and tabstop property of the controls are true.
Please suggest how we can navigate to the dialog controls by using the TAB key.I'm not sure what you've done, but normal dialog navigation for
modeless dialogs relies on the application calling IsDialogMessage
somewhere.Dave
-
Tuesday, April 03, 2012 8:52 PM
Do you have any active x Control on your Dialog . What is the version of visual studio you are using . Have a look on this MSDN link may be this will help you.
http://support.microsoft.com/kb/884879
Thanks
Rupesh Shukla
-
Wednesday, April 04, 2012 6:21 AM
There is no active x control on the dialog; I have created a modeless dialog by using the MFC (Our application is a ATL dll with MFC support) and created various Edit controls, buttons, group boxes, Radio buttons, Check boxes to the dialog box.
When calling the same dialog as a modal dialog box; code snippet is as follows then TAB key, enter key and arrow keys are working fine.
CMyDlg dlg;
dlg.domodal();
===================
When opening the same dialog as modeless dialog then TAB key, enter key and arrow keys stopped working; code snippet is as follows:
CMyDlg *pCalDlg = new CMyDlg ();
pCalDlg->Create(CMyDlg::IDD);As modeless dialog does not have self message loops while modal dialogs have the message loops; I think that`s why TAB key, arrow key and enter keys are not working at the Modeless dialog; do we need to override PreTranslateMessage or is there any other way to resolve the problem.
Thank You
- Edited by Programmer1982 Wednesday, April 04, 2012 6:22 AM
-
Wednesday, April 04, 2012 6:38 AM
It works in case of regular MFC applications, but since you are working under Outlook, maybe you have to specify the second parameter of Create, i.e. the parent window. If you have just the HWND of main Outlook window, then try obtaining the parent CWnd using CWnd::FromHandlePermanent.
-
Wednesday, April 04, 2012 7:11 AM
Thank for your response.
I have tried the following code:
CWnd* pMainWnd = AfxGetMainWnd(); //Retrieve the handle of the Outlook window
BOOL bRet = Create(CMyDlg::IDD, pMainWnd );
As bRet is true Create called successfully.
but still TAB key, arrow key and enter keys are not working at the Modeless dialog.
Thank You
-
Wednesday, April 04, 2012 1:14 PM
Please suggest is it possible to create a modeless dialog from isnide a ATL with mfc support dll, which will create a button in command bar of MS Outlook and when user clicks the button then Modeless dialog will be appeared in which all keys (TAB, Arrow, enter keys) works fine.
Parent window of the Modeless dialog will be the MS Outlook window.
Thank You
-
Friday, April 13, 2012 6:16 PM
Please suggest is it possible to create a modeless dialog from isnide a ATL with mfc support dll, which will create a button in command bar of MS Outlook and when user clicks the button then Modeless dialog will be appeared in which all keys (TAB, Arrow, enter keys) works fine.
Parent window of the Modeless dialog will be the MS Outlook window.
Thank You
Yes it is possible basically you want to create a pugin for microsoft outlook you have to use IDTExtensibility2 interface for this. regarding second question it is easy to provide MFC support to ATL project . But to implement button and click in outlook you have to handle event sinking on your button, and you have to handle Outlook command Bar Button . Have a look on the following link it will help to do basic stuff regarding Dialog it will be normal dialog only nothing special.
Adding new Button and ToolBar to Microsoft Outlook
Thanks
Rupesh Shukla
-
Monday, May 14, 2012 6:42 AM
Thanks for your response.
>>Please suggest is it possible to create a modeless dialog from isnide a ATL with mfc support dll, which will create a button in command bar of MS Outlook and when user clicks the button then Modeless dialog will be appeared in which all keys (TAB, Arrow, enter keys) works fine.
I have already create a plug-In (Com component) which appears as a button in the command bar of MS Outlook and when user clicks on it then Modeless dialog appears.
But the main problem is that arrow key, Tab and enter keys are not working on the modeless dialog; do you have any idea that how arrow key, Tab keys will start working on Modeless dialog.
In case I will create modal dialog instead of modeless dialog then all the keys started working fine.
As per my understanding modeless dialogs do not have there own message loops that`s why the messages of the TAB key and arrow key are not coming to the modeless dialog that`s why these key`s are not working.
>>solution: As per my understanding this problem can be resolve by hooking the window proc of the Outlook.exe (Outlook main window) and translate and dispatch all the message which are related to the modeless dialog to the modeless dialog window then the arrow keys and tab keys will start working.
Please share your opinion regarding the above approach and please also share any better approach if any.
Thank You.

