Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling another application
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01060286
Message ID:
01060777
Views:
11
Valentin,

Using the SendMessage and several Menu API functions it is possible to control some applications by sending virtual clicks to their menu items.

FoxPro code sample (members area):
Accessing Adobe Reader 7.0 main menu from VFP application
http://www.news2news.com/vfp/?example=495

API functions used
FindWindow
GetMenu
GetMenuItemCount
GetMenuItemID
GetSubMenu
GetWindowText
IsMenu
IsWindow
SendMessage
ShellExecute
SwitchToThisWindow


* * *
Another way is obtaining a handle to the application's window and its scanning child windows, finding buttons, checkboxes and other controls. Once control is found, a certain windows message can be dispatched to it that can switch its state.

This technique works only with windowed controls, and is not applicable to VFP controls, which are -- as have been stated many times by many people -- kind of "drawn" on FoxPro forms.

For example, it is possible to find the MessageBox dialog window and virtually click on any of its buttons from Visual FoxPro app.

Another VFP code sample:

Using Extended MessageBox() Class
http://www.news2news.com/vfp/?example=424
Previous
Reply
Map
View

Click here to load this message in the networking platform