Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP listening to other app's messages
Message
From
25/09/2007 12:32:48
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
VFP listening to other app's messages
Miscellaneous
Thread ID:
01256698
Message ID:
01256698
Views:
76
Hello,

I am trying to accomplish something that I was thinking would be fairly simple and it's not working out so well. I am wondering if there is any way for VFP to use bindevents() to respond to windows events that are created by other applications.

For instance, to keep things simple let's say we have notepad open and someone moves it. I got the feeling by reading around a bit that I should be able to make a call to bindevents in a VFP form or app that would call an event handler that could act on that.

I can get this to work pretty much like I would expect if I make the call to bindevents and pass a VFP window handle, like:
bindevent(this.HWnd , 0x0003 , thisform.oHandler ,'yEvent')
When I resize thisform, the event handler fires correctly. However if I acquire the handle of the notepad window and sent that as the first parameter or even send 0 as the first parameter, the event handler does not fire.

After a frustrating day I did some more reading on the windows messaging que and I'm starting to think that there are separate message ques for different threads or apps and that I can't just have my VFP app listen to windows messages created by a specific application and respond to them.

The main point is that I was hoping to get two apps that are written in two different languages and will be running with separate threads talking to each other. I understand (I think) that in the end I'll need to be posting custom messages in one app to another app that should be listening to them, but I was hoping that before I started all that I could get a much simple 'proof of concept' working by having my VFP app just listen and respond to notepad created windows events.

So, is what I'm trying to do even possible, and if so, can anyone point me in a direction that would get me a little closer to having this all hit me and come together?

Thanks in advance,
Next
Reply
Map
View

Click here to load this message in the networking platform