Tabs does not work in webbrowser control hosted by CAxWindow in CAxDialogImpl 
Author Message
 Tabs does not work in webbrowser control hosted by CAxWindow in CAxDialogImpl

Hi,

I'm implementing a DHTML based modal dialog using ATL. My dialog class
(CWizardDlg) is derived from CAxDialogImpl and contains a single
instance of CAxWindow to create and host the webbrowser control.

The CWizardDlg class is shown below.

My problem is that tabbing (or other accelerators) inside the DHTML
does not work. Also the first field in my DHTML does not get focus
when dialog is initially displayed.

My dialog resource has the 'Control Parent' style enabled.

I've understood from other posts that similar problems have been
solved by overriding PreTranslateMessage, but as I understand it this
method does not apply for dialogs.

How can I fix this problem?

Thanks in advance!
Ulrik

---------------------------------------
class CWizardDlg : public CAxDialogImpl<CWizardDlg>
{
        IDispatch* p_External;
        CAxWindow m_AxWindow;
public:
        CWizardDlg( IDispatch *External ) : p_External(External)
        {
        }

        BEGIN_MSG_MAP(CWizardDlg)
                MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
                MESSAGE_HANDLER(WM_CLOSE, OnCancel)
        END_MSG_MAP()

        LRESULT OnCancel(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
        {
                EndDialog(IDCANCEL);
                return 0;
        }

        LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
        {
                m_AxWindow = m_hWnd;
                if( SUCCEEDED(m_AxWindow.CreateControl(IDH_WIZARDCTRL)) )
                {
                        m_AxWindow.ModifyStyle( 0, WS_TABSTOP );
                        m_AxWindow.SetExternalDispatch(p_External);
                }

                static_cast<CWizardUI*>(p_External)->m_hWndDialog = m_hWnd;
                return 1;
        }

        enum { IDD = IDD_WIZARD };

Quote:
};



Sun, 06 Mar 2005 15:26:44 GMT  
 Tabs does not work in webbrowser control hosted by CAxWindow in CAxDialogImpl
See "WebBrowser Keystroke Problems" at

http://www.microsoft.com/mind/0499/faq/faq0499.asp

in particular "Win32 SDK Modal Dialogs" section.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Hi,

> I'm implementing a DHTML based modal dialog using ATL. My dialog class
> (CWizardDlg) is derived from CAxDialogImpl and contains a single
> instance of CAxWindow to create and host the webbrowser control.

> The CWizardDlg class is shown below.

> My problem is that tabbing (or other accelerators) inside the DHTML
> does not work. Also the first field in my DHTML does not get focus
> when dialog is initially displayed.

> My dialog resource has the 'Control Parent' style enabled.

> I've understood from other posts that similar problems have been
> solved by overriding PreTranslateMessage, but as I understand it this
> method does not apply for dialogs.

> How can I fix this problem?

> Thanks in advance!
> Ulrik

> ---------------------------------------
> class CWizardDlg : public CAxDialogImpl<CWizardDlg>
> {
> IDispatch* p_External;
> CAxWindow m_AxWindow;
> public:
> CWizardDlg( IDispatch *External ) : p_External(External)
> {
> }

> BEGIN_MSG_MAP(CWizardDlg)
> MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
> MESSAGE_HANDLER(WM_CLOSE, OnCancel)
> END_MSG_MAP()

> LRESULT OnCancel(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
> bHandled)
> {
> EndDialog(IDCANCEL);
> return 0;
> }

> LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
> bHandled)
> {
> m_AxWindow = m_hWnd;
> if( SUCCEEDED(m_AxWindow.CreateControl(IDH_WIZARDCTRL)) )
> {
> m_AxWindow.ModifyStyle( 0, WS_TABSTOP );
> m_AxWindow.SetExternalDispatch(p_External);
> }

> static_cast<CWizardUI*>(p_External)->m_hWndDialog = m_hWnd;
> return 1;
> }

> enum { IDD = IDD_WIZARD };
> };



Mon, 07 Mar 2005 03:56:39 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Hosting WebBrowser control in ATL CAxWindow

2. Hosting the WebBrowser Control using Visual C++/ATL does not work

3. Need help tabbing on control hosted in CAxDialogImpl

4. How to get a CAxWindow Hosted Control to draw when the Window is Not visible

5. Tab key to tab between controls does not work properly

6. CAxDialogImpl host Full Control Fail

7. CAxWindow - Hosted Control's Window Handle

8. CAxWindow for hosting ActiveX Controls

9. Problem with CAxDialogImpl and hosting multiple ActiveX Controls

10. Using CAxWindow to host a browser control

11. Hosting WebBrowser control problem.

12. Hosting a WebBrowser Control inside an activeX ?

 

 
Powered by phpBB® Forum Software