Linux equivalent of Windows' SendMessage

Date: 03/30/05

Date: Thu, 31 Mar 2005 00:17:04 +1000

I am new to Linux and trying to move my apps from Windows to Linux.
In Windows I can define a custom message and register it with the OS and by
using SendMessage(HWND_BROADCAST,...) I can send messages to multiple

How to do the same thing in Linux ? ie How to define a custom message,
register it and broadcast that message to multiple applications?

// Following code is copied from a demo program written in Borland C++
Builder Ver 6
const AnsiString PrivateMessageID =
int N =0;
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
  PrivateMessage = RegisterWindowMessage(PrivateMessageID.c_str());
void __fastcall TForm1::WndProc(Messages::TMessage& Message)
  if (Message.Msg == PrivateMessage) {
     if (Message.WParam ==0){ // Display only the first message
        AnsiString S;
        S.sprintf("%d - WParam: %.05d LParam: %.05d at %s",
                  N, Message.WParam,
                  Message.LParam, AnsiString(Now()).c_str()
void __fastcall TForm1::Button1Click(TObject *Sender)
  TDateTime T0, T1;
  T0 = Now();
  for (int i=0; i<100; i++)
  T1 = Now();
  AnsiString S;
  DateTimeToString(S, "ss:zzz",T1-T0);
  Caption = S; // <--- It display around 02.804 sec on 2GHz notebook PC

See also : "Sending and receiving custom messages" by Hens Zimmerman URL:

Relevant Pages

  • Re: Computer guru on switching to Linux from Windows: it sucks, dont do it.
    ... My advice to you would be to register here... ... download costs of Linux distributions in the outback to new Windows ... Of all software vendors in existence, Microsoft has the biggest ...
  • Re: China Replaces Windoze With Linux, World To Follow
    ... >>A poor Communist country tries to enhance Linux, ... >>eventually be 70% as good as Windows. ... Why has Microsoft chosen to make removing spyware ... I think you'll find that the "Do you want to register your downloads ...
  • Slightly off topic: Help a Cheapskate
    ... If you register you can get their Standard Version Free. ... register, and download it. ... I could win a FREE Upgrade to their PRO Version which compiles apps for Windows, Linux and Apple Mac. ...
  • z Linux es más seguro que Windows. Confirmado
    ... Un reciente estudio de The Register vuelve a poner en el candelero la ... operativos Windows y Linux en sus ediciones servidoras. ... The Register ha comparado las 40 últimas vulnerabilidades y parches ... segura de Windows - como en Red Hat Enterprise Linux AS v.3. ...
  • Re: Linux equivalent of Windows SendMessage
    ... In Windows I can define a custom message and register it with the OS and by ... How to do the same thing in Linux? ... Be sure to describe what purpose SendMessage serves, and bear in mind that windows and Linux have fundamentally different multitasking models. ... CLC FAQ ...