ATL ACTIVEX UI design
-
Hi all, I'm trying to use ATL(no mfc support) to develop a activex component used in IE, and I want to design UI like common windows including menu, view window and status bar, but all article I searched from web always use dialog style, no related article for my problem. Also, I have the code generated by wizard, Within my com component, I have the code block below:
CContainedWindow m_ctlStatic;
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
CHAIN_MSG_MAP(CComControl<CUniDocCtrl>)
ALT_MSG_MAP(1)
END_MSG_MAP()also, the OnCreate code is below:
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
RECT rc;
GetWindowRect(&rc);
rc.right -= rc.left;
rc.bottom -= rc.top;
rc.top = rc.left = 0;
m_ctlStatic.Create(m_hWnd, rc);
return 0;
}My idea is to replace the
m_ctlStatic.Create(m_hWnd, rc);
with my own windows create function and add menu, code is below:
m\_ctlStatic.Create(m\_hWnd, rc, \_T("hello"), WS\_CHILD | WS\_VISIBLE | ES\_MULTILINE | ES\_AUTOVSCROLL); HMENU hmenu; hmenu = LoadMenu(g\_hModule,MAKEINTRESOURCE(IDR\_MENU1)); m\_ctlStatic.SetMenu(hmenu);
It doesn't work at all, and also it jump to base method which display the "ALT 10.0" text. how to solve this problem, thanks in advance.