MessageHistory
Version 3.0
Created Date: 08/20/2006
Updated Date: 09/25/2013
Please note:
You can download the required file from the Citrix downloads website by visiting the following link: https://www.citrix.com/downloads/citrix-tools
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:
17:11:20:270, S , 2324, 2280, 006B01AE, "Button", "&Start", "WM_NCHITTEST (0x84)", " wParam: 0x0 lParam: 0x1600301"
17:11:20:270, S , 2324, 2280, 006B01AE, "Button", "&Start", "WM_NCHITTEST (0x84)", " wParam: 0x0 lParam: 0x1600301"
17:11:20:270, S , 2324, 2280, 006B01AE, "Button", "&Start", "WM_SETCURSOR (0x20)", " wParam: 0x6b01ae lParam: 0x2000001"
17:11:20:270, S , 2324, 2280, 001B04B8, "#32770", "MessageHistory", "WM_SETCURSOR (0x20)", " wParam: 0x6b01ae lParam: 0x2000001"
17:11:20:270, P , 2324, 2280, 006B01AE, "Button", "&Start", "WM_MOUSEMOVE (0x200)", " wParam: 0x0 lParam: 0x12003b X/Y (client area): 59/18"
17:11:20:270, P , 2324, 2280, 006B01AE, "Button", "&Start", "WM_MOUSEMOVE (0x200)", " wParam: 0x0 lParam: 0x12003b X/Y (client area): 59/18"
17:11:20:295, P , 121c, 210c, 000D046E, "WindowsForms10.STATIC.app.0.3b95145", "Ctrl+Alt+Del", "0x118", " wParam: 0xfffa lParam: 0x16ae74"
17:11:20:295, P , 121c, 210c, 000D046E, "WindowsForms10.STATIC.app.0.3b95145", "Ctrl+Alt+Del", "0x118", " wParam: 0xfffa lParam: 0x16ae74"
17:11:20:295, P , 121c, 210c, 000C0530, "WindowsForms10.STATIC.app.0.3b95145", "Home", "0x118", " wParam: 0xfffa lParam: 0x16ae74"
17:11:20:295, P , 121c, 210c, 000C0530, "WindowsForms10.STATIC.app.0.3b95145", "Home", "0x118", " wParam: 0xfffa lParam: 0x16ae74"
17:11:20:360, S , 550, d44, 002105DA, "Transparent Windows Client", "How2UseMessageHistory [Compatibility Mode] - Microsoft Word - \\Remote", "WM_GETICON (0x7f)", " wParam: 0x0 lParam: 0x0"
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.
What’s new in 3.0
• Fix: Bulk messages are cleared each time GUI tracing is started.
• Fix: Correct circular GUI tracing.
• Static shared message buffer has been increased from 100,000 to 1,000,000 messages.
• Command line option: MessageHistory(64).exe start|stop [all]
• Command line option is sequential with messages flushed to a log file every second. The file is created in the same folder where MessageHistory(64).exe is located.
• “all” command option includes Timer, User, Paint and Misc GUI checkboxes and significantly increases the log file size.
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 MessageHistory.exe, mhhook.dll, MessageHistory64.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.