Setup guide
Introduction to window messages
This chapter will show you a bit of the backgrounds behind Microsoft Windows' basic communication mechanism:
window messages.
Windows based applications are event driven, i.e. they get notifications and informations from the Operating
System about occured events (e.g. user input events like typing, mouse movements and mouse clicks, selection
of menu items or button clicks) in form of a special system structure, called a message. In the other direction, an
application can generate a message to the system (or other applications) to perform certain tasks or to inform
about changes.
A message consists of four parameters: a window handle, a message identifier and two values called message
parameters
. All four parameters are numerical values.
The window handle uniquely identifies the window across the system for which the message is intended. Since a
window handle is only valid for the life cycle of a window (i.e. the same window gets a different handle if you close
and reopen it), uICE uses a different approach to identify a window between two sessions: window paths.
Message identifiers are unique, predefined values, usually represented by aliases from the Win32 Software
Development Kit. Most system messages are meaningless in regards of application remote control, so the
number of interesting messages is reduced to a reasonable amount. These messages will be explained further in
Message types .
While the message identifier represents the system notification about the kind of occured event, the two message
parameters
give further information about the context of the event. As an example, when the user hits a key on
the keyboard, the message identifier notifies the application window that one of the keys has been pressed. The
window which receives this notification can now examine the message parameters to determine
which key it was.
Now why is this so important in regards of application remote control? As said, the Operating System notifies
applications about user input. uICE is able to monitor the communications between the system and other
applications, record user input events and replay them on demand. With this feature, you are able to simulate
keystrokes, menu item selections, pushbutton clicks and mouse clicks. Since messages are Windows'
native communcation mechanism, it is recommended to always try to control an application using this method. It
is the fastest and safest way.
One of the Win32 API functions which allow an application to generate a message is called PostMessage. This is
the function uICE uses to replay previously recorded messages. The following topics will show you how to record
messages and explain the different types of messages and their meaning.
Recording messages
This topic shows a step-by-
step example on how to record a message representing a menu selection. We will use
Microsoft Internet Explorer (version 5 or 6) as the example application, and set up a PostMessage action to open
and close Internet Explorer's Favorites toolbar. If you are not yet familiar with Windows' message mechanism,
read the Introduction to window messages first.
l
First, start uICE and Internet Explorer
l
Go to page Actions, create a new command and add a new action to the command. The Action Definition
window will pop up.
l
Now select the PostMessage action, located under Window Messages .
l
In the Action Parameter section of the window, click the button right to the Window field (make sure Internet
Explorer is running)