StageRace 2003 - Road Cycling Administration Help
border

Messaging Techniques

The following information is not specific to StageRace but is given as a technical reference for programmers that want to use the StageRace Messaging protocol.

Window Messages

Window messages are used within Windows® to communicate between separate application windows.

Window messages are identified by their unique message identifier. Message identifiers are numerical values, but are kept hidden (transparent) by string identifiers, such as "WM_USER".

On start-up of StageRace, all appropriate message strings are registered with Windows®.

Other applications can do the same, arranging all the applications to have the same correct and unique numerical identifiers to match the string identifiers.

Message Format

The Windows® API functions for inter-window messaging are defined like the one below:

BOOL PostMessage(

HWND hWnd, // handle of destination window
UINT Msg, // message to post
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter

);

(There are more API functions for messaging, this is just an example to illustrate the message format.)

Ergo the message format is like this:

Destination handle

Message ID

First parameter

Second parameter

HWND

UINT

WPARAM

LPARAM

32-bits window handle

32-bits unsigned integer

32-bits user-defined bit-string

32-bits user-defined bit-string

 

We suggest messages to be posted as global broadcast. In this case Destination handle = HWND_BROADCAST. This will cause your message to be sent to all top-level windows, but only the appropriate window will respond anyway due to the specific Message ID.

Message Extensions (Atoms)

Applications can register strings with Windows in exchange for an identifier of the ATOM type. These atom identifiers are used by the messages sent across windows to pass strings "by pointer".

Strictly, someone is responsible to clean up atom strings after use. For the defined messages StageRace will take responsibility to clean up the atoms.

Technical References

The inter-window communication is discussed in the library of the Microsoft® Developer Network (MSDN).

  • About Messages and Message Queues
    (http://msdn.microsoft.com / library / en-us / winui / winui / windowsuserinterface / windowing / messagesandmessagequeues / aboutmessagesandmessagequeues.asp)

    Start page for window messaging subjects
  • PostMessage
    (http://msdn.microsoft.com / library / en-us / winui / WinUI / WindowsUserInterface / Windowing / MessagesandMessageQueues / MessagesandMessageQueuesReference / MessagesandMessageQueuesFunctions / PostMessage.asp)

    Documentation on the PostMessage SDK function for posting messages
  • RegisterWindowMessage
    (http://msdn.microsoft.com / library / en-us / winui / WinUI / WindowsUserInterface / Windowing / MessagesandMessageQueues / MessagesandMessageQueuesReference / MessagesandMessageQueuesFunctions / RegisterWindowMessage.asp)

    Documentation on the RegisterWindowMessage SDK function for registering a message in Windows®
  • Atom Functions
    (http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/dataexchange/atoms.asp)

    Start page for atom functions, with shortcuts to GlobalAddAtom, GlobalGetAtomName and GlobalDeleteAtom

 

Go top

Converted from CHM to HTML with chm2web Standard 2.8 (unicode)