Hi, I'm trying to add the capacity to interact with other application inside my app. More specifically I'm trying to add the capability to "activate" other apps command buttons based off there caption. I know I have to use the api to do this, so far this is where I'm at in the exploration of this concept.

Some aspects of my programs interaction will always remain true, the most important of which i think is that the window with the buttons and controls i want to activate are always going to be in the active foreground while my app is minimized. So I was thinking i could get the handle with

Public Declare Function GetForegroundWindow Lib "user32" () As Long

in a module and

lngWindowHandle = GetForegroundWindow

inside my apps form.

Now that I have the windows handle how do i get all the buttons handles and captions ?

I was looking at the EnumChildWindows api

Public Declare Function EnumChildWindows Lib "user32" (ByVal hwndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Any) As Long

But does this apply to buttons or only windows?

I do know how to use SendMessage and PostMessage to trigger the event based off the handle, but
I need to find out how to Get the handle based off the caption.
So far this is the information i have collected that i think would be helpful in determining the handles of buttons.

1. Handle of Desired Parent window or window with the controls
2. Desired Button Caption
3. Desired action to take.

If Anyone can give me a few pointers I'd really apreciate it.
Thanks

[email protected]