Hi SuperMario,
thanks a lot for your time.
May be that I don't explain well my problem so I resume.
I have an old application that use ActiveBar from DataDynamics and i want to change ActiveBar with XtremeSuite. I want to change the activex but, if possible, i don't want to change the application architecture.
The application have a main menu, the buttons on the main menu can launch procedures or can drop down submenus. For the submenus the application create at runtime context menus and show it (showpopup). The context menu (submenu) are moved in the position of a standard submenu (shopopup x,y parameter) to give the user the look of a standard submenu.
Change context menu with standard submenu it's not applicable because the code of my application are tied for showpopup. Showpopup stop the code execution and wait for user input, standard submenu or execute method don't. My application must wait the user input or crash.
The code must move on this path. Your code doesn't apply to me:
You have standard submenu showed with execute method and Control.CloseSubMenuOnClick = False. This stop the menu on the screen but don't stop the code execution, yes you have an exit sub after execute method but my applicaton haven't. The rigth way is to show the menu with showpopup method, the Control.CloseSubMenuOnClick must be true.
But with showpopup method i have this problem:
1) In ActiveBar i can get the position of a button on mainmenu and starting from this i can give to showpopup the rigth x,y parameter. In XtremeCommandBar i have not a GetWindowRect for the button on main menu. So how i can get the correct x,y ? In attachment i give you a modified release of my last code sample. Here i get the correct position with this workaround:
1st) show the submenu as a standard menu with execute method
2nd) call GetWindowRect to get the rigth x,y of the submenu
3rd) show again the submenu as a context menu with showpop x,y
Look at the code. This work but it' s not so good because the double show.
2) With this code when i click an item on submenu (context menu) i don't get an execute event!!! So my submenu are useless!!!
I hope that this long message can help.
Thank a lot.
Maurizio
http://forum.codejock.com/uploads/Superpippo/2005-03-21_051210_popupmenu3.zip - 2005-03-21_051210_popupmenu3.zip
------------- SuperPippo
|