File: <Window Detective App Data>\data\message_definitions.xml

Many applications use custom messages to send information and/or commands between it's own windows or processes. For example; Process Hacker (another great open-source project) defines custom messages for it's graph window class.

If you wish to monitor such messages, you can define their names and parameters for Window Detective so they will be shown in the message pane. Otherwise, just the id and raw wParam/lParam values will be shown.

To define messages, edit the xml file mentioned above. It's format will look something like this:

<messages> <message_group class="MyClass"> <message id="0x1234" name="MY_MESSAGE_1"> <param type="uint32" name="foo" from="wParam" flags="FooFlags"/> <param type="int16" name="x" from="LOWORD(lParam)"/> <param type="int16" name="y" from="HIWORD(lParam)"/> </message> <message id="0x1235" name="MY_MESSAGE_2"> <param type="int32" name="type" from="wParam" enum="MyInfoType"/> <param type="HWND" name="window handle" from="lParam"/> <param type="bool" name="succeeded" from="return"/> </message> </message_group> </messages>

Data type names are defined in data\data_types.xml in the Window Detective install location. You can only use primitive types, structures are not supported for custom messages.

Parameters can be taken from wParam, lParam, or the return value (for returning messages). The LOWORD and HIWORD pseudo-functions act the same as their equivalents in Windows C/C++ programming - they take the low and high 16 bits respectively. LOBYTE and HIBYTE are also available. Bit-fields are currently not supported.


File: <Window Detective App Data>\data\constants.ini

Here you can define constants such as flags and enums, which you can use in "flags" and "enum" message parameters.