Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing Next menu item from Form's control box
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00520294
Message ID:
00520411
Views:
13
>HEllo George,
>
>
>>>Now, the question is "Is there any way to replace foxtools functions with their API analogs?"
>>Probably using FindWindow() to get the main VFP window, then FindWindowEx() to retrieve the child caption. FWIW, all VFP windows have the window handle hWnd as a property in 7.0.
>
>
>I'm using VFP6.0 SP4... Any samples of using FindwindowEX?
>
>Thanks in advance

Vlad,

This will do it without Foxtools. Of course, in VFP 7.0...< g >
DECLARE INTEGER FindWindowEx IN Win32API;
  INTEGER hwndParent, INTEGER hwndChildAfter,;
  STRING @lpszClass, STRING @lpszWindow
DECLARE INTEGER FindWindow IN Win32API;
  STRING @lpszClass, STRING @lpszWindow
DECLARE INTEGER GetWindow IN Win32API;
#DEFINE GW_HWNDNEXT 2
#DEFINE GW_CHILD 5
#DEFINE GW_HWNDLAST 1
* lcchild is the caption of the form of interest
lcparent = _SCREEN.Caption
* Get the main VFP window
lnhwnd = FindWindow(0, @lcparent)
* Get the first child window
lnchild = GetWindow(lnhwnd, GW_CHILD)
* Get the last child window (the VFP desktop)
lnlast = GetWindow(lnchild, GW_HWNDLAST)
* Get the handle of the window of interest
lnwindow = FindWindowEx(lnlast, 0, 0, @lcchild)
hth,
George

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

Click here to load this message in the networking platform