Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Capture Windows Messages sent from a API to VFP. HELP!
Message
De
20/01/2001 05:42:57
 
 
À
20/01/2001 05:32:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00466118
Message ID:
00466136
Vues:
13
>>> If however you want to physically plumb into the message queue you can do one of two things. First you can subclass an applications message queue or window procedure, secondly you define a system wide message hook. Both of these options are relatively easy to do and examples can be found on MSDN. I actually use the first option in my VFPEvents.fll to monitor the message queue and perform MessageBox manipulation, however its in C++.
>
>>> Yes, Spy++ will observe the messages sent to a Window, but in order to fire VFP code in reaction to the arrival of a WM_USER-type message, something has to hook the message and fire an event that VFP knows how to handle - an FLL or a COM object coupled to Fox Code using VFPCOM can do this; you need an entrypoint to pass to the API call that tells Window to route windows messages to your code that reacts to the two WM_ messages being sent by the other app and notifies VFP to trigger some codee in response (not to mention to catch the message and place that somewhere VFP can read it. Appleman covers this in some detail in his book; he could use your sample FLL or Christof's assuming source were available, catch teh message(s) of interest, and copy the message structure to an accessible location - a publoc property of the COM object, or directly to a VFP variable from within an FLL. Another option would be to create the same thing as a straight DLL, and tying a Windows event to it - he
>could use ClsEvent to let VFP wait on a Windows event to be raised by the DLL and make a further call to the DLL to retrieve the message(s) pending. But some code, written in a language other than VFP is needed at some level.
>
>Maybe my post wasn't clear but if you go and look at what my VFPEvents.fll does then you will see that it fires VFP code whilst plumbed into both the VFP message queue and the VFP event subsystem. I will be happy to give Gary code that does this in a complete FLL.

Great - Appleman's code leverages the Desaware API library (provided with the CD in the book) to hook the Windows message event loop; I've generated some QUAD handlers for such in VB with relative ease, but the added complication of using VFPCOM to bind VFP code to COM events can be avoided with an FLL.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform