Your IPC callback in the exe is called in the context of a secondary thread. The VCL is not thread safe. So using VCL in there seems dangerous to me. Anyway, I'm not sure whether that is the real problem.
Does your application freeze? Or do the IPC messages simply seem to get lost?
sorry, problem again, this time it is under win xp.
i wrote a service program( running as LocalSystem) which inject the hook dll system-wide.
Then the service runs the application which CreateIpcQueue and waits for the dll to SendIpcMessage.
However, the application doesn't seem to receive anything from the dll.
I've tried running the application myself( as interactive user, local administrator), and it CAN receive ipc messages.
So you mean if that application is started from your service, then it doesn't work. But if you start it manually, then it does work? How do you know that it doesn't work? Are you logging the IPC message to a file or are you relying on message boxes?
Yes, I ShowMessage when the IPC handler is called, and I will log the messages to some files. I got no popup dialogs and no logs when the application is started from my service, but when I started it manually, it worked fine.
When your service starts the application, the app will most likely not run on the current desktop. So if you call ShowMessage there, the box will be invisible and nobody will close it. Get rid of those boxes, then it will probably work.