Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Window Handles
Message
From
15/06/1999 17:20:03
 
 
To
15/06/1999 13:15:03
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00230058
Message ID:
00230198
Views:
22
>I am new to API programming. Is there anyway to get the handle to windows and controls in FoxPro? I am trying to call a function within a DLL which requires both the handle to a window and the handle to a control within that window. Also, I am wondering how to get the value of WM_USER so that I can pick a unique identifier for the transfer message.
>
>The DLL function's declaration:
>int Init(HWND hWnd, HWND hMsgWnd, UINT nXferMsg, in nFlag);
>nXferMsg should be WM_USER + n
>

VFP doesn't behave well relative to other WinApps; individual controls do not necessarily have an hWnd of their own to use to send messages to them.

If VFP is the foreground process, the WinAPI call GetActiveWindow() will retrieve the hWnd for the VFP form currently on top. GetActiveWindow can be declared in VFP as follows:

DECLARE INTEGER GetActiveWindow IN WIN32API

There arre also functions in FoxTools that can get handles for various things in VFP - download George Tasker's excellent Extended Help for FoxTools from the File Section here.


WM_USER is a constant from Visual C; the base value is 0x0400; you can assign a value relative to that for your own uses. Be aware that other things do this too; you might do well to take a peek at VC++'s WINUSER.H in its INCLUDE directory.


>Any help would be greatly appreciated.
>
>Paul Ezerski
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform