Passing strings between different apps **RESOLVED**
How do I send a string as a message between two apps using SendMessage or PostMessage?
This is the code I have, but it doesn't work, since I think I will have to use WM_COPYDATA with SendMessage, as suggested by MerrionComputin.
'In the first project
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
'\\ Pointer validation in StringFromPointer
Private Declare Function IsBadStringPtrByLong Lib "kernel32" Alias "IsBadStringPtrA" (ByVal lpsz As Long, ByVal ucchMax As Long) As Long
Public Const GWL_WNDPROC = (-4)
Public lngPrevWndProc As Long
Public Const WM_USER = &H400
Public Const MY_MSG = WM_USER + 100
Public Function WindowProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Select Case uMsg
Case MY_MSG
MsgBox StringFromPointer(lParam, 12)
'what to do here
'lParam returns a pointer, how do I get the string