HWND_BROADCAST and custom messages
Posted on 2002-04-18
I'm having problems sending a broadcast notification message between some apps I've written.
I can get HWND_BROADCAST to work with system messages. For example, the following code causes a Notify button to pop up a message window. Clicking any of the window titlebar buttons will also pop the message because these buttons also generate this message. The call to inherited is merely to allow normal processing so you can close the application.
BBCC_NEWMESSAGE = WM_SYSCOMMAND;
procedure NewMessage(var msg: TMessage); message BBCC_NEWMESSAGE;
procedure TformInjector.cmdNotifyClick(Sender: TObject);
procedure TformInjector.NewMessage(var msg: TMessage);
But if we change the constant like this
BBCC_NEWMESSAGE = WM_APP + 1;
then it stops working.
Can anyone tell me why WM_APP + x doesn't seem to be received, and what to do about it?
For the record, I've also tried WM_USER + 1