How to get the handle of a Popup Menu for a window?
-
If I high-light some text in a window and right-click the mouse, there will be a popup menu with items like copy, cut, paste, etc. If I know the handle of the window, how to get the handle of the popup menu? I know about the GetMenu API, does it do what I want? This is for a non-MFC app. Please note that I don't want to create a new menu, just needs the handle of the existing popup menu. Thanks.[
My articles and software tools
-
If I high-light some text in a window and right-click the mouse, there will be a popup menu with items like copy, cut, paste, etc. If I know the handle of the window, how to get the handle of the popup menu? I know about the GetMenu API, does it do what I want? This is for a non-MFC app. Please note that I don't want to create a new menu, just needs the handle of the existing popup menu. Thanks.[
My articles and software tools
you can use GetMenu api which gives u the main menu handle and then use the getsubmenu passing the menu handle. for creating the popup menu the following link help u.. http://dietmonday.com/windows/WinDoc/msdn/sdk/platforms/doc/sdk/win32/func/src/f88_14.htm Thanks and Regards Laxman FAILURE is the first step towards SUCCESS :cool: -- modified at 23:34 Tuesday 24th January, 2006
-
If I high-light some text in a window and right-click the mouse, there will be a popup menu with items like copy, cut, paste, etc. If I know the handle of the window, how to get the handle of the popup menu? I know about the GetMenu API, does it do what I want? This is for a non-MFC app. Please note that I don't want to create a new menu, just needs the handle of the existing popup menu. Thanks.[
My articles and software tools
Generally, the menu is created just before it is used and destroyed afterwards (most developers would do it this way), so you can't get a handle to it. Even if it was kept around, there is no API to get its handle because it is not a Windows function - the application takes care of creating and storing it, and just calls
TrackPopupMenu()
when necessary to display it.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
If I high-light some text in a window and right-click the mouse, there will be a popup menu with items like copy, cut, paste, etc. If I know the handle of the window, how to get the handle of the popup menu? I know about the GetMenu API, does it do what I want? This is for a non-MFC app. Please note that I don't want to create a new menu, just needs the handle of the existing popup menu. Thanks.[
My articles and software tools
-
Generally, the menu is created just before it is used and destroyed afterwards (most developers would do it this way), so you can't get a handle to it. Even if it was kept around, there is no API to get its handle because it is not a Windows function - the application takes care of creating and storing it, and just calls
TrackPopupMenu()
when necessary to display it.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
Ryan Binns wrote:
the application takes care of creating and storing it, and just calls TrackPopupMenu() when necessary to display it.
What I want to do is adding some items to the menu, not replacing the menu. The application is not mine, I need to install a hook to get into the application. Currently I am trying other ways. Thanks.[
My articles and software tools