Esme Povirk (@madewokherd) commented about dlls/user32/tests/class.c:
+static HWND create_hwnd_pass_msg_real_wndproc(BOOL wide_string, UINT msg) +{
- const CLIENTCREATESTRUCT client_cs = { NULL, 1 }; /* Needed for MDIClient. */
- HWND hwnd;
- real_class_wndproc_passthrough_msg = msg;
- if (wide_string)
- {
hwnd = CreateWindowW(SUPER_CLASS_NAME_W, L"test", WS_OVERLAPPED, 0, 0, 50, 50, 0, 0, 0, (void *)&client_cs);
if (msg == WM_NULL) SendMessageW(hwnd, WM_NULL, 0, 0);
- }
- else
- {
hwnd = CreateWindowA(SUPER_CLASS_NAME_A, "test", WS_OVERLAPPED, 0, 0, 50, 50, 0, 0, 0, (void *)&client_cs);
if (msg == WM_NULL) SendMessageA(hwnd, WM_NULL, 0, 0);
- }
I don't think it's necessary to create the window with the same string type that was used to register the class. The WndProc will be treated as ANSI or Unicode based on which RegisterClass function was used.
I'm also not sure the point of testing everything with both ANSI and Unicode WndProcs. The subclassed window proc shouldn't be able to tell the difference except by calling something like IsWindowUnicode.