Using Win32 functions in Visual FoxPro Image Gallery
Window Procedure
..msdn
CallWindowProc
DefWindowProc
WindowProc
Code examples:
Adding user-defined items to the Control Menu of VFP form (requires VFP9)
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Customizing the frame of top-level form: removing the standard frame (VFP9, Vista)
Detecting changes in connections to removable drives (VFP9)
Displaying hypertext links with the SysLink control (VFP9, Comctl32.dll)
Displaying icons in the system tray (VFP9)
Dragging files from Explorer window and dropping them on FoxPro control (requires VFP9)
How to block the PrintScreen key
How to disable the Windows Clipboard (VFP9)
How to hot-track menu item selection in top-level form (requires VFP9)
Monitoring clipboard content changes (VFP9)
Switching between keyboard layouts
Transparent Menu Class (requires VFP9)
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Using Month Calendar Control (VFP9, Comctl32.dll)
Using WM_COPYDATA for interprocess communication (VFP9)
Using WM_COPYDATA for interprocess communication (VFP9)

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:
An application sends the WM_COPYDATA message to pass data to another application running on the same PC.


The screen copy above shows a message sent from VFP to C# application. The MessageBox is invoked by C# form upon receiving the message.

See also:
  • Peer-to-peer LAN messenger built with Mailslot API functions
  • Using mailslots to send messages on the network
  • Using named pipes for interprocess communication
  • Using the NetMessageBufferSend to send messages on the network
  • How to create non-blocking Winsock server
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    6380 bytes  
    Created: 2008-03-28 13:32:01  
    Modified: 2008-04-03 11:52:28  
    Visits in 7 days: 109  
    Listed functions:
    CallWindowProc
    GetWindowLong
    GlobalAlloc
    GlobalFree
    GlobalSize
    SendMessage
    Printer friendly API declarations
    My comment:
    The forms belonging to different VFP sessions (different processes) can exchange data in the same way. The window handle stays global through the Windows session.

    The C# and VFP versions of this code sample are functionally identical. That allows exchanging data between .NET and VFP forms (applications).

    In real life situation, prior to exchanging data the forms must have exchanged their window handles. That can be arranged by each form broadcasting a specific message that the other forms would recognize and respond. The FindWindow API is another option.

    * * *
    Comparing to other ways of interprocess communication (named pipes, mailslots, Winsock) the WM_COPYDATA has a certain edge: no need to implement any listening part. The OS does it for you.

    * * *
    http://blogs.msdn.com/oldnewthing/archive/2003/12/11/56043.aspx
    if you need to pass more than 32767 characters of information to a child process, you`ll have to use something other than the command line.
    * * *
    Articles:
  • Interprocess Communications chapter on MSDN.
  • Foxpro Advisor Exchange Data Between Applications with Visual FoxPro 9 by Christof Wollenhaupt (recommended).
  • Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

    Privacy policy
    Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (54.158.214.111)
    3 sec.Function: 'CreateHardLink'
    Function group: 'File Management'
    6 sec.Function: 'accept'
    Function group: 'Windows Sockets 2 (Winsock)'
    16 sec.Function: 'GdipTranslateWorldTransform'
    Function group: 'GDI+ Graphics'
    21 sec.Function: 'FtpGetCurrentDirectory'
    28 sec.Function: 'MAPISendDocuments'
    3 day(s)Example: 'Using File Mapping for enumerating files opened by Visual FoxPro'
     Function: 'CryptStringToBinary'
     Function: 'JetCreateDatabase'
    Function group: 'Extensible Storage Engine (ESE, Jet Blue)'
     Function: 'midiOutGetDevCaps'
    Function group: 'Windows Multimedia'
     Function: 'NetUserGetLocalGroups'
    Function group: 'Network Management'
    Google
    Advertise here!