Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
User defined Windows events
Message
 
To
11/09/1998 10:43:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00135476
Message ID:
00135502
Views:
12
>I am a C++ programmer that has been told to get a FoxPro program working with my API. From a FoxPro program I need to hand the API the window handle of the FoxPro program and a WM_USER event.
>
>1. How do I get the handle of the window to hand to the API?
>2. How do I trap the WM_USER event inside of FoxPro?
>
>This has been the only thing I haven't been able to figure out.
>
Hi Jay,

Ed's told you about getting the handle of a VFP form through foxtools. You can also use it to get the main window handle. The function MainhWnd() returns this value.

I don't think you're going to be able to trap the WM_USER message, however. I'm guessing that the function you're thinking of using is WindowProc(). Unfortunately, there isn't a way in VFP to create a callback function. The only other way I can think you might be able to accomplish this is through a timer and one of the other Window's message retrieval functions, such as GetMessage() or PeekMessage(). I should advise that I've never tried some like this with VFP. Further, the overhead required to process the timer events might make this impractical.

hth,
George

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

Click here to load this message in the networking platform