Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to fill the controller by an other process.

The handle can be found, but it is wrong when I call SendMessage().

Who can help me?
Posted
Updated 14-Aug-12 21:55pm
v2
Comments
Philip Stuyck 15-Aug-12 3:16am    
The link should be removed, it is some kind of chinese site and a download starts.
Joan M 15-Aug-12 3:55am    
Done. ;)
Philip Stuyck 15-Aug-12 4:32am    
I could have done it myself, I just noticed that I can do this ;-)
Joan M 15-Aug-12 3:56am    
Which is the error you are getting? what is it going wrong? detail please...
nv3 15-Aug-12 4:00am    
Operating system? Windows 7 to my knowledge protects a process's windows from being messed with by other processes.

1 solution

Bad idea, I would say. The processes are isolated, and you are trying to break it. Communication via the Windows handles is obsolete feature unique for Windows systems, not portable to any others, stemmed from the versions of Windows before it was an OS and when Intel protected mode CPU architecture was not yet used. Using it is generally bad. The proper way of inter-process communication is, well Inter-Process Communication, IPC:
http://en.wikipedia.org/wiki/Inter-process_communication[^].

If a process is some application with not accessible source code or an API (so you cannot make it an in-proc plug-in or something working in your process) and it is not designed to use any kind of IPC — then no luck. Before thinking of dirty tricks of using Windows handle manipulation, I would think really hard if the integration of it can really be justified, usually not.

—SA
 
Share this answer
 

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