Questions tagged [wm-copydata]
63 questions
20
votes
3 answers
Use WM_COPYDATA to send data between processes
I wish to send text between processes. I have found lots of examples of this but none that I can get working. Here is what I have so far:
for the sending part:
COPYDATASTRUCT CDS;
CDS.dwData = 1;
CDS.cbData = 8;
CDS.lpData = NULL;
SendMessage(hwnd,…

Charles Gargent
- 1,797
- 2
- 13
- 19
11
votes
2 answers
C# to C++ process with WM_COPYDATA passing struct with strings
From a c# program I want to use WM_COPYDATA with SendMessage to communicate with a legacy c++/cli MFC application.
I want to pass a managed struct containing string objects.
I can find the handle to the c++ application for use with SendMessage…

James_UK_DEV
- 519
- 1
- 6
- 17
10
votes
1 answer
WM_COPYDATA SendMessage - Can it send big strings?
I will have to implement a WM_COPYDATA IPC between 2 applications. I have seem samples on internet, but all of them only send strings that are less than 255 characters.
I want to send a big string (more than 1k) to another process using WM_COPYDATA.…

Rafael Colucci
- 6,018
- 4
- 52
- 121
7
votes
2 answers
Thread message loop for a thread with a hidden window?
I have a Delphi 6 application that has a thread dedicated to communicating with a foreign application that uses SendMessage() and WM_COPYDATA messages to interface with external programs. Therefore, I create a hidden window with AllocateHWND() to…

Robert Oschler
- 14,153
- 18
- 94
- 227
7
votes
2 answers
Sending a struct from C++ to WPF using WM_COPYDATA
I have a native C++ application that, for the time being simply needs to send its command line string and current mouse cursor coordinates to a WPF application. The message is sent and received just fine, but I cannot convert the IntPtr instance in…

Matthew Olenik
- 3,577
- 1
- 28
- 31
6
votes
3 answers
Sending WM_COPYDATA with Python 3
I'm trying to write a python script that will interface with my copy of stickies. I'm having trouble with how Python interacts with the WM_COPYDATA struct, and unfortunately I haven't been able to find many examples online.
Using the code:
import…

Jacobm001
- 4,431
- 4
- 30
- 51
4
votes
2 answers
WM_COPYDATA: Can the receiver modify the COPYDATASTRUCT contents?
I am trying to communicate between two Windows applications in Delphi. Sender sends commands via SendMessage using WM_COPYDATA. That part is working fine. Is it possible for the receiver to reply back some result strings in the same call? It is…

ssh
- 943
- 1
- 14
- 23
4
votes
4 answers
WM_COPYDATA string not appearing in target application
I'm trying to pass information between two of my applications in Delphi 2010.
I'm using a simplified version of code that I've used successfully in the past (simplified because I don't need the sender to know that the send has been successful) …

Dan Kelly
- 2,634
- 5
- 41
- 61
3
votes
3 answers
Catch WM_COPYDATA from Delphi component
I'm trying to write a component, to send string messages between applications by WM_COPYDATA.
I'd like trap the WM_COPYDATA, but this doesn't work:
TMyMessage = class(TComponent)
private
{ Private declarations }
…
protected
{ Protected declarations…

Göme206
- 31
- 2
3
votes
0 answers
How to find message only window in C# by using FindWindowEx?
I think I've searched all of related topics on this planet by using Chinese and English but cannot find the solution.
I've created one message only window to receive and process the data from WM_COPYDATA, but I cannot find the window in send side,…

qingyunke
- 31
- 4
2
votes
1 answer
Is it possible to send a window handle with WM_COPYDATA?
I am trying to send an HWND with the WM_COPYDATA IPC method.
So far when sending a string LPCTSTR it works.
LPCTSTR str = L"Test";
COPYDATASTRUCT cds;
cds.dwData = 20;
cds.cbData = sizeof(TCHAR) * wcslen(str);
cds.lpData = (PVOID)str;
LRESULT l =…

Nur1
- 418
- 4
- 11
2
votes
1 answer
Marshall struct to pass it to delphi record via sendmessage
I am trying to pass a struct to delphi via c#, I have done following to pass the message, I followed the format from pinvoke to copy datat struct from https://www.pinvoke.net/default.aspx/Structures.COPYDATASTRUCT, but on delphi I am receiving no…

Gkush
- 45
- 8
2
votes
2 answers
Data transfer between different Delphi version apps via WM_COPYDATA
I'm trying to make to Delphi applications communicate with each other via WM_COPYDATA. The problem I'm having though is is that the sender app is written in Delphi 7 and the receiver is written in Delphi 10.2 . I copied my Delphi 7 program's code…

Adriaan Roets
- 41
- 4
2
votes
1 answer
delphi passing running parameters to other instance via wm_copydata gives wrong result in Delphi XE2
This code used to work with Delphi 5, but with delphi XE2 does not work as expected. The string passed using wm_copydata will be cut.
procedure SendAppParameters(aMsgStr: string);
var
hwnd: THandle;
cds: CopyDataStruct;
begin
hwnd :=…

user1238784
- 2,250
- 3
- 22
- 41
2
votes
2 answers
WM_COPYDATA won't deliver my string correctly
I tried to use WM_COPYDATA to send a string from one window to another. The messaages gets received perfectly by my receiving window. Except the string I send does not stay intact.
Here is my code in the sending application:
HWND wndsend = 0;
…

Jerome smith
- 45
- 6