Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem With API Call
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00662553
Message ID:
00662650
Views:
17
>This goes along with the question I asked last week;
>
>I'm trying to trigger som action in EXE 1 from within EXE 2.
>
>I have the handle of EXE 1, and I want to call into it from
>within EXE 2. So I figured I could just call a menu item in
>the target EXE.
>
>So let me ask you this - I now have the code below; how would I call
>SendMessage to trigger a menu item?
>
>Many thanks George!
>
>
>
>This is temporary. Known handle for testing
>#DEFINE WIN_HANDLE 29229712
>
>CLEAR
>
>DO Declares
>
>nMenuHandle = GetMenu(WIN_HANDLE)
>nPadHandle = GetSubMenu(nMenuHandle, 0) && First pad on the menu
>nBarHandle = GetMenuItemId(nPadHandle, 0) && First bar
>
>
>* Need the correct syntax here

>*=SendMessage(WIN_HANDLE, , , )
>
>
>FUNCTION Declares
>
>  DECLARE INTEGER GetMenu IN User32;
>    INTEGER hWnd
>
>  DECLARE INTEGER GetMenuItemID IN User32;
>    INTEGER hWnd, INTEGER Pos
>
>  DECLARE INTEGER GetSubMenu IN User32;
>    INTEGER hWnd, INTEGER Pos
>
>  DECLARE INTEGER SendMessage IN user32;
>    INTEGER hWnd,;
>    INTEGER Msg,;
>    INTEGER wParam,;
>    INTEGER lParam
>
>RETURN
>


Kevin,

I've never tried it. My gut reaction would be to use the Windows Script Host's Shell object's SendKeys method to activate the menu item or SendMessage to send the desired key press combinations.

I'll poke around, however, and if I come up with something I'll let you know.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform