Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. ATL ACTIVEX UI design

ATL ACTIVEX UI design

Scheduled Pinned Locked Moved ATL / WTL / STL
c++comdesignhelptutorial
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    frankzf
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups