ReactOS 0.4.16-dev-1288-g7ec3a7e
MessageStateAnalyzer.c File Reference
#include "precomp.h"
#include "undocuser.h"
#include "winxx.h"
#include <imm.h>
#include <strsafe.h>
#include "msgdump.h"
Include dependency graph for MessageStateAnalyzer.c:

Go to the source code of this file.

Classes

struct  TEST_ENTRY
 

Macros

#define MAX_MSGS   512
 
#define MSGDUMP_PRINTF   trace
 
#define MSGDUMP_PREFIX   s_prefix
 
#define STAGE_1   1
 
#define STAGE_2   2
 
#define STAGE_3   3
 
#define STAGE_4   4
 
#define STAGE_5   5
 

Typedefs

typedef struct TEST_ENTRY TEST_ENTRY
 
typedef struct TEST_ENTRYPTEST_ENTRY
 

Functions

static void MD_build_prefix (void)
 
static INT findMessage (INT iMsg, HWND hwnd, UINT uMsg)
 
static VOID DoAnalyzeEntries (size_t nCount, PTEST_ENTRY pEntries)
 
static VOID DoAnalyzeAllMessages (VOID)
 
static LRESULT CALLBACK EditWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK ImeWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK InnerWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
 START_TEST (MessageStateAnalyzer)
 

Variables

static MSG s_Msgs [MAX_MSGS]
 
static UINT s_cMsgs = 0
 
static CHAR s_prefix [16] = ""
 
static HWND s_hMainWnd = NULL
 
static HWND s_hwndEdit = NULL
 
static HWND s_hImeWnd = NULL
 
static WNDPROC s_fnOldEditWndProc = NULL
 
static WNDPROC s_fnOldImeWndProc = NULL
 

Macro Definition Documentation

◆ MAX_MSGS

#define MAX_MSGS   512

Definition at line 14 of file MessageStateAnalyzer.c.

◆ MSGDUMP_PREFIX

#define MSGDUMP_PREFIX   s_prefix

Definition at line 26 of file MessageStateAnalyzer.c.

◆ MSGDUMP_PRINTF

#define MSGDUMP_PRINTF   trace

Definition at line 25 of file MessageStateAnalyzer.c.

◆ STAGE_1

#define STAGE_1   1

Definition at line 50 of file MessageStateAnalyzer.c.

◆ STAGE_2

#define STAGE_2   2

Definition at line 51 of file MessageStateAnalyzer.c.

◆ STAGE_3

#define STAGE_3   3

Definition at line 52 of file MessageStateAnalyzer.c.

◆ STAGE_4

#define STAGE_4   4

Definition at line 53 of file MessageStateAnalyzer.c.

◆ STAGE_5

#define STAGE_5   5

Definition at line 54 of file MessageStateAnalyzer.c.

Typedef Documentation

◆ PTEST_ENTRY

◆ TEST_ENTRY

Function Documentation

◆ DoAnalyzeAllMessages()

static VOID DoAnalyzeAllMessages ( VOID  )
static

Definition at line 89 of file MessageStateAnalyzer.c.

90{
91 size_t i;
92 TEST_ENTRY entries1[] =
93 {
94 { __LINE__, "WM_NCCREATE", findMessage(0, s_hMainWnd, WM_NCCREATE) },
95 { __LINE__, "WM_NCCALCSIZE", findMessage(0, s_hMainWnd, WM_NCCALCSIZE) },
96 { __LINE__, "WM_CREATE", findMessage(0, s_hMainWnd, WM_CREATE) },
97 { __LINE__, "WM_PARENTNOTIFY", findMessage(0, s_hMainWnd, WM_PARENTNOTIFY) },
98 { __LINE__, "WM_WINDOWPOSCHANGING", findMessage(0, s_hMainWnd, WM_WINDOWPOSCHANGING) },
99 { __LINE__, "WM_ACTIVATEAPP", findMessage(0, s_hMainWnd, WM_ACTIVATEAPP) },
100 { __LINE__, "WM_NCACTIVATE", findMessage(0, s_hMainWnd, WM_NCACTIVATE) },
101 { __LINE__, "WM_ACTIVATE", findMessage(0, s_hMainWnd, WM_ACTIVATE) },
102 { __LINE__, "WM_IME_SETCONTEXT", findMessage(0, s_hMainWnd, WM_IME_SETCONTEXT) },
103 { __LINE__, "WM_IME_NOTIFY", findMessage(0, s_hMainWnd, WM_IME_NOTIFY) },
104 { __LINE__, "WM_SETFOCUS", findMessage(0, s_hMainWnd, WM_SETFOCUS) },
105 { __LINE__, "WM_KILLFOCUS", findMessage(0, s_hMainWnd, WM_KILLFOCUS) },
106 };
107 INT iFound1 = entries1[_countof(entries1) - 1].iFound;
108 TEST_ENTRY entries2[] =
109 {
110 { __LINE__, "WM_IME_SETCONTEXT", findMessage(iFound1, s_hMainWnd, WM_IME_SETCONTEXT) },
111 { __LINE__, "WM_IME_SETCONTEXT", findMessage(iFound1, s_hwndEdit, WM_IME_SETCONTEXT) },
112 { __LINE__, "WM_SETFOCUS", findMessage(iFound1, s_hwndEdit, WM_SETFOCUS) },
113 { __LINE__, "WM_SHOWWINDOW", findMessage(iFound1, s_hMainWnd, WM_SHOWWINDOW) },
114 { __LINE__, "WM_WINDOWPOSCHANGING", findMessage(iFound1, s_hMainWnd, WM_WINDOWPOSCHANGING) },
115 { __LINE__, "WM_NCPAINT", findMessage(iFound1, s_hMainWnd, WM_NCPAINT) },
116 { __LINE__, "WM_ERASEBKGND", findMessage(iFound1, s_hMainWnd, WM_ERASEBKGND) },
117 { __LINE__, "WM_WINDOWPOSCHANGED", findMessage(iFound1, s_hMainWnd, WM_WINDOWPOSCHANGED) },
118 { __LINE__, "WM_SIZE", findMessage(iFound1, s_hMainWnd, WM_SIZE) },
119 { __LINE__, "WM_MOVE", findMessage(iFound1, s_hMainWnd, WM_MOVE) },
120 };
121 INT iFound2 = entries2[_countof(entries2) - 1].iFound;
122 TEST_ENTRY entries3[] =
123 {
124 { __LINE__, "WM_IME_KEYDOWN", findMessage(iFound2, s_hwndEdit, WM_IME_KEYDOWN) },
125 { __LINE__, "WM_KEYDOWN", findMessage(iFound2, s_hwndEdit, WM_KEYDOWN) },
126 { __LINE__, "WM_IME_KEYUP", findMessage(iFound2, s_hwndEdit, WM_IME_KEYUP) },
127 { __LINE__, "WM_CHAR", findMessage(iFound2, s_hwndEdit, WM_CHAR) },
128 { __LINE__, "WM_IME_CHAR", findMessage(iFound2, s_hwndEdit, WM_IME_CHAR) },
129 };
130 INT iFound3 = entries3[_countof(entries3) - 1].iFound;
131 TEST_ENTRY entries4[] =
132 {
133 { __LINE__, "WM_IME_NOTIFY", findMessage(iFound3, s_hwndEdit, WM_IME_NOTIFY) },
134 { __LINE__, "WM_IME_NOTIFY", findMessage(iFound3, s_hImeWnd, WM_IME_NOTIFY) },
135 { __LINE__, "WM_IME_SETCONTEXT", findMessage(iFound3, s_hwndEdit, WM_IME_SETCONTEXT) },
136 { __LINE__, "WM_IME_SETCONTEXT", findMessage(iFound3, s_hImeWnd, WM_IME_SETCONTEXT) },
137 };
138 INT iFound4 = entries4[_countof(entries4) - 1].iFound;
139 TEST_ENTRY entries5[] =
140 {
141 { __LINE__, "WM_DESTROY", findMessage(iFound4, s_hMainWnd, WM_DESTROY) },
142 { __LINE__, "WM_DESTROY", findMessage(iFound4, s_hwndEdit, WM_DESTROY) },
143 { __LINE__, "WM_NCDESTROY", findMessage(iFound4, s_hwndEdit, WM_NCDESTROY) },
144 { __LINE__, "WM_NCDESTROY", findMessage(iFound4, s_hMainWnd, WM_NCDESTROY) },
145 };
146 DoAnalyzeEntries(_countof(entries1), entries1);
147 DoAnalyzeEntries(_countof(entries2), entries2);
148 DoAnalyzeEntries(_countof(entries3), entries3);
149 //DoAnalyzeEntries(_countof(entries4), entries4); // No order
150 DoAnalyzeEntries(_countof(entries5), entries5);
151
152 ok(iFound1 < entries2[0].iFound, "%d vs %d\n", iFound1, entries2[0].iFound);
153 ok(iFound2 < entries3[0].iFound, "%d vs %d\n", iFound2, entries3[0].iFound);
154 ok(iFound3 < entries4[0].iFound, "%d vs %d\n", iFound3, entries4[0].iFound);
155 ok(iFound4 < entries5[0].iFound, "%d vs %d\n", iFound4, entries5[0].iFound);
156
157 for (i = 0; i < _countof(entries4); ++i)
158 {
159 ok(entries4[i].iFound != -1, "entries4[%d].iFound was -1\n", i);
160 }
161}
static HWND s_hMainWnd
static VOID DoAnalyzeEntries(size_t nCount, PTEST_ENTRY pEntries)
static HWND s_hImeWnd
static HWND s_hwndEdit
static INT findMessage(INT iMsg, HWND hwnd, UINT uMsg)
#define ok(value,...)
Definition: atltest.h:57
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define _countof(array)
Definition: sndvol32.h:70
Definition: cmd.c:13
UINT iFound
int32_t INT
Definition: typedefs.h:58
#define WM_ERASEBKGND
Definition: winuser.h:1644
#define WM_IME_KEYUP
Definition: winuser.h:1858
#define WM_IME_NOTIFY
Definition: winuser.h:1849
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1680
#define WM_IME_KEYDOWN
Definition: winuser.h:1857
#define WM_CREATE
Definition: winuser.h:1627
#define WM_SIZE
Definition: winuser.h:1630
#define WM_SETFOCUS
Definition: winuser.h:1632
#define WM_NCCREATE
Definition: winuser.h:1702
#define WM_ACTIVATE
Definition: winuser.h:1631
#define WM_SHOWWINDOW
Definition: winuser.h:1647
#define WM_IME_SETCONTEXT
Definition: winuser.h:1848
#define WM_NCACTIVATE
Definition: winuser.h:1707
#define WM_IME_CHAR
Definition: winuser.h:1853
#define WM_CHAR
Definition: winuser.h:1736
#define WM_MOVE
Definition: winuser.h:1629
#define WM_NCDESTROY
Definition: winuser.h:1703
#define WM_ACTIVATEAPP
Definition: winuser.h:1651
#define WM_DESTROY
Definition: winuser.h:1628
#define WM_KEYDOWN
Definition: winuser.h:1734
#define WM_PARENTNOTIFY
Definition: winuser.h:1822
#define WM_NCCALCSIZE
Definition: winuser.h:1704
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1681
#define WM_KILLFOCUS
Definition: winuser.h:1633
#define WM_NCPAINT
Definition: winuser.h:1706

Referenced by START_TEST().

◆ DoAnalyzeEntries()

static VOID DoAnalyzeEntries ( size_t  nCount,
PTEST_ENTRY  pEntries 
)
static

Definition at line 75 of file MessageStateAnalyzer.c.

76{
77 size_t i;
78 for (i = 0; i < nCount - 1; ++i)
79 {
80 PTEST_ENTRY entry1 = &pEntries[i];
81 PTEST_ENTRY entry2 = &pEntries[i + 1];
82 ok(entry1->iFound < entry2->iFound,
83 "Line %d: message wrong order (%d >= %d): %s vs %s\n",
84 entry1->line, entry1->iFound, entry2->iFound,
85 entry1->name, entry2->name);
86 }
87}

Referenced by DoAnalyzeAllMessages().

◆ EditWindowProc()

static LRESULT CALLBACK EditWindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 164 of file MessageStateAnalyzer.c.

165{
166 LRESULT ret;
167 MSG msg = { hwnd, uMsg, wParam, lParam };
168
169 /* Build s_prefix */
171
172 /* message dump */
173 MD_msgdump(hwnd, uMsg, wParam, lParam);
174
175 /* Add message */
176 if (s_cMsgs < MAX_MSGS)
177 s_Msgs[s_cMsgs++] = msg;
178
179 /* Do inner task */
181
182 /* message return */
183 StringCbCopyA(s_prefix, sizeof(s_prefix), "R: ");
185
186 return ret;
187}
static MSG s_Msgs[MAX_MSGS]
static CHAR s_prefix[16]
static UINT s_cMsgs
static WNDPROC s_fnOldEditWndProc
static void MD_build_prefix(void)
#define MAX_MSGS
#define msg(x)
Definition: auth_time.c:54
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static __inline LRESULT MSGDUMP_API MD_msgdump(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: msgdump.h:4655
static __inline LRESULT MSGDUMP_API MD_msgresult(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT lResult)
Definition: msgdump.h:5368
STRSAFEAPI StringCbCopyA(STRSAFE_LPSTR pszDest, size_t cbDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:161
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LRESULT
Definition: windef.h:209
#define CallWindowProc
Definition: winuser.h:5820

Referenced by InnerWindowProc().

◆ findMessage()

static INT findMessage ( INT  iMsg,
HWND  hwnd,
UINT  uMsg 
)
static

Definition at line 56 of file MessageStateAnalyzer.c.

57{
58 if (iMsg == -1)
59 iMsg = 0;
60 for (; iMsg < s_cMsgs; ++iMsg)
61 {
62 if (s_Msgs[iMsg].message == uMsg && s_Msgs[iMsg].hwnd == hwnd)
63 return iMsg;
64 }
65 return -1;
66}
Definition: tftpd.h:60

Referenced by DoAnalyzeAllMessages().

◆ ImeWindowProc()

static LRESULT CALLBACK ImeWindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 190 of file MessageStateAnalyzer.c.

191{
192 LRESULT ret;
193 MSG msg = { hwnd, uMsg, wParam, lParam };
194
195 /* Build s_prefix */
197
198 /* message dump */
199 MD_msgdump(hwnd, uMsg, wParam, lParam);
200
201 /* Add message */
202 if (s_cMsgs < MAX_MSGS)
203 s_Msgs[s_cMsgs++] = msg;
204
205 /* Do inner task */
207
208 /* message return */
209 StringCbCopyA(s_prefix, sizeof(s_prefix), "R: ");
211
212 return ret;
213}
static WNDPROC s_fnOldImeWndProc

Referenced by InnerWindowProc().

◆ InnerWindowProc()

static LRESULT CALLBACK InnerWindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 216 of file MessageStateAnalyzer.c.

217{
218 switch (uMsg)
219 {
220 case WM_NCCREATE:
222 trace("s_hMainWnd: %p\n", s_hMainWnd);
223 break;
224 case WM_CREATE:
226 0, 0, 100, 20, hwnd, NULL, GetModuleHandleW(NULL), NULL);
227 ok(s_hwndEdit != NULL, "s_hwndEdit was NULL\n");
228 trace("s_hwndEdit: %p\n", s_hwndEdit);
233 break;
234 case WM_COMMAND:
235 switch (LOWORD(wParam))
236 {
237 case STAGE_1:
239 ok(s_hImeWnd != NULL, "s_hImeWnd was NULL\n");
240 trace("s_hImeWnd: %p\n", s_hImeWnd );
244 break;
245 case STAGE_2:
248 break;
249 case STAGE_3:
252 break;
253 case STAGE_4:
256 break;
257 case STAGE_5:
258 PostMessageW(hwnd, WM_CLOSE, 0, 0);
259 break;
260 }
261 break;
262 case WM_DESTROY:
264 break;
265 }
266
267 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
268}
static LRESULT CALLBACK ImeWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define STAGE_2
#define STAGE_4
#define STAGE_3
#define STAGE_5
#define STAGE_1
static LRESULT CALLBACK EditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define trace
Definition: atltest.h:70
#define NULL
Definition: types.h:112
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HWND WINAPI ImmGetDefaultIMEWnd(_In_opt_ HWND hWnd)
Definition: ime.c:440
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define GWLP_WNDPROC
Definition: treelist.c:66
#define WM_CLOSE
Definition: winuser.h:1640
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_COMMAND
Definition: winuser.h:1759
HWND WINAPI SetFocus(_In_opt_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4392
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2982
#define SetWindowLongPtrW
Definition: winuser.h:5431

Referenced by WindowProc().

◆ MD_build_prefix()

static void MD_build_prefix ( void  )
static

Definition at line 29 of file MessageStateAnalyzer.c.

30{
32 INT i = 0;
33
34 if (Flags & ISMEX_CALLBACK)
35 s_prefix[i++] = 'C';
36 if (Flags & ISMEX_NOTIFY)
37 s_prefix[i++] = 'N';
38 if (Flags & ISMEX_REPLIED)
39 s_prefix[i++] = 'R';
40 if (Flags & ISMEX_SEND)
41 s_prefix[i++] = 'S';
42 if (i == 0)
43 s_prefix[i++] = 'P';
44
45 s_prefix[i++] = ':';
46 s_prefix[i++] = ' ';
47 s_prefix[i] = 0;
48}
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI InSendMessageEx(LPVOID lpReserved)
Definition: message.c:1391
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by EditWindowProc(), ImeWindowProc(), and WindowProc().

◆ START_TEST()

START_TEST ( MessageStateAnalyzer  )

Definition at line 296 of file MessageStateAnalyzer.c.

297{
298 WNDCLASSW wc;
299 HWND hwnd;
300 MSG msg;
301 static const WCHAR s_szName[] = L"MessageStateAnalyzer";
302
303 /* register window class */
304 ZeroMemory(&wc, sizeof(wc));
310 wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
312 if (!RegisterClassW(&wc))
313 {
314 skip("RegisterClassW failed.\n");
315 return;
316 }
317
318 /* create a window */
322 if (!hwnd)
323 {
324 skip("CreateWindowW failed.\n");
325 return;
326 }
327
328 /* message loop */
329 while (GetMessageW(&msg, NULL, 0, 0))
330 {
333 }
334
336}
static VOID DoAnalyzeAllMessages(VOID)
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define skip(...)
Definition: atltest.h:64
static WCHAR s_szName[MAX_PATH]
Definition: find.c:22
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
LPCWSTR lpszClassName
Definition: winuser.h:3261
HBRUSH hbrBackground
Definition: winuser.h:3259
HICON hIcon
Definition: winuser.h:3257
HINSTANCE hInstance
Definition: winuser.h:3256
UINT style
Definition: winuser.h:3252
WNDPROC lpfnWndProc
Definition: winuser.h:3253
HCURSOR hCursor
Definition: winuser.h:3258
#define ZeroMemory
Definition: winbase.h:1753
#define CS_VREDRAW
Definition: winuser.h:666
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define CS_HREDRAW
Definition: winuser.h:661
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:695
#define CS_DBLCLKS
Definition: winuser.h:659
#define IDI_APPLICATION
Definition: winuser.h:712
#define LoadIcon
Definition: winuser.h:5898
#define LoadCursor
Definition: winuser.h:5897
#define CW_USEDEFAULT
Definition: winuser.h:225
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define COLOR_3DFACE
Definition: winuser.h:940
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ WindowProc()

static LRESULT CALLBACK WindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 271 of file MessageStateAnalyzer.c.

272{
273 LRESULT ret;
274 MSG msg = { hwnd, uMsg, wParam, lParam };
275
276 /* Build s_prefix */
278
279 /* message dump */
280 MD_msgdump(hwnd, uMsg, wParam, lParam);
281
282 /* Add message */
283 if (s_cMsgs < MAX_MSGS)
284 s_Msgs[s_cMsgs++] = msg;
285
286 /* Do inner task */
288
289 /* message return */
290 StringCbCopyA(s_prefix, sizeof(s_prefix), "R: ");
292
293 return ret;
294}
static LRESULT CALLBACK InnerWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

Referenced by START_TEST().

Variable Documentation

◆ s_cMsgs

UINT s_cMsgs = 0
static

Definition at line 17 of file MessageStateAnalyzer.c.

Referenced by EditWindowProc(), findMessage(), ImeWindowProc(), and WindowProc().

◆ s_fnOldEditWndProc

WNDPROC s_fnOldEditWndProc = NULL
static

Definition at line 22 of file MessageStateAnalyzer.c.

Referenced by EditWindowProc(), and InnerWindowProc().

◆ s_fnOldImeWndProc

WNDPROC s_fnOldImeWndProc = NULL
static

Definition at line 23 of file MessageStateAnalyzer.c.

Referenced by ImeWindowProc(), and InnerWindowProc().

◆ s_hImeWnd

HWND s_hImeWnd = NULL
static

Definition at line 21 of file MessageStateAnalyzer.c.

Referenced by DoAnalyzeAllMessages(), and InnerWindowProc().

◆ s_hMainWnd

HWND s_hMainWnd = NULL
static

Definition at line 19 of file MessageStateAnalyzer.c.

Referenced by DoAnalyzeAllMessages(), and InnerWindowProc().

◆ s_hwndEdit

HWND s_hwndEdit = NULL
static

Definition at line 20 of file MessageStateAnalyzer.c.

Referenced by DoAnalyzeAllMessages(), and InnerWindowProc().

◆ s_Msgs

MSG s_Msgs[MAX_MSGS]
static

Definition at line 16 of file MessageStateAnalyzer.c.

Referenced by EditWindowProc(), findMessage(), ImeWindowProc(), and WindowProc().

◆ s_prefix

CHAR s_prefix[16] = ""
static

Definition at line 18 of file MessageStateAnalyzer.c.

Referenced by EditWindowProc(), ImeWindowProc(), MD_build_prefix(), and WindowProc().