Is it possible to pass char* between 2 applications using a custom message in SendMessage? I know it is possible using WM_COPYDATA, but I want to know if I can send this using custom message(WM_USER + ..)
Thank you!
WM_COPYDATA has been specifically invented because what you ask is not feasible directly. This because different applications live in different address spaces, so a pointer passed from an application has no meaning in another one.
WM_COPYDATA deals with the problem by using some IPC mechanism under the hood, which is what you usually do when you want to share data with another application; viable options are the usual ones: pipes, shared memory & co, have a look here to see what Windows provides.
LocalAlloc; quite an interesting read if you like an historical approach to Win32. :)Here is good article which will help you in interprocess communication. It was helpful for me in sending string between two application.