ReactOS 0.4.16-dev-1369-gd4d04c8
MenuUI.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS API tests
3 * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4 * PURPOSE: Tests for Menu UI
5 * COPYRIGHT: Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "precomp.h"
9#include <shellapi.h>
10
11#define SUB_PROGRAM L"user32_apitest_menuui.exe"
12#define CLASSNAME L"MenuUITest"
13#define MENUCLASS L"#32768"
14
15#define MENUID_100 100
16#define MENUID_101 101
17#define MENUID_200 200
18#define MENUID_201 201
19
22
24
25#define DELAY 100
26#define INTERVAL 300
28
29typedef enum tagAUTO_CLICK
30{
36
37typedef enum tagAUTO_KEY
38{
43
44static VOID
46{
48 {
50 AutoKey(AUTO_KEY_UP, vKey);
51 return;
52 }
53
55 ZeroMemory(&input, sizeof(input));
56
57 input.type = INPUT_KEYBOARD;
58 input.ki.wVk = vKey;
59 input.ki.dwFlags = ((type == AUTO_KEY_UP) ? KEYEVENTF_KEYUP : 0);
60 SendInput(1, &input, sizeof(INPUT));
61 Sleep(DELAY);
62}
63
64static VOID
66{
68 ZeroMemory(&input, sizeof(input));
69
70 INT nScreenWidth = GetSystemMetrics(SM_CXSCREEN) - 1;
71 INT nScreenHeight = GetSystemMetrics(SM_CYSCREEN) - 1;
72
73 input.type = INPUT_MOUSE;
74 input.mi.dx = (LONG)(x * (65535.0f / nScreenWidth));
75 input.mi.dy = (LONG)(y * (65535.0f / nScreenHeight));
77 SendInput(1, &input, sizeof(INPUT));
78 Sleep(DELAY);
79
80 input.mi.dx = input.mi.dy = 0;
81
82 INT i, count = 1;
83 switch (type)
84 {
86 count = 2;
87 // FALL THROUGH
88 case AUTO_LEFT_CLICK:
89 {
90 for (i = 0; i < count; ++i)
91 {
92 input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
93 SendInput(1, &input, sizeof(INPUT));
94 Sleep(DELAY);
95
96 input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
97 SendInput(1, &input, sizeof(INPUT));
98 Sleep(DELAY);
99 }
100 break;
101 }
103 count = 2;
104 // FALL THROUGH
105 case AUTO_RIGHT_CLICK:
106 {
107 for (i = 0; i < count; ++i)
108 {
109 input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
110 SendInput(1, &input, sizeof(INPUT));
111 Sleep(DELAY);
112
113 input.mi.dwFlags = MOUSEEVENTF_RIGHTUP;
114 SendInput(1, &input, sizeof(INPUT));
115 Sleep(DELAY);
116 }
117 break;
118 }
119 }
120}
121
122static POINT
124{
125 POINT pt = { (prc->left + prc->right) / 2, (prc->top + prc->bottom) / 2 };
126 return pt;
127}
128
129static INT
130GetHitID(HWND hwndTarget)
131{
132 return HandleToUlong(GetPropW(hwndTarget, L"Hit"));
133}
134
135typedef struct tagCOUNTMENUWND
136{
139
140static BOOL CALLBACK
142{
143 if (!IsWindowVisible(hwnd))
144 return TRUE;
145
146 WCHAR szClass[64];
147 GetClassNameW(hwnd, szClass, _countof(szClass));
148 if (lstrcmpiW(szClass, MENUCLASS) != 0)
149 return TRUE;
150
152 pData->nMenuCount += 1;
153 return TRUE;
154}
155
156static INT
158{
159 COUNTMENUWND data = { 0 };
161 return data.nMenuCount;
162}
163
164static VOID
166{
167 for (INT i = 0; i < 10; ++i)
168 {
169 HWND hwnd1 = FindWindowW(L"user32_apitest_menuui", L"#1");
170 if (!hwnd1)
171 break;
172 PostMessage(hwnd1, WM_CLOSE, 0, 0);
174 }
175 for (INT i = 0; i < 10; ++i)
176 {
177 HWND hwnd2 = FindWindowW(L"user32_apitest_menuui", L"#2");
178 if (!hwnd2)
179 break;
180 PostMessage(hwnd2, WM_CLOSE, 0, 0);
182 }
183}
184
185static HWND
187{
188 GUITHREADINFO info = { sizeof(info) };
189 GetGUIThreadInfo(dwThreadID, &info);
190 return info.hwndActive;
191}
192
193static HWND
195{
196 GUITHREADINFO info = { sizeof(info) };
197 GetGUIThreadInfo(dwThreadID, &info);
198 return info.hwndFocus;
199}
200
201static HWND
203{
204 GUITHREADINFO info = { sizeof(info) };
205 GetGUIThreadInfo(dwThreadID, &info);
206 return info.hwndCapture;
207}
208
209static DWORD WINAPI
211{
212 HWND hwnd = FindWindowW(L"MenuUITest", L"MenuUITest");
214 trace("hwnd: %p\n", hwnd);
215
217
219
220 sei.lpFile = SUB_PROGRAM;
221 sei.nShow = SW_SHOWNORMAL;
222
223 // Start up sub program #1
224 sei.lpParameters = L"#1";
225 if (!s_pShellExecuteExW(&sei))
226 {
227 skip("ShellExecuteExW failed\n");
228 return -1;
229 }
232
233 // Start up sub program #2
234 sei.lpParameters = L"#2";
235 if (!s_pShellExecuteExW(&sei))
236 {
237 skip("ShellExecuteExW failed\n");
238 return -1;
239 }
242
244 HWND hwnd1 = FindWindowW(L"user32_apitest_menuui", L"#1");
245 HWND hwnd2 = FindWindowW(L"user32_apitest_menuui", L"#2");
246 trace("hwnd1: %p\n", hwnd1);
247 trace("hwnd2: %p\n", hwnd2);
248 ok(hwnd != NULL, "hwnd was NULL\n");
249 ok(hwnd1 != NULL, "hwnd1 was NULL\n");
250 ok(hwnd2 != NULL, "hwnd2 was NULL\n");
251 ok(hwnd1 != hwnd2, "hwnd1 == hwnd2\n");
252
253 DWORD dwTID1 = GetWindowThreadProcessId(hwnd1, NULL);
254 DWORD dwTID2 = GetWindowThreadProcessId(hwnd2, NULL);
255
256 RECT rcWork;
257 SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcWork, 0);
258 INT cxWork = (rcWork.right - rcWork.left);
259
260 RECT rc1 = { rcWork.left, rcWork.top, rcWork.left + cxWork / 2, rcWork.bottom };
261 RECT rc2 = { rcWork.left + cxWork / 2, rcWork.top, rcWork.right, rcWork.bottom };
262 MoveWindow(hwnd1, rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, TRUE);
263 MoveWindow(hwnd2, rc2.left, rc2.top, rc2.right - rc2.left, rc2.bottom - rc2.top, TRUE);
264
265 POINT pt1 = CenterPoint(&rc1);
266 POINT pt2 = CenterPoint(&rc2);
267
268 // Right click on hwnd1
269 AutoClick(AUTO_RIGHT_CLICK, pt1.x, pt1.y);
271
272 HWND hwndMenu1 = FindWindowW(MENUCLASS, L"");
273 trace("hwndMenu1: %p\n", hwndMenu1);
274 ok(IsWindowVisible(hwndMenu1), "hwndMenu1 not visible\n");
275
276 HWND hwndFore, hwndActive, hwndFocus, hwndCapture;
277
278 hwndFore = GetForegroundWindow();
279 ok(hwndFore == hwnd1, "hwndFore was %p\n", hwndFore);
280
281 hwndActive = GetThreadActiveWnd(dwTID1);
282 hwndFocus = GetThreadFocus(dwTID1);
283 hwndCapture = GetThreadCapture(dwTID1);
284 ok(hwndActive == hwnd1, "hwndActive was %p\n", hwndActive);
285 ok(hwndFocus == hwnd1, "hwndFocus was %p\n", hwndFocus);
286 ok(hwndCapture == hwnd1, "hwndCapture was %p\n", hwndCapture);
287
288 // Right click on hwnd2
289 AutoClick(AUTO_RIGHT_CLICK, pt2.x, pt2.y);
291
292 HWND hwndMenu2 = FindWindowW(MENUCLASS, L"");
293 trace("hwndMenu2: %p\n", hwndMenu2);
294 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
295 ok(hwndMenu1 != hwndMenu2, "hwndMenu1 == hwndMenu2\n");
296
297 hwndFore = GetForegroundWindow();
298 ok(hwndFore == hwnd2, "hwndFore was %p\n", hwndFore);
299
300 hwndActive = GetThreadActiveWnd(dwTID2);
301 hwndFocus = GetThreadFocus(dwTID2);
302 hwndCapture = GetThreadCapture(dwTID2);
303 ok(hwndActive == hwnd2, "hwndActive was %p\n", hwndActive);
304 ok(hwndFocus == hwnd2, "hwndFocus was %p\n", hwndFocus);
305 ok(hwndCapture == hwnd2, "hwndCapture was %p\n", hwndCapture);
306
307 // Type Esc key
310
311 hwndFore = GetForegroundWindow();
312 ok(hwndFore == hwnd2, "hwndFore was %p\n", hwndFore);
313
314 hwndActive = GetThreadActiveWnd(dwTID1);
315 hwndFocus = GetThreadFocus(dwTID1);
316 hwndCapture = GetThreadCapture(dwTID1);
317 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
318 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
319 ok(!hwndCapture, "hwndCapture was %p\n", hwndCapture);
320
321 hwndActive = GetThreadActiveWnd(dwTID2);
322 hwndFocus = GetThreadFocus(dwTID2);
323 hwndCapture = GetThreadCapture(dwTID2);
324 ok(hwndActive == hwnd2, "hwndActive was %p\n", hwndActive);
325 ok(hwndFocus == hwnd2, "hwndFocus was %p\n", hwndFocus);
326 ok(!hwndCapture, "hwndCapture was %p\n", hwndCapture);
327
328 ok(GetHitID(hwnd2) == 0, "GetHitID(hwnd2) was %d\n", GetHitID(hwnd2));
329 HWND hwndMenu0 = FindWindowW(MENUCLASS, L"");
330 trace("hwndMenu0: %p\n", hwndMenu0);
331 ok(!IsWindowVisible(hwndMenu0), "hwndMenu0 was visible\n");
332
333 // Click on hwnd1
334 AutoClick(AUTO_RIGHT_CLICK, pt1.x, pt1.y);
335 hwndMenu1 = FindWindowW(MENUCLASS, L"");
336 trace("hwndMenu1: %p\n", hwndMenu1);
337 ok(IsWindowVisible(hwndMenu1), "hwndMenu1 not visible");
338
339 RECT rcMenu1;
340 GetWindowRect(hwndMenu1, &rcMenu1);
341 POINT ptMenu1 = CenterPoint(&rcMenu1); // Separator
342
343 // Clicking on separator is not effective
344 AutoClick(AUTO_LEFT_CLICK, ptMenu1.x, ptMenu1.y);
345 hwndMenu1 = FindWindowW(MENUCLASS, L"");
346 trace("hwndMenu1: %p\n", hwndMenu1);
347 ok(IsWindowVisible(hwndMenu1), "hwndMenu1 not visible\n");
348
349 AutoClick(AUTO_LEFT_DOUBLE_CLICK, ptMenu1.x, ptMenu1.y);
350 hwndMenu1 = FindWindowW(MENUCLASS, L"");
351 trace("hwndMenu1: %p\n", hwndMenu1);
352 ok(IsWindowVisible(hwndMenu1), "hwndMenu1 not visible\n");
353
354 AutoClick(AUTO_RIGHT_CLICK, ptMenu1.x, ptMenu1.y);
355 hwndMenu1 = FindWindowW(MENUCLASS, L"");
356 trace("hwndMenu1: %p\n", hwndMenu1);
357 ok(IsWindowVisible(hwndMenu1), "hwndMenu1 not visible\n");
358
359 AutoClick(AUTO_RIGHT_DOUBLE_CLICK, ptMenu1.x, ptMenu1.y);
360 hwndMenu1 = FindWindowW(MENUCLASS, L"");
361 trace("hwndMenu1: %p\n", hwndMenu1);
362 ok(IsWindowVisible(hwndMenu1), "hwndMenu1 not visible\n");
363
364 // Click on first item of hwnd1 context menu
365 POINT pt1_3 = { ptMenu1.x, (2 * rcMenu1.top + 1 * rcMenu1.bottom) / (1 + 2) }; // First item
366 AutoClick(AUTO_LEFT_CLICK, pt1_3.x, pt1_3.y);
368
369 hwndMenu1 = FindWindowW(MENUCLASS, L"");
370 ok(!IsWindowVisible(hwndMenu1), "hwndMenu1 was visible\n");
371 ok(GetHitID(hwnd1) == MENUID_100, "GetHitID(hwnd1) was %d\n", GetHitID(hwnd1));
372
373 // Click on hwnd2
374 AutoClick(AUTO_RIGHT_CLICK, pt2.x, pt2.y);
375 hwndMenu2 = FindWindowW(MENUCLASS, L"");
376 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
377
378 AutoKey(AUTO_KEY_DOWN_UP, VK_DOWN); // Down key
379 hwndMenu2 = FindWindowW(MENUCLASS, L"");
380 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
381
382 AutoKey(AUTO_KEY_DOWN_UP, VK_RETURN); // Enter key
384
385 hwndMenu2 = FindWindowW(MENUCLASS, L"");
386 ok(!IsWindowVisible(hwndMenu2), "hwndMenu2 was visible");
387 ok(GetHitID(hwnd2) == MENUID_100, "GetHitID(hwnd2) was %d\n", GetHitID(hwnd2));
388
389 // Click on hwnd2
390 AutoClick(AUTO_RIGHT_CLICK, pt2.x, pt2.y);
391 hwndMenu2 = FindWindowW(MENUCLASS, L"");
392 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
393
394 AutoKey(AUTO_KEY_DOWN_UP, VK_UP); // Up key
395 hwndMenu2 = FindWindowW(MENUCLASS, L"");
396 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
397
398 AutoKey(AUTO_KEY_DOWN_UP, VK_RETURN); // Enter key
400
401 hwndMenu2 = FindWindowW(MENUCLASS, L"");
402 ok(!IsWindowVisible(hwndMenu2), "hwndMenu2 was visible");
403 ok(GetHitID(hwnd2) == 101, "GetHitID(hwnd2) was %d\n", GetHitID(hwnd2));
404
405 INT nMenuCount;
406
407 // Shift + Right click on hwnd2
409 AutoClick(AUTO_RIGHT_CLICK, pt2.x, pt2.y);
411 hwndMenu2 = FindWindowW(MENUCLASS, L"");
412 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
413 nMenuCount = CountMenuWnds();
414 ok(nMenuCount == 1, "nMenuCount was %d\n", nMenuCount);
415
416 AutoKey(AUTO_KEY_DOWN_UP, VK_UP); // Up key
417 hwndMenu2 = FindWindowW(MENUCLASS, L"");
418 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
419
420 AutoKey(AUTO_KEY_DOWN_UP, VK_RETURN); // Enter key
421 hwndMenu2 = FindWindowW(MENUCLASS, L"");
422 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
423 nMenuCount = CountMenuWnds();
424 ok(nMenuCount == 2, "nMenuCount was %d\n", nMenuCount);
425
426 // Right click on hwnd1
427 AutoClick(AUTO_RIGHT_CLICK, pt1.x, pt1.y);
428 nMenuCount = CountMenuWnds();
429 ok(nMenuCount == 1, "nMenuCount was %d\n", nMenuCount);
430
431 AutoKey(AUTO_KEY_DOWN_UP, VK_DOWN); // Down key
432 AutoKey(AUTO_KEY_DOWN_UP, VK_RETURN); // Enter key
434
435 hwndMenu1 = FindWindowW(MENUCLASS, L"");
436 ok(!IsWindowVisible(hwndMenu1), "hwndMenu1 was visible\n");
437
438 // Getting menu bar info
439 MENUBARINFO mbi = { sizeof(mbi) };
440 GetMenuBarInfo(hwnd1, OBJID_MENU, 0, &mbi);
441 INT xMenuBar1 = mbi.rcBar.left + 16;
442 INT yMenuBar1 = (mbi.rcBar.top + mbi.rcBar.bottom) / 2;
443 GetMenuBarInfo(hwnd2, OBJID_MENU, 0, &mbi);
444 INT xMenuBar2 = mbi.rcBar.left + 16;
445 INT yMenuBar2 = (mbi.rcBar.top + mbi.rcBar.bottom) / 2;
446
447 // Click on menu bar
448 AutoClick(AUTO_LEFT_CLICK, xMenuBar1, yMenuBar1);
450
451 hwndMenu1 = FindWindowW(MENUCLASS, L"");
452 ok(IsWindowVisible(hwndMenu1), "hwndMenu1 not visible\n");
453
454 hwndFore = GetForegroundWindow();
455 ok(hwndFore == hwnd1, "hwndFore was %p\n", hwndFore);
456
457 hwndActive = GetThreadActiveWnd(dwTID1);
458 hwndFocus = GetThreadFocus(dwTID1);
459 hwndCapture = GetThreadCapture(dwTID1);
460 ok(hwndActive == hwnd1, "hwndActive was %p\n", hwndActive);
461 ok(hwndFocus == hwnd1, "hwndFocus was %p\n", hwndFocus);
462 ok(hwndCapture == hwnd1, "hwndCapture was %p\n", hwndCapture);
463
464 // Right click on hwnd2
465 AutoClick(AUTO_RIGHT_CLICK, pt2.x, pt2.y);
467
468 ok(!IsWindowVisible(hwndMenu1), "hwndMenu1 was visible\n");
469 hwndMenu2 = FindWindowW(MENUCLASS, L"");
470 ok(IsWindowVisible(hwndMenu2), "hwndMenu2 not visible\n");
471 ok(hwndMenu1 != hwndMenu2, "hwndMenu1 == hwndMenu2\n");
472
473 hwndFore = GetForegroundWindow();
474 ok(hwndFore == hwnd2, "hwndFore was %p\n", hwndFore);
475
476 hwndActive = GetThreadActiveWnd(dwTID1);
477 hwndFocus = GetThreadFocus(dwTID1);
478 hwndCapture = GetThreadCapture(dwTID1);
479 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
480 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
481 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
482
483 hwndActive = GetThreadActiveWnd(dwTID2);
484 hwndFocus = GetThreadFocus(dwTID2);
485 hwndCapture = GetThreadCapture(dwTID2);
486 ok(hwndActive == hwnd2, "hwndActive was %p\n", hwndActive);
487 ok(hwndFocus == hwnd2, "hwndFocus was %p\n", hwndFocus);
488 ok(hwndCapture == hwnd2, "hwndFocus was %p\n", hwndCapture);
489
490 // Click on hwnd1 menu bar
491 AutoClick(AUTO_LEFT_CLICK, xMenuBar1, yMenuBar1);
493
494 ok(!IsWindowVisible(hwndMenu2), "hwndMenu2 was visible\n");
495 hwndMenu1 = FindWindowW(MENUCLASS, L"");
496
497 hwndFore = GetForegroundWindow();
498 ok(hwndFore == hwnd1, "hwndFore was %p\n", hwndFore);
499
500 hwndActive = GetThreadActiveWnd(dwTID1);
501 hwndFocus = GetThreadFocus(dwTID1);
502 hwndCapture = GetThreadCapture(dwTID1);
503 ok(hwndActive == hwnd1, "hwndActive was %p\n", hwndActive);
504 ok(hwndFocus == hwnd1, "hwndFocus was %p\n", hwndFocus);
505 ok(hwndCapture == hwnd1, "hwndCapture was %p\n", hwndCapture);
506
507 hwndActive = GetThreadActiveWnd(dwTID2);
508 hwndFocus = GetThreadFocus(dwTID2);
509 hwndCapture = GetThreadCapture(dwTID2);
510 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
511 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
512 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
513
514 // Shift + Right click on hwnd2
516 AutoClick(AUTO_RIGHT_CLICK, pt2.x, pt2.y);
518
519 hwndFore = GetForegroundWindow();
520 ok(hwndFore == hwnd2, "hwndFore was %p\n", hwndFore);
521
522 hwndActive = GetThreadActiveWnd(dwTID1);
523 hwndFocus = GetThreadFocus(dwTID1);
524 hwndCapture = GetThreadCapture(dwTID1);
525 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
526 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
527 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
528
529 hwndActive = GetThreadActiveWnd(dwTID2);
530 hwndFocus = GetThreadFocus(dwTID2);
531 hwndCapture = GetThreadCapture(dwTID2);
532 ok(hwndActive == hwnd2, "hwndActive was %p\n", hwndActive);
533 ok(hwndFocus == hwnd2, "hwndFocus was %p\n", hwndFocus);
534 ok(hwndCapture == hwnd2, "hwndFocus was %p\n", hwndCapture);
535
536 ok(!IsWindowVisible(hwndMenu1), "hwndMenu1 was visible\n");
539 ok(GetHitID(hwnd2) == 0, "GetHitID(hwnd2) was %d\n", GetHitID(hwnd2));
543 ok(GetHitID(hwnd2) == MENUID_101, "GetHitID(hwnd2) was %d\n", GetHitID(hwnd2));
544
545 // Shift + Right click on hwnd2
547 AutoClick(AUTO_RIGHT_CLICK, pt2.x, pt2.y);
550
551 nMenuCount = CountMenuWnds();
552 ok(nMenuCount == 1, "nMenuCount was %d\n", nMenuCount);
553
554 AutoKey(AUTO_KEY_DOWN_UP, VK_UP); // Up key
555 AutoKey(AUTO_KEY_DOWN_UP, VK_RETURN); // Enter key
557
558 nMenuCount = CountMenuWnds();
559 ok(nMenuCount == 2, "nMenuCount was %d\n", nMenuCount);
560
561 AutoKey(AUTO_KEY_DOWN_UP, VK_LEFT); // Left key
563
564 nMenuCount = CountMenuWnds();
565 ok(nMenuCount == 1, "nMenuCount was %d\n", nMenuCount);
566
567 AutoKey(AUTO_KEY_DOWN_UP, VK_RIGHT); // Right key
569
570 nMenuCount = CountMenuWnds();
571 ok(nMenuCount == 2, "nMenuCount was %d\n", nMenuCount);
572
573 // Left click on hwnd1 menu bar
574 AutoClick(AUTO_LEFT_CLICK, xMenuBar1, yMenuBar1);
576
577 nMenuCount = CountMenuWnds();
578 ok(nMenuCount == 1, "nMenuCount was %d\n", nMenuCount);
579
580 AutoKey(AUTO_KEY_DOWN_UP, VK_DOWN); // Down key
581 AutoKey(AUTO_KEY_DOWN_UP, VK_RETURN); // Enter key
583
584 ok(GetHitID(hwnd1) == MENUID_200, "GetHitID(hwnd1) was %d\n", GetHitID(hwnd1));
585
586 // Left click on hwnd1 menu bar
587 AutoClick(AUTO_LEFT_CLICK, xMenuBar1, yMenuBar1);
590
591 hwndFore = GetForegroundWindow();
592 ok(hwndFore == hwnd1, "hwndFore was %p\n", hwndFore);
593
594 hwndActive = GetThreadActiveWnd(dwTID1);
595 hwndFocus = GetThreadFocus(dwTID1);
596 hwndCapture = GetThreadCapture(dwTID1);
597 ok(hwndActive == hwnd1, "hwndActive was %p\n", hwndActive);
598 ok(hwndFocus == hwnd1, "hwndFocus was %p\n", hwndFocus);
599 ok(hwndCapture == hwnd1, "hwndCapture was %p\n", hwndCapture);
600
601 hwndActive = GetThreadActiveWnd(dwTID2);
602 hwndFocus = GetThreadFocus(dwTID2);
603 hwndCapture = GetThreadCapture(dwTID2);
604 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
605 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
606 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
607
609 ok(GetHitID(hwnd1) == 0, "GetHitID(hwnd1) was %d\n", GetHitID(hwnd1));
610
611 // Left click on hwnd1 menu bar
612 AutoClick(AUTO_LEFT_CLICK, xMenuBar1, yMenuBar1);
614
615 hwndFore = GetForegroundWindow();
616 ok(hwndFore == hwnd1, "hwndFore was %p\n", hwndFore);
617
618 hwndActive = GetThreadActiveWnd(dwTID1);
619 hwndFocus = GetThreadFocus(dwTID1);
620 hwndCapture = GetThreadCapture(dwTID1);
621 ok(hwndActive == hwnd1, "hwndActive was %p\n", hwndActive);
622 ok(hwndFocus == hwnd1, "hwndFocus was %p\n", hwndFocus);
623 ok(hwndCapture == hwnd1, "hwndCapture was %p\n", hwndCapture);
624
625 hwndActive = GetThreadActiveWnd(dwTID2);
626 hwndFocus = GetThreadFocus(dwTID2);
627 hwndCapture = GetThreadCapture(dwTID2);
628 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
629 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
630 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
631
632 // Left click on hwnd2 menu bar
633 AutoClick(AUTO_LEFT_CLICK, xMenuBar2, yMenuBar2);
635
636 hwndFore = GetForegroundWindow();
637 ok(hwndFore == hwnd2, "hwndFore was %p\n", hwndFore);
638
639 hwndActive = GetThreadActiveWnd(dwTID1);
640 hwndFocus = GetThreadFocus(dwTID1);
641 hwndCapture = GetThreadCapture(dwTID1);
642 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
643 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
644 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
645
646 hwndActive = GetThreadActiveWnd(dwTID2);
647 hwndFocus = GetThreadFocus(dwTID2);
648 hwndCapture = GetThreadCapture(dwTID2);
649 ok(hwndActive == hwnd2, "hwndActive was %p\n", hwndActive);
650 ok(hwndFocus == hwnd2, "hwndFocus was %p\n", hwndFocus);
651 ok(hwndCapture == hwnd2, "hwndFocus was %p\n", hwndCapture);
652
653 // Left click on hwnd1 menu bar
654 AutoClick(AUTO_LEFT_CLICK, xMenuBar1, yMenuBar1);
656
657 hwndFore = GetForegroundWindow();
658 ok(hwndFore == hwnd1, "hwndFore was %p\n", hwndFore);
659
660 hwndActive = GetThreadActiveWnd(dwTID1);
661 hwndFocus = GetThreadFocus(dwTID1);
662 hwndCapture = GetThreadCapture(dwTID1);
663 ok(hwndActive == hwnd1, "hwndActive was %p\n", hwndActive);
664 ok(hwndFocus == hwnd1, "hwndFocus was %p\n", hwndFocus);
665 ok(hwndCapture == hwnd1, "hwndCapture was %p\n", hwndCapture);
666
667 hwndActive = GetThreadActiveWnd(dwTID2);
668 hwndFocus = GetThreadFocus(dwTID2);
669 hwndCapture = GetThreadCapture(dwTID2);
670 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
671 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
672 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
673
674 // Get title bar info
675 TITLEBARINFO titleInfo = { sizeof(titleInfo) };
676 RECT rcTitleBar1, rcTitleBar2;
677 GetTitleBarInfo(hwnd1, &titleInfo);
678 rcTitleBar1 = titleInfo.rcTitleBar;
679 GetTitleBarInfo(hwnd2, &titleInfo);
680 rcTitleBar2 = titleInfo.rcTitleBar;
681 POINT ptTitleBar1 = CenterPoint(&rcTitleBar1);
682 POINT ptTitleBar2 = CenterPoint(&rcTitleBar2);
683
684 // Right click on hwnd2 title bar
685 AutoClick(AUTO_RIGHT_CLICK, ptTitleBar2.x, ptTitleBar2.y);
687
688 hwndActive = GetThreadActiveWnd(dwTID1);
689 hwndFocus = GetThreadFocus(dwTID1);
690 hwndCapture = GetThreadCapture(dwTID1);
691 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
692 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
693 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
694
695 hwndActive = GetThreadActiveWnd(dwTID2);
696 hwndFocus = GetThreadFocus(dwTID2);
697 hwndCapture = GetThreadCapture(dwTID2);
698 ok(hwndActive == hwnd2, "hwndActive was %p\n", hwndActive);
699 ok(hwndFocus == hwnd2, "hwndFocus was %p\n", hwndFocus);
700 ok(hwndCapture == hwnd2, "hwndFocus was %p\n", hwndCapture);
701
702 nMenuCount = CountMenuWnds();
703 ok(nMenuCount == 1, "nMenuCount was %d\n", nMenuCount);
704
705 // Right click on hwnd1 title bar
706 AutoClick(AUTO_RIGHT_CLICK, ptTitleBar1.x, ptTitleBar1.y);
708
709 hwndActive = GetThreadActiveWnd(dwTID1);
710 hwndFocus = GetThreadFocus(dwTID1);
711 hwndCapture = GetThreadCapture(dwTID1);
712 ok(hwndActive == hwnd1, "hwndActive was %p\n", hwndActive);
713 ok(hwndFocus == hwnd1, "hwndFocus was %p\n", hwndFocus);
714 ok(hwndCapture == hwnd1, "hwndFocus was %p\n", hwndCapture);
715
716 hwndActive = GetThreadActiveWnd(dwTID2);
717 hwndFocus = GetThreadFocus(dwTID2);
718 hwndCapture = GetThreadCapture(dwTID2);
719 ok(!hwndActive, "hwndActive was %p\n", hwndActive);
720 ok(!hwndFocus, "hwndFocus was %p\n", hwndFocus);
721 ok(!hwndCapture, "hwndFocus was %p\n", hwndCapture);
722
723 nMenuCount = CountMenuWnds();
724 ok(nMenuCount == 1, "nMenuCount was %d\n", nMenuCount);
725
726 // Left double click on hwnd1 system menu icon (it will close hwnd1)
727 POINT ptSysMenu = { rcTitleBar1.left - GetSystemMetrics(SM_CXSMICON) / 2, ptTitleBar1.y };
728 ok(IsWindowVisible(hwnd1), "hwnd1 not visible\n");
729 AutoClick(AUTO_LEFT_DOUBLE_CLICK, ptSysMenu.x, ptSysMenu.y);
731
732 ok(!IsWindowVisible(hwnd1), "hwnd1 was visible\n");
733 nMenuCount = CountMenuWnds();
734 ok(nMenuCount == 0, "nMenuCount was %d\n", nMenuCount);
735
736 PostMessageW(hwnd1, WM_CLOSE, 0, 0);
737 PostMessageW(hwnd2, WM_CLOSE, 0, 0);
738
740 PostMessage(hwnd, WM_CLOSE, 0, 0);
741 return 0;
742}
743
744static INT
746{
748 if (!s_hThread)
749 return -1;
750 return 0;
751}
752
753static VOID
755{
756 if (s_hThread)
757 {
759 s_hThread = NULL;
760 }
761
763}
764
765static
768{
769 switch (uMsg)
770 {
771 case WM_CREATE:
772 return OnCreate(hwnd);
773 case WM_DESTROY:
775 break;
776 default:
777 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
778 }
779 return 0;
780}
781
782static VOID
784{
786
788 wc.hInstance = hInstance;
791 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
793 if (!RegisterClassW(&wc))
794 {
795 skip("RegisterClassW failed\n");
796 return;
797 }
798
800 CW_USEDEFAULT, CW_USEDEFAULT, 400, 300,
802 if (!hwnd)
803 {
804 skip("CreateWindowW failed\n");
805 return;
806 }
807
810
811 MSG msg;
812 while (GetMessageW(&msg, NULL, 0, 0))
813 {
816 }
817}
818
820{
822 {
823 skip("'%ls' not found\n", SUB_PROGRAM);
824 return;
825 }
826
827 HINSTANCE hShell32 = LoadLibraryW(L"shell32.dll");
830 {
831 skip("ShellExecuteExW not found\n");
833 return;
834 }
835
836 TEST_MenuUI();
837
839
841}
#define MENUID_100
Definition: MenuUI.c:15
static BOOL CALLBACK CountMenuWndProc(HWND hwnd, LPARAM lParam)
Definition: MenuUI.c:141
#define MENUID_101
Definition: MenuUI.c:16
#define MENUID_200
Definition: MenuUI.c:17
struct tagCOUNTMENUWND * PCOUNTMENUWND
BOOL(WINAPI * FN_ShellExecuteExW)(SHELLEXECUTEINFOW *)
Definition: MenuUI.c:20
static HWND GetThreadFocus(DWORD dwThreadID)
Definition: MenuUI.c:194
static HWND GetThreadCapture(DWORD dwThreadID)
Definition: MenuUI.c:202
tagAUTO_CLICK
Definition: MenuUI.c:30
@ AUTO_RIGHT_CLICK
Definition: MenuUI.c:32
@ AUTO_LEFT_DOUBLE_CLICK
Definition: MenuUI.c:33
@ AUTO_RIGHT_DOUBLE_CLICK
Definition: MenuUI.c:34
@ AUTO_LEFT_CLICK
Definition: MenuUI.c:31
#define CLASSNAME
Definition: MenuUI.c:12
static VOID TEST_MenuUI(VOID)
Definition: MenuUI.c:783
static DWORD WINAPI ThreadFunc(LPVOID arg)
Definition: MenuUI.c:210
static VOID OnDestroy(HWND hwnd)
Definition: MenuUI.c:754
struct tagCOUNTMENUWND COUNTMENUWND
static INT CountMenuWnds(VOID)
Definition: MenuUI.c:157
enum tagAUTO_KEY AUTO_KEY
#define DELAY
Definition: MenuUI.c:25
#define MENUCLASS
Definition: MenuUI.c:13
static VOID AutoClick(AUTO_CLICK type, INT x, INT y)
Definition: MenuUI.c:65
static HANDLE s_hThread
Definition: MenuUI.c:27
#define SUB_PROGRAM
Definition: MenuUI.c:11
static VOID AutoKey(AUTO_KEY type, UINT vKey)
Definition: MenuUI.c:45
static INT GetHitID(HWND hwndTarget)
Definition: MenuUI.c:130
HRESULT(WINAPI * FN_DwmGetWindowAttribute)(HWND, DWORD, PVOID, DWORD)
Definition: MenuUI.c:23
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: MenuUI.c:767
static VOID CloseSubPrograms(VOID)
Definition: MenuUI.c:165
static INT OnCreate(HWND hwnd)
Definition: MenuUI.c:745
tagAUTO_KEY
Definition: MenuUI.c:38
@ AUTO_KEY_DOWN_UP
Definition: MenuUI.c:41
@ AUTO_KEY_DOWN
Definition: MenuUI.c:39
@ AUTO_KEY_UP
Definition: MenuUI.c:40
enum tagAUTO_CLICK AUTO_CLICK
#define INTERVAL
Definition: MenuUI.c:26
static FN_ShellExecuteExW s_pShellExecuteExW
Definition: MenuUI.c:21
static POINT CenterPoint(const RECT *prc)
Definition: MenuUI.c:123
static HWND GetThreadActiveWnd(DWORD dwThreadID)
Definition: MenuUI.c:186
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
#define HandleToUlong(h)
Definition: basetsd.h:79
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static const WCHAR rc2[]
Definition: oid.c:1216
#define CloseHandle
Definition: compat.h:739
HANDLE HWND
Definition: compat.h:19
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define CALLBACK
Definition: compat.h:35
#define LoadLibraryW(x)
Definition: compat.h:747
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4265
#define pt(x, y)
Definition: drawing.c:79
#define L(x)
Definition: resources.c:13
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLenum GLenum input
Definition: glext.h:9031
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
static HMODULE hShell32
Definition: string.c:34
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
long LONG
Definition: pedump.c:60
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:33
#define SEE_MASK_FLAG_NO_UI
Definition: shellapi.h:38
#define _countof(array)
Definition: sndvol32.h:70
LPCWSTR lpParameters
Definition: shellapi.h:339
LPCWSTR lpszClassName
Definition: winuser.h:3261
HBRUSH hbrBackground
Definition: winuser.h:3259
HICON hIcon
Definition: winuser.h:3257
HINSTANCE hInstance
Definition: winuser.h:3256
HCURSOR hCursor
Definition: winuser.h:3258
INT nMenuCount
Definition: MenuUI.c:137
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
void * PVOID
Definition: typedefs.h:50
int32_t INT
Definition: typedefs.h:58
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define OBJID_MENU
Definition: winable.h:18
UINT WINAPI SendInput(UINT, LPINPUT, int)
Definition: ntwrapper.h:344
#define INPUT_KEYBOARD
Definition: winable.h:10
BOOL WINAPI GetGUIThreadInfo(DWORD, LPGUITHREADINFO)
Definition: ntwrapper.h:398
#define INPUT_MOUSE
Definition: winable.h:9
#define ZeroMemory
Definition: winbase.h:1753
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define CS_VREDRAW
Definition: winuser.h:666
#define MOUSEEVENTF_ABSOLUTE
Definition: winuser.h:1205
BOOL WINAPI GetTitleBarInfo(_In_ HWND, _Inout_ PTITLEBARINFO)
#define WM_CLOSE
Definition: winuser.h:1640
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:929
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SM_CYSCREEN
Definition: winuser.h:971
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MOUSEEVENTF_LEFTUP
Definition: winuser.h:1196
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1627
#define SW_MINIMIZE
Definition: winuser.h:787
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define CS_HREDRAW
Definition: winuser.h:661
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:695
#define VK_UP
Definition: winuser.h:2244
#define MOUSEEVENTF_RIGHTUP
Definition: winuser.h:1198
#define CS_DBLCLKS
Definition: winuser.h:659
#define IDI_APPLICATION
Definition: winuser.h:712
#define MOUSEEVENTF_MOVE
Definition: winuser.h:1194
#define MOUSEEVENTF_LEFTDOWN
Definition: winuser.h:1195
#define SM_CXSMICON
Definition: winuser.h:1023
#define VK_RETURN
Definition: winuser.h:2220
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
DWORD WINAPI WaitForInputIdle(_In_ HANDLE, _In_ DWORD)
#define LoadIcon
Definition: winuser.h:5898
BOOL WINAPI UpdateWindow(_In_ HWND)
#define LoadCursor
Definition: winuser.h:5897
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4392
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define PostMessage
Definition: winuser.h:5917
#define CW_USEDEFAULT
Definition: winuser.h:225
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define VK_LEFT
Definition: winuser.h:2243
#define VK_RIGHT
Definition: winuser.h:2245
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define VK_DOWN
Definition: winuser.h:2246
#define MOUSEEVENTF_RIGHTDOWN
Definition: winuser.h:1197
#define SW_RESTORE
Definition: winuser.h:790
#define VK_SHIFT
Definition: winuser.h:2221
#define WM_DESTROY
Definition: winuser.h:1628
#define SM_CXSCREEN
Definition: winuser.h:970
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
#define VK_ESCAPE
Definition: winuser.h:2233
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI GetMenuBarInfo(_In_ HWND, _In_ LONG, _In_ LONG, _Inout_ PMENUBARINFO)
int WINAPI GetSystemMetrics(_In_ int)
#define KEYEVENTF_KEYUP
Definition: winuser.h:1113
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
__wchar_t WCHAR
Definition: xmlstorage.h:180