Broadcast WM_USER message

I would like to do something similar to BroadcastSystemMessage, but broadcast a message of type WM_USER+whatever.

BroadcastSystemMessage won't support message types above WM_USER. It says the user must do "custom marshalling". Does anybody know how to do this?

The only reason I can think of that it can't be done would be is another application responds to the same WM_USER message in a different way. I still would like to take my chances on this one.

MSDN reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/postmessage.asp
LVL 6
rbohacAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mokuleCommented:
Hi,
You should first use RegisterWindowMessage in any application to communicate.
0
SaLzCommented:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    WM_BroadCast: DWord;
    procedure WndProc(var Message: TMessage); override;
  end;

var
  Form1: TForm1;  

implementation

{$R *.dfm}

{ TForm1 }

procedure TForm1.WndProc(var Message: TMessage);
begin
  if Message.Msg = WM_BroadCast then
    ShowMessage('Angekommen')
  else
    inherited;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  BroadcastSystemMessage(BSF_FORCEIFHUNG or BSF_POSTMESSAGE, nil, WM_BroadCast, 0, 0);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  WM_BroadCast := RegisterWindowMessage('WM_BroadCast');
end;

end.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rbohacAuthor Commented:
Interesting. Thanks, I will give that a try this afternoon.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.