MessageHistory
Version 2.0
Created Date: 08/20/2006
Updated Date: 01/18/2007
Description
Sometimes Citrix Technical Support needs to troubleshoot GUI, seamless, copy/paste, and other issues. The usual approach is to request window message traces using Spy++ or other tools. However, sometimes these tools are not available for customers, do not log all necessary information, are not easy to use, or simply do not work properly on some platforms (like 64-bit Windows).
The MessageHistory utility complements CTX106985 - WindowHistory 4.0 for 32-bit platforms, CTX109235 - WindowHistory64 4.0 for x64 platforms and CDF. It logs window messages sent and/or posted to windows in a session.
The utility has a simple and intuitive interface:

Features:
• Similar simple interface as in WindowHistory 4.0 for 32-bit platforms
• Both 32-bit and 64-bit versions (MessageHistory.exe and MessageHistory64.exe)
• 64-bit version can log messages from windows created by native 64-bit applications
• You can run both 32-bit and 64-bit versions at the same time to capture messages from all windows in 64-bit system
• Extremely fast logging
• Option for a circular buffer logging (helps to log messages for intermittent issues)
• Can be used in conjunction with WindowHistory 4.0 for 32-bit platforms or WindowHistory64 4.0 for x64 platforms for troubleshooting complex seamless scenarios
• Formatted output is sorted and includes process and thread ID, window class and title
• Additional Spy++-style log for bulk messages
• Shows keyboard and mouse messages in detail: virtual key and character codes, scan code, various flags and mouse coordinates
• Shows activation/deactivation parameters for focus messages
• Shows parameters, position and width/height for “size” and “move” messages
How to Use MessageHistory


PID.TID: 134.cd8
HWND: 00000000001908EA
Class: "Edit"
Title: ""
23:19:50:296 P WM_KEYDOWN (0x100) wParam: 0x10 lParam: 0x402a0001 Virtual key code: VK_SHIFT Previous key state: "down before" Repeat count: 1 Scan code: 0x2a
23:19:50:328 P WM_KEYDOWN (0x100) wParam: 0x48 lParam: 0x230001 Virtual key code: VK_H Previous key state: "up before" Repeat count: 1 Scan code: 0x23
23:19:50:328 P WM_CHAR (0x102) wParam: 0x48 lParam: 0x230001 Character code: 0x48 'H' Previous key state: "up before" Transition state: "pressed" Repeat count: 1 Scan code: 0x23
23:19:50:406 P WM_KEYUP (0x101) wParam: 0x48 lParam: 0xc0230001 Virtual key code: VK_H Repeat count: 1 Scan code: 0x23
23:19:50:421 P WM_KEYUP (0x101) wParam: 0x10 lParam: 0xc02a0001 Virtual key code: VK_SHIFT Repeat count: 1 Scan code: 0x2a
HWND: 00000000004B0950
Class: "Notepad"
Title: "Untitled - Notepad"
23:19:48:531 S WM_GETMINMAXINFO (0x24) wParam: 0x0 lParam: 0xaf710
23:19:48:531 S WM_NCCREATE (0x81) wParam: 0x0 lParam: 0xaf6e0
23:19:48:531 S WM_NCCALCSIZE (0x83) wParam: 0x0 lParam: 0xaf730
23:19:48:531 S WM_CREATE (0x1) wParam: 0x0 lParam: 0xaf6d0
23:19:48:531 S WM_WINDOWPOSCHANGING (0x46) wParam: 0x0 lParam: 0xafc70
23:19:48:531 S WM_GETMINMAXINFO (0x24) wParam: 0x0 lParam: 0xaf850
23:19:48:531 S WM_STYLECHANGING (0x7c) wParam: 0xffffffffffffffec lParam: 0xafc60
23:19:48:531 S WM_STYLECHANGED (0x7d) wParam: 0xffffffffffffffec lParam: 0xafc60
23:19:48:562 S WM_PARENTNOTIFY (0x210) wParam: 0xf0001 lParam: 0x630f56
23:19:48:562 S WM_NOTIFYFORMAT (0x55) wParam: 0x290fd8 lParam: 0x3
23:19:48:562 S WM_QUERYUISTATE (0x129) wParam: 0x0 lParam: 0x0
23:19:48:578 S WM_PARENTNOTIFY (0x210) wParam: 0x4010001 lParam: 0x290fd8
23:19:48:578 S WM_SETTEXT (0xc) wParam: 0x0 lParam: 0xafa20
23:19:48:578 S WM_SHOWWINDOW (0x18) wParam: 0x1 lParam: 0x0 Window in being shown
23:19:48:578 S WM_WINDOWPOSCHANGING (0x46) wParam: 0x0 lParam: 0xafc70
23:19:48:609 S WM_WINDOWPOSCHANGING (0x46) wParam: 0x0 lParam: 0xafc70
23:19:48:609 S WM_ACTIVATEAPP (0x1c) wParam: 0x1 lParam: 0x5dc Activated / TID of deactivated window: 0x5dc
23:19:48:609 S WM_NCACTIVATE (0x86) wParam: 0x1 lParam: 0x0
23:19:48:609 S WM_GETTEXT (0xd) wParam: 0xff lParam: 0xaefc0
23:19:48:609 S WM_ACTIVATE (0x6) wParam: 0x1 lParam: 0x0 WA_ACTIVE Window deactivated: 0x0
23:19:48:609 S WM_SETFOCUS (0x7) wParam: 0x0 lParam: 0x0 Window which has lost focus: 0x0
23:19:48:609 S WM_KILLFOCUS (0x8) wParam: 0x630f56 lParam: 0x0 Window which receives focus: 0x630f56
23:19:48:609 S WM_COMMAND (0x111) wParam: 0x200000f lParam: 0x630f56 ID: 0xf
23:19:48:609 S WM_COMMAND (0x111) wParam: 0x100000f lParam: 0x630f56 ID: 0xf
23:19:48:609 S WM_GETTEXT (0xd) wParam: 0xff lParam: 0xaefc0
23:19:48:609 S WM_WINDOWPOSCHANGED (0x47) wParam: 0x0 lParam: 0xafc70
23:19:48:609 S WM_SIZE (0x5) wParam: 0x0 lParam: 0x32e04a8 SIZE_RESTORED Width/Height (client area): 1192/814
23:19:48:625 S WM_MOVE (0x3) wParam: 0x0 lParam: 0xc4009e Left/Top: 158/196
23:19:48:625 S WM_GETICON (0x7f) wParam: 0x2 lParam: 0x0
23:19:48:625 S WM_GETICON (0x7f) wParam: 0x0 lParam: 0x0
23:19:48:625 S WM_GETICON (0x7f) wParam: 0x1 lParam: 0x0
23:19:48:625 S WM_SETCURSOR (0x20) wParam: 0x630f56 lParam: 0x2000001
5. Additional Spy++-style log is appended to examine bulk messages sorted by time, for example:
1:16:23:159 S PID: f80 TID: e8c HWND: 0x000C06E8 Class: "ListBox" Title: "" LB_GETTEXTLEN (0x18a) wParam: 0x0 lParam: 0x0
1:16:23:159 S PID: f80 TID: e8c HWND: 0x000C06E8 Class: "ListBox" Title: "" LB_GETTEXT (0x189) wParam: 0x0 lParam: 0x128acc
1:16:23:159 S PID: f80 TID: e8c HWND: 0x0065071C Class: "ListBox" Title: "" LB_RESETCONTENT (0x184) wParam: 0x0 lParam: 0x0
1:16:23:159 S PID: f80 TID: e8c HWND: 0x000A067C Class: "#32770" Title: "" WM_DELETEITEM (0x2d) wParam: 0x1bf5 lParam: 0x12c4e4
1:16:23:159 S PID: f80 TID: e8c HWND: 0x0065071C Class: "ListBox" Title: "" LB_ADDSTRING (0x180) wParam: 0x0 lParam: 0x166e2d0
1:16:23:159 S PID: f80 TID: e8c HWND: 0x000A067C Class: "#32770" Title: "" WM_MEASUREITEM (0x2c) wParam: 0x1bf5 lParam: 0x12c4d4
1:16:23:159 S PID: f80 TID: e8c HWND: 0x0065071C Class: "ListBox" Title: "" LB_GETITEMRECT (0x198) wParam: 0x0 lParam: 0x12c858
1:16:23:159 S PID: f80 TID: e8c HWND: 0x0065071C Class: "ListBox" Title: "" LB_GETTEXTLEN (0x18a) wParam: 0x0 lParam: 0x0
1:16:23:159 S PID: f80 TID: e8c HWND: 0x0065071C Class: "ListBox" Title: "" LB_GETTEXT (0x189) wParam: 0x0 lParam: 0x12c024
1:16:23:159 S PID: f80 TID: e8c HWND: 0x0065071C Class: "ListBox" Title: "" LB_SETITEMHEIGHT (0x1a0) wParam: 0x0 lParam: 0x2b
1:16:23:179 P PID: fac TID: 1010 HWND: 0x00010DDE Class: "Internet Explorer_Server" Title: "" 0x118 wParam: 0xffff lParam: 0xbf8c3dca
1:16:23:460 S PID: 1454 TID: 145c HWND: 0x00030E3C Class: "Button" Title: "&Start" WM_NCHITTEST (0x84) wParam: 0x0 lParam: 0xe20134
1:16:23:460 S PID: 1454 TID: 145c HWND: 0x00030E3C Class: "Button" Title: "&Start" WM_MOUSEACTIVATE (0x21) wParam: 0x40e2e lParam: 0x2010001
1:16:23:460 S PID: 1454 TID: 145c HWND: 0x00040E2E Class: "#32770" Title: "MessageHistory" WM_MOUSEACTIVATE (0x21) wParam: 0x40e2e lParam: 0x2010001
6. Hints:
• MessageHistory.exe can only log messages sent or posted to 32-bit application windows and MessageHistory64.exe can only log messages sent or posted to 64-bit application windows. Therefore, if you know that your application is 64-bit, you must use MessageHistory64.exe, otherwise use MessageHistory.exe.
• To minimize the number of messages do not select Timer, User, Paint and Misc check boxes: this will filter out WM_TIMER, WM_USER, WM_PAINT, WM_NCPAINT, WM_ERASEBKGND, WM_NOTIFY and various WM_CTLCOLOR messages which are usually sent or posted to windows in great quantities.
• Leave both options SendMessage and PostMessage selected if you are not sure which messages belong to which type.
• Sometimes window class and title are not shown – this is because the window was destroyed by the time the logging stopped (use WindowHistory.exe log to find title and class).
• If you want to know window relationships in addition to messages on 32-bit platforms (or on 64-bit platforms when your application is 32-bit) run WindowHistory 4.0 for 32-bit platforms simultaneously with MessageHistory.exe.
• If you want to know window relationships in addition to messages on 64-bit platforms and your application is 64-bit run WindowHistory64 4.0 for x64 platforms simultaneously with MessageHistory64.exe.
Installing MessageHistory
Download the archive to a local workstation, unzip and run the application from a command prompt or from within a session.
Uninstalling MessageHistory
To uninstall this utility, delete WindowHistory.exe, mhhook.dll, WindowHistory64.exe and mhhook64.dll
Disclaimer
These software applications are provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.
| Comment | Posted |
|---|---|
| That was a mistake. It was already corrected some time ago. | Jun 28, 2007 by dvostok925 |
| What's the reason for naming the attachment WindowsHistory*.zip as it contains MessageHistory ? Why not name it MessageHistory*.zip ? | Jan 10, 2007 by ahols888 |