|
-
Mar 6th, 2008, 03:18 PM
#1
Thread Starter
New Member
Read from Popup Menu
I need the VB6 code that will be able to read the highlighted text from a popup menu generated by a separate application.
This type of menu can be located using the following code.
‘Begin code
Declare Function GetDesktopWindow Lib "User32" () As Long
Declare Function FindWindowEx Lib "User32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Hwnd = FindWindowEx(GetDesktopWindow(), ByVal 0&, "#32768", vbNullString)
‘end code
What I need is a function that I can send the Hwnd for the menu to, and have it return the text of the selected item if any item is selected.
Ideally, the function would return all text from the menu but must be able to determine which item is selected.
Popup menus do not seem to respond to normal menu calls, such as GetMenuItemCount, GetMenuItemInfo . Can't use the mouse, this is an automation project.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|