Print Page | Close Window

menu add dynamically and mouse hooking

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=15307
Printed Date: 09 May 2024 at 7:06pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: menu add dynamically and mouse hooking
Posted By: suchout
Subject: menu add dynamically and mouse hooking
Date 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
 
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net