![]() |
menu add dynamically and mouse hooking |
Post Reply ![]() |
Author | |
suchout ![]() Groupie ![]() Joined: 29 September 2009 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() Posted: 06 October 2009 at 9:40pm |
Hello everybody! First, I'd like to beg your pardon that I'm quite poor in English. I developed a MDI application which make new User-Interface by call DLL. First, I called DLL with MainFrame's variable pCommandBars as an argument
---OK---
and .. in Dll , i initialized MenuBar and Toolbar so simple
---OK---
and .. UI Construction Button Clicked -> MenuBar , ToolBar Controls Clean up.
Question 1. How to Delete Menu Bar, ToolBar!
i try this.
--------------------------------------------------------------------------------------------------
nCount = pCommandBars->GetCount();
for (int j = 1; j < nCount; j++) { m_pToolBar = pCommandBars->GetAt(j); nCount2 = m_pToolBar->GetControlCount(); for (i = 0; i < nCount2; i++) {
m_pToolBar->GetControls()->Remove(0); } } --------------------------------------------------------------------------------------------------
but this way Not Deleted Toolbar all but deleted all of Toolbar's item
i want to delete ToolBar (Commandbar) All
and make some of User want count of Toolbar
but!!!!!!!
BuT!!!!!
In dll project , can not use this!
--------------------------------------------------------------------------------------------------
for (i = 1; i < pMainCommandBars->GetCount();i++) { //i == 0 -> menubar,
m_pToolBar = pMainCommandBars->GetAt(i); pMainCommandBars->Remove(pMainCommandBars->GetAt(i)); // M== Error!! }
-------------------------------------------------------------------------------------------------- and .. i use XML Document for get controls property (ex. Menu(item) - name , ID, Toolbar(button) - icon ID, ....)
---OK---
and .. re-construct MenuBar, ToolBar
but!!!!!!!
BuT!!!!!
In dll project , can not use this!
--------------------------------------------------------------------------------------------------
CXTPToolBar* pToolBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop); // <== make error
if (!pToolBar || !pToolBar->LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar\n"); return -1; } -------------------------------------------------------------------------------------------------- and .. skip error(using '/* , */' ^^;;;;) , i construct menu.
--------------------------------------------------------------------------------------------------
m_Menu.CreateMenu();
..initmenu()...
m_pMenuBar->GetControls()->LoadMenuW(&m_Menu);
--------------------------------------------------------------------------------------------------
but.!
BUT!!!
Execute Program!, i put mouse curser on the menu item
Boom~~~
so i think that why? but...i don't know that....ㅠㅠ
please help me
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |