>API function SendMessage sends messages to windows, not to applications. >Each window (including every FoxPro form) runs a constant loop. Inside this loop it checks for incoming messages. > >Check links for WindowProc >http://www.news2news.com/vfp/?group=85&function=478 >http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/WindowProcedures/WindowProcedureReference/WindowProcedureFunctions/WindowProc.asp > >Messages are received from input devices (keyboard, mouse) and from many other sources. To read these messages the WindowProc of a particular window should be replaced with a user-defined function. For example it can be done with GetWindowLong and SetWindowLong API functions. > >FoxPro does not offer a direct way to control WindowProc. To do this you usually create either FLL or DLL, or ActiveX control -- all written in programming languages like VB, Delphi, C etc. > >Check this FoxPro example: > >How to intercept window messages sent to VFP form >http://www.news2news.com/vfp/?function=-1&example=307 > >This link shows what kind of messages a regular FoxPro form receives: >http://www.news2news.com/vfp/downloads/wm.dbf > >* * * >This mechanism is not exactly suitable for exchanging data between applications. To send a message from application A you have to know a window handle in application B. How do you get to know this handle? > >* * * >I would suggest you to check DDE functions in Visual FoxPro as a good way to let your applications to talk between themselves. > >* * * >Another way is using Mailslots or Pipes, or Sockets. >Take a look at FoxPro code samples (members area): > >Peer-to-peer LAN messenger built with Mailslot API functions >http://www.news2news.com/vfp/?example=410 > >How to create a non-blocking Winsock server >http://www.news2news.com/vfp/?example=412 > >A client for testing non-blocking Winsock server >http://www.news2news.com/vfp/?example=413