Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I wonder whether it is possible to send or post a Window message, such as WM_COPYDATA, to an application that is running on a different computer on the same network. I guess the answer is "no" but if someone has different experience, please tell - and say how I can get a window handle for that process.

The background is that I must control a 3rd party application that accepts commands via WM_COPYDATA. This application is part of a machine and comes along with its own PC, and I'd rather not hamper with the configuration of that PC. My current solution is to run an intermediate application that receives data from the control application and forwards it to the 3rd party app via WM_COPYDATA, but this intermediate application must still run on the 3rd party PC.

Thank you for any comments.
Posted

1 solution

No. Of course, you can create some bridge/tunnel with some kind of network transport, but I'll tell you: it makes no practical sense.

Here is why:

Even the fact that you can exchange Windows messages across processes on the same computer, is the very weird historical artifact. The story started with the versions of Windows bases on MS-DOS. Those versions were not OS, they were the graphical shells over DOS. Later on, protected mode of Intel 80386 was uses (by a number of well-known limitations, it was not successful on 80286). Even then, Windows (Windows 95) was still a shell; and the protected mode was uses with a very weak protection. The user still could access the memory of other processes.

In parallel, Windows NT (and New Technology) was created, where the processes were strictly isolated. They started to have separate address spaces. Still, for compatibility with old Windows API, data exchange through old legacy Windows messages remains possible. This contradicts to the dominating OS architectural principles. I guess, Microsoft had hard time to reproduce this legacy behavior. Overall, exchange with Windows messages is a dead end. Using it is technically possible but will take you nowhere.

Use normal networking approaches, from sockets to .NET remoting, WCF, other messaging APIs.

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900