Thoughts of a random geek

Tuesday, November 18, 2008

Inter-process communication in Windows

MSDN on the many ways to do IPC, including links to each.

Abridged version -
  • memory mapped files are fast, but need wrapped in a mutex and can't be used over a network
  • WM_COPYDATA message is useful if you have a message pump. Windows automagically shares the address space for you.
  • Mailslots can broadcast to multiple receiving processes and work on a network
  • Pipes are guaranteed two-way communication and work over a network
  • Sockets are platform independent

There's more, but I don't have experience with DDE/COM.

Here's an awesome codeproject page discussing multiple ways to inject your code into another process, including how to subclass a control (like the Windows Start button, in the example it switches the left and right mouse buttons). The page is extremely informative and uses some IPC techniques.

No comments: