Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Window Handles
Message
 
To
15/06/1999 13:15:03
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00230058
Message ID:
00230077
Views:
23
>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
>
>Any help would be greatly appreciated.
>
>Paul Ezerski

Hi Paul,

VFP's controls aren't windows objects, so they don't have window handles. The forms, however, are and it's rather easy, with Foxtools to get an individual form's window handle. Use the following:
lnhwnd = _WhTohWnd(_WFindTitl(< Caption of the desired form >))
The define for WM_USER is 0x0400. Messages in the range of 0 to WM_USER - 1 are reserved for the system. Private window classes can use WM_USER through 0x7FFF.

Since you seem to be doing something with Windows messaging services, please note the VFP doesn't handle messages in the same fashion that other applications do. So you might run into some problems along the lines of, "Well, this works in...why doesn't it work with VFP?" and reason will be the message handling.
George

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

Click here to load this message in the networking platform