How To Pass String Data Between Applications Using SendMessage (176058)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q176058 SUMMARY
There are many ways to achieve inter-process communication using Visual
Basic. Unless you establish an OLE Automation client server relationship,
string data is difficult to handle cleanly. The main reason is that 32-bit
applications run in a separate address space, so the address of a string in
one application is not meaningful to another application in a different
address space. Using the SendMessage() API function to pass a WM_COPYDATA
message avoids this problem.
This article demonstrates how to pass string data from one application to
another by using the SendMessage API function with the WM_COPYDATA message.
REFERENCES
For more information, please see the following articles in the Microsoft
Knowledge Base:
168795 How To Hook Into a Window's Messages Using AddressOf
129947 INFO: Win32 Replacement for the hmemcpy Function
Modification Type: | Minor | Last Reviewed: | 3/11/2005 |
---|
Keywords: | kbAPI kbhowto KB176058 |
---|
|