37#define MDI_FIRST_CHILD_ID 2004
40#define SWP_NOCLIENTSIZE 0x0800
41#define SWP_NOCLIENTMOVE 0x1000
42#define SWP_STATECHANGED 0x8000
44#define SW_NORMALNA 0xCC
47#define WM_KEYF1 0x004d
51#define WM_SYSTIMER 0x0118
54#define WND_PARENT_ID 1
58#ifndef WM_LBTRACKPOINT
59#define WM_LBTRACKPOINT 0x0131
64#elif defined __x86_64__
68#elif defined __aarch64__
122{
'T',
'e',
's',
't',
'W',
'i',
'n',
'd',
'o',
'w',
'C',
'l',
'a',
's',
's',
'W',0 };
912 { WM_STYLECHANGING,
sent },
913 { WM_STYLECHANGED,
sent },
1811 { SBM_GETSCROLLINFO,
sent },
1819 { SBM_SETSCROLLINFO,
sent },
2026#define GET_PROC(dll, func) \
2027 p ## func = (void*)GetProcAddress(dll, #func); \
2029 trace("GetProcAddress(%s) failed\n", #func); \
2044 GET_PROC(user32, SetCoalescableTimer)
2056#define DUMP(flag) do { if (flags & flag) { strcat( buffer, "|" #flag ); flags &= ~flag; } } while(0)
2084 message == WM_DISPLAYCHANGE ||
2094 hash =
hash * 1664525u + (
unsigned char)(*str) + 1013904223u;
2104 hash =
hash * 1664525u + (
unsigned char)(*str) + 1013904223u;
2109#define add_message(msg) add_message_(__LINE__,msg);
2142 static const char *
const CBT_code_name[10] =
2150 "HCBT_CLICKSKIPPED",
2155 const char *code_name = (
msg->message <=
HCBT_SETFOCUS) ? CBT_code_name[
msg->message] :
"Unknown";
2158 msg->descr,
msg->message, code_name,
msg->wParam,
msg->lParam );
2167 switch (
msg->message)
2174 sprintf( seq->
output,
"%s: %p WM_WINDOWPOS%s wp %08lx lp %08lx after %p x %d y %d cx %d cy %d flags %s",
2178 winpos->
x, winpos->
y, winpos->
cx, winpos->
cy,
2186 seq->
wParam &= ~SWP_NOZORDER;
2195 sprintf( seq->
output,
"%s: %p WM_DRAWITEM: type %x, ctl_id %x, item_id %x, action %x, state %x",
2219 sprintf( seq->
output,
"%s: %p WM_MEASUREITEM: CtlType %#x, CtlID %#x, itemID %#x, itemData %#lx",
2233 mi.u.item.wParam =
msg->wParam;
2235 if (is_unicode_data)
2253 sprintf( seq->
output,
"%s: %p WM_COMPAREITEM: CtlType %#x, CtlID %#x, itemID1 %#x, itemData1 %#lx, itemID2 %#x, itemData2 %#lx",
2260 if (is_unicode_data)
2274 if (
msg->message >= 0xc000)
return;
2289 int min_timeout = 100;
2312 unsigned int count = 0;
2326 trace_(
file,
line)(
" %u: expected: winevent %04x - actual: %s\n",
2389#define ok_sequence( exp, contx, todo) \
2390 ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__)
2399 int failcount = 0,
dump = 0;
2400 unsigned int count = 0;
2419 "%s: %u: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
2426 "%s: %u: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
2440 "%s: %u: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
2447 "%s: %u: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
2466 "%s: %u: the msg 0x%04x should %shave been sent by DefWindowProc\n",
2473 "%s: %u: the msg 0x%04x should %shave been sent by DefWindowProc\n",
2479 "%s: %u: the msg 0x%04x should %shave been sent by BeginPaint\n",
2484 "%s: %u: the msg 0x%04x should have been %s\n",
2489 "%s: %u: the msg 0x%04x was expected in %s\n",
2494 "%s: %u: the msg 0x%04x should have been sent by a hook\n",
2499 "%s: %u: the msg 0x%04x should have been sent by a winevent hook\n",
2504 "%s: %u: the msg 0x%04x should have been sent by a keyboard hook\n",
2522 ok_(
file,
line) (
FALSE,
"%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
2529 ok_(
file,
line) (
FALSE,
"%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
2550 ok_(
file,
line) (
FALSE,
"%s: %u: the msg sequence is not complete: expected %04x - actual %04x\n",
2560 ok_(
file,
line) (
FALSE,
"%s: %u: the msg sequence is not complete: expected %04x - actual %04x\n",
2564 if(
todo && !failcount)
2575#define expect(EXPECTED,GOT) ok((GOT)==(EXPECTED), "Expected %d, got %d\n", (EXPECTED), (GOT))
3661 msg.descr =
"mdi client";
3670 static LONG defwndproc_counter = 0;
3705 msg.descr =
"mdi child";
3709 defwndproc_counter++;
3711 defwndproc_counter--;
3718 static LONG defwndproc_counter = 0;
3737 msg.descr =
"mdi frame";
3741 defwndproc_counter++;
3743 defwndproc_counter--;
3782 HWND mdi_frame, mdi_child, mdi_child2, active_child;
3792 trace(
"creating MDI frame window\n");
3805 trace(
"creating MDI client window\n");
3819 ok(
GetFocus() == mdi_frame,
"input focus should be on MDI frame not on %p\n",
GetFocus());
3822 ok(!active_child,
"wrong active MDI child %p\n", active_child);
3823 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
3828 trace(
"creating invisible MDI child window\n");
3846 ok(!active_child,
"wrong active MDI child %p\n", active_child);
3847 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
3863 ok(!active_child,
"wrong active MDI child %p\n", active_child);
3864 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
3869 trace(
"creating visible MDI child window\n");
3884 ok(active_child == mdi_child,
"wrong active MDI child %p\n", active_child);
3885 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
3898 ok(active_child == mdi_child ||
3900 "wrong active MDI child %p\n", active_child);
3901 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
3905 trace(
"creating invisible MDI child window\n");
3923 ok(active_child == mdi_child ||
3924 active_child == mdi_child2,
3925 "wrong active MDI child %p\n", active_child);
3926 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
3936 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
3937 ok(zoomed,
"wrong zoomed state %d\n", zoomed);
3943 "wrong focus window %p\n",
GetFocus());
3959 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
3960 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
3994 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
3995 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
4005 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
4006 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
4024 trace(
"Testing WM_CHILDACTIVATE\n");
4037 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
4038 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
4045 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
4046 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
4052 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
4053 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
4060 ok(active_child == mdi_child,
"wrong active MDI child %p\n", active_child);
4061 ok(!zoomed,
"wrong zoomed state %d\n", zoomed);
4069 trace(
"creating maximized visible MDI child window 1\n");
4076 ok(
IsZoomed(mdi_child),
"1st MDI child should be maximized\n");
4081 "wrong focus window %p\n",
GetFocus());
4084 ok(active_child == mdi_child,
"wrong active MDI child %p\n", active_child);
4085 ok(zoomed,
"wrong zoomed state %d\n", zoomed);
4088 trace(
"creating maximized visible MDI child window 2\n");
4095 ok(
IsZoomed(mdi_child2),
"2nd MDI child should be maximized\n");
4096 ok(!
IsZoomed(mdi_child),
"1st MDI child should NOT be maximized\n");
4102 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
4103 ok(zoomed,
"wrong zoomed state %d\n", zoomed);
4106 trace(
"destroying maximized visible MDI child window 2\n");
4110 ok(!
IsZoomed(mdi_child),
"1st MDI child should NOT be maximized\n");
4119 ok(active_child == mdi_child2 ||
4121 "wrong active MDI child %p\n", active_child);
4125 ok(
IsZoomed(mdi_child),
"1st MDI child should be maximized\n");
4131 trace(
"re-creating maximized visible MDI child window 2\n");
4138 ok(
IsZoomed(mdi_child2),
"2nd MDI child should be maximized\n");
4139 ok(!
IsZoomed(mdi_child),
"1st MDI child should NOT be maximized\n");
4145 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
4146 ok(zoomed,
"wrong zoomed state %d\n", zoomed);
4151 ok(!
IsWindow(mdi_child2),
"MDI child 2 should be destroyed\n");
4153 ok(
IsZoomed(mdi_child),
"1st MDI child should be maximized\n");
4158 ok(active_child == mdi_child,
"wrong active MDI child %p\n", active_child);
4159 ok(zoomed,
"wrong zoomed state %d\n", zoomed);
4172 ok(active_child == mdi_child ||
4174 "wrong active MDI child %p\n", active_child);
4177 trace(
"creating maximized invisible MDI child window\n");
4184 ok(
IsZoomed(mdi_child2),
"MDI child should be maximized\n");
4192 ok(active_child == mdi_child ||
4193 !active_child || active_child == mdi_child2,
4194 "wrong active MDI child %p\n", active_child);
4197 trace(
"call ShowWindow(mdi_child, SW_MAXIMIZE)\n");
4200 ok(
IsZoomed(mdi_child2),
"MDI child should be maximized\n");
4205 ok(active_child == mdi_child2,
"wrong active MDI child %p\n", active_child);
4206 ok(zoomed,
"wrong zoomed state %d\n", zoomed);
4215 trace(
"creating maximized visible MDI child window 1(Switch test)\n");
4222 ok(
IsZoomed(mdi_child),
"1st MDI child should be maximized(Switch test)\n");
4227 "wrong focus window %p(Switch test)\n",
GetFocus());
4230 ok(active_child == mdi_child,
"wrong active MDI child %p(Switch test)\n", active_child);
4231 ok(zoomed,
"wrong zoomed state %d(Switch test)\n", zoomed);
4234 trace(
"creating maximized visible MDI child window 2(Switch test)\n");
4242 ok(
IsZoomed(mdi_child2),
"2nd MDI child should be maximized(Switch test)\n");
4243 ok(!
IsZoomed(mdi_child),
"1st MDI child should NOT be maximized(Switch test)\n");
4249 ok(active_child == mdi_child2,
"wrong active MDI child %p(Switch test)\n", active_child);
4250 ok(zoomed,
"wrong zoomed state %d(Switch test)\n", zoomed);
4253 trace(
"Switch child window.\n");
4256 trace(
"end of test for switch maximized MDI children\n");
4261 ok(!
IsZoomed(mdi_child),
"wrong zoomed state for %p(Switch test)\n", mdi_child);
4262 ok(!
IsZoomed(mdi_child2),
"wrong zoomed state for %p(Switch test)\n", mdi_child2);
4264 ok(active_child == mdi_child,
"wrong active MDI child %p(Switch test)\n", active_child);
4269 trace(
"end of test for switch not maximized MDI children\n");
4282 mdi_cs.
szClass =
"MDI_child_Class";
4292 ok(mdi_child != 0,
"MDI child creation failed\n");
4298 ok(active_child == mdi_child,
"wrong active MDI child %p\n", active_child);
4300 ok(
IsZoomed(mdi_child),
"MDI child should be maximized\n");
4305 ok(active_child == mdi_child,
"wrong active MDI child %p\n", active_child);
4306 ok(zoomed,
"wrong zoomed state %d\n", zoomed);
4312 ok(!
IsWindow(mdi_child),
"MDI child should be destroyed\n");
4314 ok(!active_child,
"wrong active MDI child %p\n", active_child);
4320 ok(
val == 0xdeadbeef ||
broken(
val == 0) ,
"Expected 0xdeadbeef, got 0x%x\n",
val);
4345 ok(zoomed,
"wrong zoomed state %d\n", zoomed);
4413 msg.descr =
"dialog";
4444 msg.descr =
"dialog";
4462 if (clear)
ok(
style & clear,
"style %08x should be set\n", clear);
4474 if (clear)
ok(!(
style & clear),
"style %08x should not be set\n", clear);
4486 ok(xmin ==
min,
"unexpected min scroll value %d\n", xmin);
4487 ok(xmax ==
max,
"unexpected max scroll value %d\n", xmax);
4501 if (clear)
ok(
style & clear,
"style %08x should be set\n", clear);
4516 if (clear)
ok(!(
style & clear),
"style %08x should not be set\n", clear);
4538 si.
nMin = 0xdeadbeef;
4539 si.
nMax = 0xdeadbeef;
4543 ok(si.
nMin ==
min,
"unexpected min scroll value %d\n", si.
nMin);
4544 ok(si.
nMax ==
max,
"unexpected max scroll value %d\n", si.
nMax);
4562 trace(
"GetScrollRange(SB_CTL) generated unknown message %04x\n",
sequence->message);
4569 trace(
"SetScrollRange(SB_CTL) generated unknown message %04x\n",
sequence->message);
4577 trace(
"GetScrollRange(SB_CTL) generated unknown message %04x\n",
sequence->message);
4587 trace(
"SetScrollInfo(SB_CTL) generated unknown message %04x\n",
sequence->message);
4594 trace(
"SetScrollInfo(SB_CTL) generated unknown message %04x\n",
sequence->message);
4601 trace(
"SetScrollInfo(SB_CTL) generated unknown message %04x\n",
sequence->message);
4605 si.
nMin = 0xdeadbeef;
4606 si.
nMax = 0xdeadbeef;
4610 trace(
"GetScrollInfo(SB_CTL) generated unknown message %04x\n",
sequence->message);
4641 100, 100, 200, 200, 0, 0, 0,
NULL);
4642 ok (
hwnd != 0,
"Failed to create overlapped window\n");
4645 ok (hchild != 0,
"Failed to create child\n");
4649 trace(
"calling ShowWindow( SW_SHOWNA) for invisible top level window\n");
4654 trace(
"calling ShowWindow( SW_SHOWNA) for now visible top level window\n");
4662 trace(
"calling ShowWindow( SW_SHOWNA) for invisible child with invisible parent\n");
4668 trace(
"calling ShowWindow( SW_SHOWNA) for the visible child and invisible parent\n");
4674 trace(
"calling ShowWindow( SW_SHOWNA) for the visible child and parent\n");
4681 trace(
"calling ShowWindow( SW_SHOWNA) for the invisible child and visible parent\n");
4699 trace(
"calling CreateWindowExA( WS_MAXIMIZE ) for invisible maximized popup window\n");
4701 100, 100, 200, 200, 0, 0, 0,
NULL);
4702 ok (
hwnd != 0,
"Failed to create popup window\n");
4715 trace(
"calling ShowWindow( SW_SHOWMAXIMIZE ) for invisible maximized popup window\n");
4731 trace(
"calling CreateWindowExA( WS_MAXIMIZE ) for invisible maximized popup window\n");
4733 100, 100, 200, 200, 0, 0, 0,
NULL);
4734 ok (
hwnd != 0,
"Failed to create popup window\n");
4738 trace(
"calling ShowWindow( SW_SHOWMAXIMIZE ) for invisible maximized popup window\n");
4748 trace(
"calling CreateWindowExA( WS_MAXIMIZE ) for maximized popup window\n");
4750 100, 100, 200, 200, 0, 0, 0,
NULL);
4751 ok (
hwnd != 0,
"Failed to create popup window\n");
4761 trace(
"calling CreateWindowExA( WS_VISIBLE ) for popup window\n");
4763 100, 100, 200, 200, 0, 0, 0,
NULL);
4764 ok (
hwnd != 0,
"Failed to create popup window\n");
4768 trace(
"calling ShowWindow( SW_SHOWMAXIMIZE ) for visible popup window\n");
4778 static const struct message seq[] =
4792 100, 100, 200, 200, 0, 0, 0,
NULL);
4793 ok(
hwnd != 0,
"Failed to create simple window\n");
4797 ok(recursive != 0,
"Failed to create recursive activation window\n");
4816 100, 100, 200, 200, 0, 0, 0,
NULL);
4817 ok (
hwnd != 0,
"Failed to create overlapped window\n");
4826 ok(
state != 0xffffffff,
"wrong SC_CLOSE state %x\n",
state);
4833 ok(
state != 0xffffffff,
"wrong SC_CLOSE state %x\n",
state);
4840 ok(
state != 0xffffffff,
"wrong SC_CLOSE state %x\n",
state);
4854 100, 100, 200, 200, 0, 0, 0,
NULL);
4855 ok (
hwnd != 0,
"Failed to create overlapped window\n");
4861 ok(
state == 0xffffffff,
"wrong SC_CLOSE state %x\n",
state);
4867 100, 100, 200, 200, 0, 0, 0,
NULL);
4868 ok(
hwnd != 0,
"Failed to create overlapped window\n");
4878 { WM_SETICON,
sent },
4887 { WM_SETICON,
sent },
4977 ok(
msg.message ==
WM_USER,
"got %04x instead of WM_USER\n",
msg.message);
4988 ok(
msg.message ==
WM_USER,
"got %04x instead of WM_USER\n",
msg.message);
5001 ok(
msg.message ==
WM_USER,
"got %04x instead of WM_USER\n",
msg.message);
5003 ok(
msg.message ==
WM_USER,
"got %04x instead of WM_USER\n",
msg.message);
5008 ok(
msg.message ==
WM_USER,
"got %04x instead of WM_USER\n",
msg.message);
5014 ok(
msg.message ==
WM_USER,
"got %04x instead of WM_USER\n",
msg.message);
5030 ok(
msg.message ==
WM_USER,
"got %04x instead of WM_USER\n",
msg.message);
5042 static const WPARAM wparams[] = {0,
5062 if (wparams[
i] & 0x8000)
5089#define test_msg_setpos( expected_list, flags, todo ) \
5090 test_msg_setpos_( (expected_list), (flags), (todo), __FILE__, __LINE__)
5098 10, 10, 100, 100,
NULL, 0, 0,
NULL );
5099 ok (
hwnd != 0,
"Failed to create popup window\n");
5111 HWND hchild2, hbutton;
5121 100, 100, 200, 200, 0, 0, 0,
NULL);
5122 ok (
hwnd != 0,
"Failed to create overlapped window\n");
5204 trace(
"testing scroll APIs on a visible top level window %p\n",
hwnd);
5237 10, 10, 100, 100,
NULL, 0, 0,
NULL );
5238 ok (
hwnd != 0,
"Failed to create popup window\n");
5247 10, 10, 100, 100,
NULL, 0, 0,
NULL );
5248 ok (
hwnd != 0,
"Failed to create popup window\n");
5258 10, 10, 100, 100,
NULL, 0, 0,
NULL );
5259 ok (
hwnd != 0,
"Failed to create popup window\n");
5301 100, 100, 200, 200, 0, 0, 0,
NULL);
5302 ok (hparent != 0,
"Failed to create parent window\n");
5305 0, 0, 10, 10, hparent, 0, 0,
NULL);
5306 ok (hchild != 0,
"Failed to create child window\n");
5310 "SetWindowPos:show_popup_first_show_window_child1",
FALSE);
5316 100, 100, 200, 200, 0, 0, 0,
NULL);
5317 ok (hparent != 0,
"Failed to create parent window\n");
5320 0, 0, 10, 10, hparent, 0, 0,
NULL);
5321 ok (hchild != 0,
"Failed to create child window\n");
5325 "SetWindowPos:show_popup_first_show_window_child2",
FALSE);
5333 -10, -10, 10000, 10000,
NULL, 0, 0,
NULL );
5334 ok (
hwnd != 0,
"Failed to create popup window\n");
5342 100, 100, 200, 200, 0, 0, 0,
NULL);
5343 ok (hparent != 0,
"Failed to create parent window\n");
5347 0, 0, 10, 10, hparent, 0, 0,
NULL);
5348 ok (hchild != 0,
"Failed to create child window\n");
5356 0, 0, 10, 10, hparent, 0, 0,
NULL);
5357 ok (hchild != 0,
"Failed to create child window\n");
5360 trace(
"testing scroll APIs on a visible child window %p\n", hchild);
5370 0, 0, 10, 10, hparent, 0, 0,
NULL);
5371 ok (hchild != 0,
"Failed to create child window\n");
5375 100, 100, 50, 50, hparent, 0, 0,
NULL);
5376 ok (hchild2 != 0,
"Failed to create child2 window\n");
5380 0, 100, 50, 50, hchild, 0, 0,
NULL);
5381 ok (hbutton != 0,
"Failed to create button window\n");
5433 0, 0, 100, 100, hparent, 0, 0,
NULL);
5434 ok (hchild != 0,
"Failed to create child popup window\n");
5441 0, 0, 100, 100, hparent, 0, 0,
NULL);
5442 ok (hchild != 0,
"Failed to create popup window\n");
5462 0, 0, 100, 100, hparent, 0, 0,
NULL);
5463 ok (hchild != 0,
"Failed to create popup window\n");
5477 0, 0, 100, 100, hparent, 0, 0,
NULL);
5478 ok(
hwnd != 0,
"Failed to create custom dialog window\n");
5482 trace(
"testing scroll APIs on a visible dialog %p\n",
hwnd);
5505 ok(
hwnd != 0,
"Failed to create custom dialog window\n");
5507 trace(
"call ShowWindow(%p, SW_SHOW)\n",
hwnd);
5523 ok(
hwnd != 0,
"Failed to create custom dialog window\n");
5541 ok(!
DrawMenuBar(
hwnd),
"DrawMenuBar should return FALSE for a destroyed window\n");
5546 ok (
hmenu != 0,
"Failed to create menu\n");
5576 100, 100, 200, 200, 0, 0, 0,
NULL);
5577 ok (hparent != 0,
"Failed to create parent window\n");
5579 0, 0, 10, 10, hparent, 0, 0,
NULL);
5580 ok (hchild != 0,
"Failed to create child window\n");
5619 ok(
msg.message ==
WM_USER+1,
"got %x instead of WM_USER+1\n",
msg.message );
5626 trace(
"testing WM_SETICON\n");
5669 ok(
res == 1,
"SendMessage(hwnd, 0x3B, 0x8000000b, 0) should have returned 1 instead of %ld\n",
res);
5672 ok(
res == 1,
"SendMessage(hwnd, 0x3B, 0x0000000b, 0) should have returned 1 instead of %ld\n",
res);
5675 ok(
res == 1,
"SendMessage(hwnd, 0x3B, 0x0000000f, 0) should have returned 1 instead of %ld\n",
res);
5680 ok(
res == 2,
"SendMessage(hwnd, 0x3B, 0x80000008, 0) should have returned 2 instead of %ld\n",
res);
5683 ok(
res == 2,
"SendMessage(hwnd, 0x3B, 0x00000008, 0) should have returned 2 instead of %ld\n",
res);
5687 ok(
res == 2,
"SendMessage(hwnd, 0x3B, 0x80000004, 0) should have returned 2 instead of %ld\n",
res);
5691 ok(
res == 2,
"SendMessage(hwnd, 0x3B, 0x80000001, 0) should have returned 2 instead of %ld\n",
res);
5703 const INT winX = 100;
5704 const INT winY = 100;
5708 0, 0, winX, winY, 0,
5719 ok(
res ==
TRUE,
"SetWindowPos expected TRUE, got %ld\n",
res);
5729 HWND hparent, hchild;
5732 100, 100, 200, 200, 0, 0, 0,
NULL);
5733 ok (hparent != 0,
"Failed to create parent window\n");
5739 0, 0, 10, 10, hparent, 0, 0,
NULL);
5740 ok (hchild != 0,
"Failed to create child window\n");
5756 0, 0, 10, 10, hparent, 0, 0,
NULL);
5772 0, 0, 10, 10, hparent, 0, 0,
NULL);
5782 0, 0, 10, 10, hparent, 0, 0,
NULL);
5798 0, 0, 10, 10, hparent, 0, 0,
NULL);
5809 0, 0, 10, 10, hparent, 0, 0,
NULL);
5825 0, 0, 10, 10, hparent, 0, 0,
NULL);
5838 0, 0, 10, 10, hparent, 0, 0,
NULL);
5854 0, 0, 10, 10, hparent, 0, 0,
NULL);
5893#define ID_BUTTON 0x000e
6214 static LONG defwndproc_counter = 0;
6252 msg.descr =
"button";
6256 defwndproc_counter++;
6258 defwndproc_counter--;
6284 const struct message *setfocus;
6285 const struct message *killfocus;
6286 const struct message *setstyle;
6287 const struct message *setstate;
6288 const struct message *clearstate;
6289 const struct message *setcheck;
6290 const struct message *lbuttondown;
6291 const struct message *lbuttonup;
6292 const struct message *setfont;
6293 const struct message *settext;
6352 HFONT zfont, hfont2;
6359 0, 0, 50, 14, 0, 0, 0,
NULL);
6360 ok(
hwnd != 0,
"Failed to create button window\n");
6371 100, 100, 200, 200, 0, 0, 0,
NULL);
6372 ok(
parent != 0,
"Failed to create parent window\n");
6374 memset(&logfont, 0,
sizeof(logfont));
6380 ok(hfont2 !=
NULL,
"Failed to create Tahoma font\n");
6394 ok(
hwnd != 0,
"Failed to create button window\n");
6405 ok(dlg_code ==
button[
i].dlg_code,
"%u: wrong dlg_code %08x\n",
i, dlg_code);
6450 ok(
state == 0x0004,
"expected state 0x0004, got %04x\n",
state);
6495 sprintf(
desc,
"button[%i]: WM_SETTEXT on a visible button",
i);
6503 sprintf(
desc,
"button[%i]: WM_SETTEXT on an invisible button",
i);
6512 sprintf(
desc,
"button[%i]: WM_SETTEXT on an invisible button",
i);
6541 0, 0, 50, 14, 0, 0, 0,
NULL);
6542 ok(
hwnd != 0,
"Failed to create button window\n");
6554 sprintf(
desc,
"button[%i]: WM_LBUTTONDOWN on a button",
i);
6559 sprintf(
desc,
"button[%i]: WM_LBUTTONUP on a button",
i);
6566 sprintf(
desc,
"button[%i]: WM_SETFONT on a button",
i);
6595 100, 100, 200, 200, 0, 0, 0,
NULL);
6596 ok (
hwnd != 0,
"Failed to create overlapped window\n");
6631 ok(
GetObjectW(hbmp1x1,
sizeof(bm), &bm),
"Expect GetObjectW() success\n");
6632 ok(bm.bmWidth == 1 && bm.bmHeight == 1,
"Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
6633 bm.bmWidth, bm.bmHeight);
6635 ok(
GetObjectW(hbmp2x2,
sizeof(bm), &bm),
"Expect GetObjectW() success\n");
6636 ok(bm.bmWidth == 2 && bm.bmHeight == 2,
"Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
6637 bm.bmWidth, bm.bmHeight);
6640 ZeroMemory(&icon_info2x2,
sizeof(icon_info2x2));
6642 icon_info2x2.
hbmMask = hmask2x2;
6647 ok(
GetIconInfo(hicon2x2, &icon_info),
"Expect GetIconInfo() success\n");
6650 ok(bm.bmWidth == 2 && bm.bmHeight == 2,
"Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
6651 bm.bmWidth, bm.bmHeight);
6656 hwnd =
CreateWindowA(
"Button",
"test", default_style |
BS_BITMAP, 0, 0, 100, 100, 0, 0, 0, 0);
6660 ok(
hbmp != 0,
"Expect hbmp not 0\n");
6663 ok(bm.bmWidth == 1 && bm.bmHeight == 1,
"Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
6664 bm.bmWidth, bm.bmHeight);
6668 hwnd =
CreateWindowA(
"Button",
"test", default_style, 0, 0, 100, 100, 0, 0, 0, 0);
6671 ok(
ret == 0,
"Expect ret to be 0\n");
6673 ok(
hbmp ==
NULL,
"Expect hbmp to be NULL\n");
6677 hwnd =
CreateWindowA(
"Button",
"test", default_style |
BS_ICON, 0, 0, 100, 100, 0, 0, 0, 0);
6681 ok(hicon !=
NULL,
"Expect hicon not NULL\n");
6683 ok(
GetIconInfo(hicon, &icon_info),
"Expect GetIconInfo() success\n");
6686 ok(bm.bmWidth == 2 && bm.bmHeight == 2,
"Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
6687 bm.bmWidth, bm.bmHeight);
6693 hwnd =
CreateWindowA(
"Button",
"test", default_style, 0, 0, 100, 100, 0, 0, 0, 0);
6696 ok(
ret == 0,
"Expect ret to be 0\n");
6698 ok(hicon ==
NULL,
"Expect hicon to be NULL\n");
6702 hwnd =
CreateWindowA(
"Button",
"test", default_style |
BS_BITMAP, 0, 0, 100, 100, 0, 0, 0, 0);
6703 ok(
hwnd !=
NULL,
"Expect hwnd to be not NULL\n");
6705 ok(
ret == 0,
"Expect ret to be 0\n");
6707 ok(hicon ==
NULL,
"Expect hicon to be NULL\n");
6711 hwnd =
CreateWindowA(
"Button",
"test", default_style |
BS_ICON, 0, 0, 100, 100, 0, 0, 0, 0);
6712 ok(
hwnd !=
NULL,
"Expect hwnd to be not NULL\n");
6714 ok(
ret == 0,
"Expect ret to be 0\n");
6716 ok(
hbmp ==
NULL,
"Expect hbmp to be NULL\n");
6726#define ID_RADIO1 501
6727#define ID_RADIO2 502
6728#define ID_RADIO3 503
6905 ok(
parent != 0,
"failed to create parent window\n");
6975#define test_radio(r1, s1, r2, s2, r3, s3) test_radio_dbg(r1, s1, r2, s2, r3, s3, __LINE__)
7005 ok(
parent != 0,
"failed to create parent window\n");
7015 set_radio(radio1, 1, radio2, 1, radio3, 1);
7055 ok(
ret,
"IsDialogMessage should return TRUE\n");
7062 set_radio(radio1, 0, radio2, 1, radio3, 1);
7069 ok(
ret,
"IsDialogMessage should return TRUE\n");
7090 ok(
ret,
"IsDialogMessage should return TRUE\n");
7097 ok(
hwnd == radio1,
"focus should be on radio1, not on %p\n",
hwnd);
7107 ok(
ret,
"IsDialogMessage should return TRUE\n");
7114 ok(
hwnd == radio1,
"focus should be on radio1, not on %p\n",
hwnd);
7126 ok(
ret,
"IsDialogMessage should return TRUE\n");
7133 ok(
hwnd == radio1,
"focus should be on radio1, not on %p\n",
hwnd);
7145 ok(
ret,
"IsDialogMessage should return TRUE\n");
7171 static LONG defwndproc_counter = 0;
7183 msg.descr =
"static";
7186 defwndproc_counter++;
7188 defwndproc_counter--;
7215 const struct message *setfont;
7229 0, 0, 50, 14, 0, 0, 0,
NULL);
7230 ok(
hwnd != 0,
"Failed to create static window\n");
7233 ok(dlg_code == static_ctrl[
i].dlg_code,
"%u: wrong dlg_code %08x\n",
i, dlg_code);
7240 trace(
"static style %08x\n", static_ctrl[
i].
style);
7249#define ID_COMBOBOX 0x000f
7374 static LONG defwndproc_counter = 0;
7393 msg.descr =
"combo edit";
7397 defwndproc_counter++;
7399 defwndproc_counter--;
7407 static LONG defwndproc_counter = 0;
7425 msg.descr =
"combo lbox";
7429 defwndproc_counter++;
7431 defwndproc_counter--;
7438 static LONG defwndproc_counter = 0;
7457 msg.descr =
"combo";
7461 defwndproc_counter++;
7463 defwndproc_counter--;
7493 100, 100, 200, 200, 0, 0, 0,
NULL);
7494 ok(
parent != 0,
"Failed to create parent window\n");
7499 ok(combo != 0,
"Failed to create combobox window\n");
7507 ok(
ret == 0,
"expected 0, got %ld\n",
ret);
7509 ok(
ret == 1,
"expected 1, got %ld\n",
ret);
7511 ok(
ret == 2,
"expected 2, got %ld\n",
ret);
7533 ok(
parent != 0,
"Failed to create parent window\n");
7537 ok(combo != 0,
"Failed to create combobox window\n");
7542 ok(
res,
"Failed to get COMBOBOXINFO structure; LastError: %u\n",
GetLastError());
7551 ok(
button != 0,
"Failed to create button window\n");
7593 ok(combo != 0,
"Failed to create combobox window\n");
7596 ok(
ret == 0,
"expected 0, got %ld\n",
ret);
7601 ok(
res,
"Failed to get COMBOBOXINFO structure; LastError: %u\n",
GetLastError());
7648 msg.descr =
"wmime_keydown";
7670 trace(
"Message sequences by WM_IME_KEYDOWN\n");
7703 printf(
"null region\n" );
7716#define check_update_rgn( hwnd, hrgn ) check_update_rgn_( __LINE__, hwnd, hrgn )
7728 ok_(__FILE__,
line)( !
hrgn,
"Update region shouldn't be empty\n" );
7734 ok_(__FILE__,
line)( 0,
"Regions are different\n" );
7737 printf(
"Update region: " );
7739 printf(
"Wanted region: " );
7896 HWND hparent, hchild;
7900 100, 100, 200, 200, 0, 0, 0,
NULL);
7901 ok (
hwnd != 0,
"Failed to create overlapped window\n");
7911 ok(
ret,
"RedrawWindow returned %d instead of TRUE\n",
ret);
7915 ok(
ret,
"RedrawWindow returned %d instead of TRUE\n",
ret);
7920 ok(
ret,
"RedrawWindow returned %d instead of TRUE\n",
ret);
7926 ok(
ret,
"RedrawWindow returned %d instead of TRUE\n",
ret);
7931 ok(
ret,
"RedrawWindow returned %d instead of TRUE\n",
ret);
7954 "RedrawWindow failed\n");
7959 "RedrawWindow failed\n");
7964 "RedrawWindow failed\n");
7969 "RedrawWindow failed\n");
7979 "RedrawWindow failed\n");
7982 "region should be null (%d)\n",
ret );
7989 "RedrawWindow failed\n");
7992 "region should be null (%d)\n",
ret );
7999 "RedrawWindow failed\n");
8008 "RedrawWindow failed\n");
8012 "RedrawWindow failed\n");
8161 ok(
ret,
"Invalid GetUpdateRect result %d\n",
ret );
8164 ok( !
ret,
"Invalid GetUpdateRect result %d\n",
ret );
8175 100, 100, 200, 200, 0, 0, 0,
NULL);
8176 ok (hparent != 0,
"Failed to create parent window\n");
8179 10, 10, 100, 100, hparent, 0, 0,
NULL);
8180 ok (hchild != 0,
"Failed to create child window\n");
8383 trace(
"testing SWP_FRAMECHANGED on parent with WS_CLIPCHILDREN\n");
8393 trace(
"testing SWP_FRAMECHANGED|SWP_DEFERERASE on parent with WS_CLIPCHILDREN\n");
8410 trace(
"testing SWP_FRAMECHANGED on parent without WS_CLIPCHILDREN\n");
8420 trace(
"testing SWP_FRAMECHANGED|SWP_DEFERERASE on parent without WS_CLIPCHILDREN\n");
8433 trace(
"testing SetWindowPos(-10000, -10000) on child\n");
8442 trace(
"testing ShowWindow(SW_MINIMIZE) on child\n");
8451 trace(
"testing SetWindowPos(-10000, -10000) on parent\n");
8458 ok(!
IsWindow(hchild),
"child must be destroyed with its parent\n");
8463 100, 100, 200, 200, 0, 0, 0,
NULL);
8464 ok (hparent != 0,
"Failed to create parent window\n");
8467 10, 10, 100, 100, hparent, 0, 0,
NULL);
8468 ok (hchild != 0,
"Failed to create child window\n");
8514 ok(!
IsWindow(hchild),
"child must be destroyed with its parent\n");
8535 100, 100, 200, 200, 0, 0, 0,
NULL);
8559 ok (hchild != 0,
"Failed to create child window\n");
8582 ok (child_event.
hwnd != 0,
"Failed to create child window\n");
8591 if (
ret != 1)
break;
8595 ok( !
ret,
"WaitForSingleObject failed %x\n",
ret );
8600"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
8601"<assemblyIdentity version=\"1.2.3.4\" name=\"testdep1\" type=\"win32\" processorArchitecture=\"" ARCH "\"/>"
8602" <file name=\"testdep.dll\" />"
8606"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
8607"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\" />"
8609" <dependentAssembly>"
8610" <assemblyIdentity type=\"win32\" name=\"testdep1\" version=\"1.2.3.4\" processorArchitecture=\"" ARCH "\" />"
8611" </dependentAssembly>"
8636 actctx.cbSize =
sizeof(ACTCTXW);
8645 ok(
actctx.wProcessorArchitecture == 0,
"wProcessorArchitecture=%d\n",
actctx.wProcessorArchitecture);
8647 ok(
actctx.lpAssemblyDirectory ==
NULL,
"lpAssemblyDirectory=%p\n",
actctx.lpAssemblyDirectory);
8649 ok(
actctx.lpApplicationName ==
NULL,
"lpApplicationName=%p\n",
actctx.lpApplicationName);
8663 int len, expected_len;
8670 win_skip(
"skipping interthread message test under win9x\n");
8689 expected_len =
lstrlenA(
"window caption text");
8693 ok(
len == expected_len,
"CallWindowProcA(WM_GETTEXT) error %d, len %d, expected len %d\n",
GetLastError(),
len, expected_len);
8694 ok(!
lstrcmpA(
buf,
"window caption text"),
"window text mismatch\n");
8698 msg.wParam =
sizeof(
buf);
8704 "DispatchMessageA(WM_GETTEXT) succeeded on another thread window: ret %d, error %d\n",
len,
GetLastError());
8714 "DispatchMessageA(WM_TIMER) failed on another thread window: ret %d, error %d\n",
len,
GetLastError());
8725 100, 100, 200, 200, 0, 0, 0,
NULL);
8736 if (
ret != 1)
break;
8739 ok( !
ret,
"MsgWaitForMultipleObjects failed %x\n",
ret );
8743 ok( !
ret,
"WaitForSingleObject failed %x\n",
ret );
8747 ok( !
ret,
"WaitForSingleObject failed %x\n",
ret );
8758 if (!pActivateActCtx)
8760 win_skip(
"Activation contexts are not supported, skipping\n");
8771 handle = (
void*)0xdeadbeef;
8794 ok(
ret,
"thread window returned %d\n",
ret);
8798 ok(
ret,
"thread window returned %d\n",
ret);
9136 log_msg.
descr =
"accel";
9154 100, 100, 200, 200, 0, 0, 0,
NULL);
9166 ok(!(
state & 0x8000),
"wrong Shift state %04x\n",
state);
9177 trace(
"testing VK_N press/release\n");
9184 skip(
"queuing key events not supported\n" );
9189 trace(
"testing Shift+VK_N press/release\n");
9198 trace(
"testing Ctrl+VK_N press/release\n");
9207 trace(
"testing Alt+VK_N press/release\n");
9216 trace(
"testing Ctrl+Alt+VK_N press/release 1\n");
9233 trace(
"testing VK_N press/release\n");
9240 trace(
"testing Shift+VK_N press/release\n");
9249 trace(
"testing Ctrl+VK_N press/release 2\n");
9258 trace(
"testing Alt+VK_N press/release 2\n");
9267 trace(
"testing Ctrl+Alt+VK_N press/release 2\n");
9278 trace(
"testing Ctrl+Shift+VK_N press/release\n");
9289 trace(
"testing Ctrl+Alt+Shift+VK_N press/release\n");
9306 trace(
"testing Alt press/release\n");
9316 trace(
"testing VK_F1 press/release\n");
9322 trace(
"testing VK_APPS press/release\n");
9328 trace(
"testing VK_F10 press/release\n");
9336 trace(
"testing SHIFT+F10 press/release\n");
9346 trace(
"testing Shift+MouseButton press/release\n");
9370 skip(
"Shift+MouseButton event didn't get to the window\n" );
9383 static LONG defwndproc_counter = 0;
9384 static LONG beginpaint_counter = 0;
9421 ok(capture ==
hwnd,
"capture should NOT be released at this point (capture %p)\n", capture);
9422 trace(
"current capture %p, releasing...\n", capture);
9429 ok(pGetAncestor(
hwnd,
GA_PARENT) != 0,
"parent should NOT be unlinked at this point\n");
9448 ACTIVATION_CONTEXT_BASIC_INFORMATION basicinfo;
9452 handle = (
void*)0xdeadbeef;
9457 memset(&basicinfo, 0xff,
sizeof(basicinfo));
9458 ret = pQueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX,
handle, 0, ActivationContextBasicInformation,
9459 &basicinfo,
sizeof(basicinfo),
NULL);
9461 ok(basicinfo.hActCtx ==
NULL,
"got %p\n", basicinfo.hActCtx);
9462 ok(basicinfo.dwFlags == 0,
"got %x\n", basicinfo.dwFlags);
9484 msg.descr =
"MsgCheckProc";
9495 trace(
"Reserved=%d,%d MaxSize=%d,%d MaxPos=%d,%d MinTrack=%d,%d MaxTrack=%d,%d\n",
9502 ok(minmax->
ptMaxSize.
x == rc.
right,
"default width of maximized child %d != %d\n",
9511 beginpaint_counter++;
9513 beginpaint_counter--;
9524 defwndproc_counter++;
9527 defwndproc_counter--;
9544 static LONG defwndproc_counter = 0;
9564 msg.descr =
"popup";
9573 defwndproc_counter++;
9575 defwndproc_counter--;
9582 static LONG defwndproc_counter = 0;
9583 static LONG beginpaint_counter = 0;
9623 msg.descr =
"parent";
9630 beginpaint_counter++;
9632 beginpaint_counter--;
9637 defwndproc_counter++;
9639 defwndproc_counter--;
9661 static LONG defwndproc_counter = 0;
9672 ok(
ret == 0,
"DM_GETDEFID should return 0 after EndDialog, got %lx\n",
ret );
9683 msg.descr =
"dialog";
9686 defwndproc_counter++;
9688 defwndproc_counter--;
9695 static LONG defwndproc_counter = 0;
9729 defwndproc_counter++;
9731 defwndproc_counter--;
9738 static LONG defwndproc_counter = 0;
9760 msg.descr =
"recursive_activation";
9771 defwndproc_counter++;
9773 defwndproc_counter--;
9798 else ok(
broken(1),
"infinite loop\n");
9809 static LONG defwndproc_counter = 0;
9825 msg.descr =
"HotkeyMsgCheckProcA";
9829 defwndproc_counter++;
9831 defwndproc_counter--;
9836 ok((queue_status & (
QS_HOTKEY << 16)) ==
QS_HOTKEY << 16,
"expected QS_HOTKEY << 16 set, got %x\n", queue_status);
9844 ok((queue_status & (
QS_HOTKEY << 16)) == 0,
"expected QS_HOTKEY << 16 cleared, got %x\n", queue_status);
9972 msg.message = nCode;
10004 msg.message = nCode;
10034 msg.wParam = object_id;
10035 msg.lParam = child_id;
10065static const WCHAR dummy_window_text[] = {
'd',
'u',
'm',
'm',
'y',
' ',
't',
'e',
'x',
't',0};
10084 static const WCHAR wszMsgConversionClass[] =
10085 {
'M',
's',
'g',
'C',
'o',
'n',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'C',
'l',
'a',
's',
's',0};
10107 100, 100, 200, 200, 0, 0, 0,
NULL);
10108 ok(
hwnd !=
NULL,
"Window creation failed\n");
10114 ok(lRes == 0,
"String should have been converted\n");
10116 ok(lRes == 1,
"String shouldn't have been converted\n");
10122 ok(lRes == 1,
"String shouldn't have been converted\n");
10124 ok(lRes == 1,
"String shouldn't have been converted\n");
10129 ok(lRes == 0,
"String should have been converted\n");
10131 ok(lRes == 1,
"String shouldn't have been converted\n");
10138 "PostMessage on sync only message returned %ld, last error %d\n", lRes,
GetLastError());
10142 "PostMessage on sync only message returned %ld, last error %d\n", lRes,
GetLastError());
10146 "PosThreadtMessage on sync only message returned %ld, last error %d\n", lRes,
GetLastError());
10150 "PosThreadtMessage on sync only message returned %ld, last error %d\n", lRes,
GetLastError());
10154 "SendNotifyMessage on sync only message returned %ld, last error %d\n", lRes,
GetLastError());
10158 "SendNotifyMessage on sync only message returned %ld, last error %d\n", lRes,
GetLastError());
10162 "SendMessageCallback on sync only message returned %ld, last error %d\n", lRes,
GetLastError());
10166 "SendMessageCallback on sync only message returned %ld, last error %d\n", lRes,
GetLastError());
10172 100, 100, 200, 200, 0, 0, 0,
NULL);
10178 "got bad length %ld\n", lRes );
10185 "got bad length %ld\n", lRes );
10193 "got bad length %ld\n", lRes );
10200 "got bad length %ld\n", lRes );
10217#define TIMER_ID 0x19
10218#define TIMER_COUNT_EXPECTED 100
10219#define TIMER_COUNT_TOLERANCE 10
10240 ok(
r,
"KillTimer failed in thread\n");
10242 ok(
r,
"SetTimer failed in thread\n");
10245 ok(
r,
"SetEvent failed in thread\n");
10262 ok(
info.id,
"SetTimer failed\n");
10283 ok(
id != 0,
"did not get id from SetTimer.\n");
10284 ok(
id==
TIMER_ID,
"SetTimer timer ID different\n");
10293 "did not get expected count for minimum timeout (%d != ~%d).\n",
10297 if (pSetSystemTimer)
10303 ok(
id != 0,
"did not get id from SetSystemTimer.\n");
10304 ok(
id==
TIMER_ID,
"SetTimer timer ID different\n");
10314 ||
broken(syscount > 4000 && syscount < 12000) ,
10315 "did not get expected count for minimum timeout (%d != ~%d).\n",
10317 todo_wine ok(
count == 0,
"did not get expected count for callback timeout (%d != 0).\n",
10319 ok(pKillSystemTimer(
info.hWnd,
id),
"KillSystemTimer failed\n");
10335 ok(
id != 0,
"did not get id from SetTimer.\n");
10337 ok(id2 ==
id,
"did not get same id from SetTimer when replacing (%li expected %li).\n", id2,
id);
10340 ok(
count == 0,
"did not get zero count as expected (%i).\n",
count);
10343 ok(
count == 1,
"did not get one count as expected (%i).\n",
count);
10347 ok(
count == 1,
"killing replaced timer did not work (%i).\n",
count);
10356 ok(
id != 0,
"did not get id from SetTimer.\n");
10363 "did not get expected count for minimum timeout (%d != ~%d).\n",
10368 if (pSetCoalescableTimer)
10372 ok(
id != 0,
"SetCoalescableTimer failed with %u.\n",
GetLastError());
10376 ok(
count > 1,
"expected count > 1, got %d.\n",
count);
10380 win_skip(
"SetCoalescableTimer not available.\n");
10387 if (!
ids[
i])
break;
10402 ok(
id != 0,
"did not get id from SetTimer.\n");
10411 ok(
count == 1,
"did not get one count as expected (%i).\n",
count);
10525 msg.wParam = object_id;
10527 msg.descr =
"WEH_2";
10546 msg.message = nCode;
10550 msg.descr =
"CBT_2";
10568 msg.descr =
"CBT_2";
10585 msg.message = nCode;
10589 msg.descr =
"CBT_2";
10602 assert(pNotifyWinEvent);
10604 hwnd =
CreateWindowExA(0,
"static",
NULL,
WS_POPUP, 0,0,0,0,0,0,0,
NULL);
10606 trace(
"created thread window %p\n",
hwnd);
10636 hwnd =
CreateWindowExA(0,
"static",
NULL,
WS_POPUP, 0,0,0,0,0,0,0,
NULL);
10638 trace(
"created thread window %p\n",
hwnd);
10667 hwnd =
CreateWindowExA(0,
"static",
NULL,
WS_POPUP, 0,0,0,0,0,0,0,
NULL);
10669 trace(
"created thread window %p\n",
hwnd);
10714 skip(
"cannot set global hook\n" );
10744 ok(!
IsWindow(hwnd2),
"window should be destroyed on thread exit\n");
10747 if (!pSetWinEventHook || !pNotifyWinEvent || !pUnhookWinEvent)
10773 hhook = pSetWinEventHook(
10775 EVENT_OBJECT_LOCATIONCHANGE,
10808 ok(!
IsWindow(hwnd2),
"window should be destroyed on thread exit\n");
10812 hhook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0,
10852 ok(!
IsWindow(hwnd2),
"window should be destroyed on thread exit\n");
10860 win_skip(
"Skipping WH_MOUSE_LL test on this platform\n");
10861 goto skip_mouse_ll_hook_test;
10890 ok(!
IsWindow(hwnd2),
"window should be destroyed on thread exit\n");
10892skip_mouse_ll_hook_test:
10904 ok(
hhook != 0,
"local hook does not require hModule set to 0\n");
10912 ok(!
hhook,
"global hook requires hModule != 0\n");
10918 ok(!
hhook,
"SetWinEventHook with invalid proc should fail\n");
10929 if (!pSetWinEventHook || !pUnhookWinEvent)
return;
10933 hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0,
win_event_proc,
10935 ok(!hwinevent_hook,
"WINEVENT_INCONTEXT requires hModule != 0\n");
10942 hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0,
win_event_proc,
10944 ok(!hwinevent_hook,
"WINEVENT_INCONTEXT requires hModule != 0\n");
10955 ok(!hwinevent_hook,
"SetWinEventHook with invalid event range should fail\n");
10961 ok(!hwinevent_hook,
"SetWinEventHook with invalid event range should fail\n");
10965 hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0,
win_event_proc,
10967 ok(!hwinevent_hook,
"SetWinEventHook with invalid tid should fail\n");
10974 ok(hwinevent_hook != 0,
"SetWinEventHook error %d\n",
GetLastError());
10976 ret = pUnhookWinEvent(hwinevent_hook);
10983 hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0,
win_event_proc,
10985 ok(hwinevent_hook != 0,
"SetWinEventHook error %d\n",
GetLastError());
10987 ret = pUnhookWinEvent(hwinevent_hook);
10992 ok(!pUnhookWinEvent((
HWINEVENTHOOK)0xdeadbeef),
"UnhookWinEvent succeeded\n");
11013 ok(
b,
"PeekMessage failed\n");
11026 hook_hwnd =
CreateWindowA(
"Static",
NULL,
WS_POPUP, 0, 0, 200, 60,
NULL,
NULL,
NULL,
NULL);
11041 ok(
b,
"UnhokWindowsHookEx failed\n");
11072 100, 100, 200, 200, 0, 0, 0,
NULL);
11073 ok (
hwnd != 0,
"Failed to create overlapped window\n");
11076 10, 10, 150, 150,
hwnd, 0, 0,
NULL);
11077 ok (hchild != 0,
"Failed to create child\n");
11083 trace(
"start scroll\n");
11087 trace(
"end scroll\n");
11095 trace(
"start scroll\n");
11098 trace(
"end scroll\n");
11106 trace(
"start scroll\n");
11112 trace(
"end scroll\n");
11120 trace(
"start scroll with ScrollWindow\n");
11122 trace(
"end scroll\n");
11161 100, 100, 200, 200, 0, 0, 0,
NULL);
11170 0, 0, 50, 50, child1, (
HMENU)child_id++, 0,
NULL);
11225 ok(
test == child1,
"wrong parent %p\n",
test);
11229 ok(
test == child1,
"wrong parent %p\n",
test);
11247 trace(
"parent %p, child1 %p, child2 %p, child3 %p, child4 %p\n",
11248 parent, child1, child2, child3, child4);
11252 ok(
test == child4,
"wrong capture window %p\n",
test);
11261 ok(!
IsWindow(child1),
"child1 still exists\n");
11262 ok(!
IsWindow(child2),
"child2 still exists\n");
11263 ok(!
IsWindow(child3),
"child3 still exists\n");
11264 ok(!
IsWindow(child4),
"child4 still exists\n");
11267 ok(!
test,
"wrong capture window %p\n",
test);
11291 100, 100, 200, 200, 0, 0, 0,
NULL);
11311 if (++
count > 10)
break;
11316 trace(
"now without DispatchMessage\n");
11333 ok( !
count,
"Got multiple WM_PAINTs\n" );
11334 if (++
count > 10)
break;
11350 ok( !
hdc,
"got valid hdc %p from BeginPaint\n",
hdc );
11353 ok( !
count,
"Got multiple WM_PAINTs\n" );
11354 if (++
count > 10)
break;
11407 100, 100, 200, 200, 0, 0, 0,
NULL);
11411 info.timeout = 1000;
11412 info.ret = 0xdeadbeef;
11416 ok(
info.ret == 1,
"SendMessageTimeout failed\n" );
11420 info.ret = 0xdeadbeef;
11425 ok(
info.ret == 0,
"SendMessageTimeout succeeded\n" );
11430 info.ret = 0xdeadbeef;
11440 info.timeout = 0x7fffffff;
11441 info.ret = 0xdeadbeef;
11446 ok(
info.ret == 1,
"SendMessageTimeout failed\n" );
11449 info.timeout = 0x80000000;
11450 info.ret = 0xdeadbeef;
11457 ok(
info.ret == 1,
"SendMessageTimeout failed\n" );
11462 ok(
info.ret == 0,
"SendMessageTimeout succeeded\n" );
11468 info.timeout = 100;
11469 info.ret = 0xdeadbeef;
11474 ok(
info.ret == 0,
"SendMessageTimeout failed\n" );
11482#define ID_EDIT 0x1234
11602 static LONG defwndproc_counter = 0;
11614 msg.descr =
"edit";
11617 defwndproc_counter++;
11619 defwndproc_counter--;
11648 100, 100, 200, 200, 0, 0, 0,
NULL);
11649 ok (
parent != 0,
"Failed to create parent window\n");
11654 ok(
hwnd != 0,
"Failed to create edit window\n");
11696 ok(
hwnd != 0,
"Failed to create edit window\n");
11700 "wrong dlg_code %08x\n", dlg_code);
11761#define EV_SENDMSG 1
11775 trace(
"thread: looping\n");
11785 trace(
"thread: exiting\n");
11789 trace(
"thread: sending message\n");
11796 trace(
"unexpected return: %04x\n",
ret);
11815 100, 100, 200, 200, 0, 0, 0,
NULL);
11835 trace(
"QS_RAWINPUT not supported on this platform\n");
11836 qs_all_input &= ~QS_RAWINPUT;
11837 qs_input &= ~QS_RAWINPUT;
11844 ok(qstatus == 0,
"wrong qstatus %08x\n", qstatus);
11846 trace(
"signalling to send message\n");
11853 ok(qstatus == 0 ||
broken(qstatus) ,
"GetQueueStatus should fail: %08x\n", qstatus);
11859 qstatus &= ~MAKELONG( 0x4000, 0x4000 );
11861 "wrong qstatus %08x\n", qstatus);
11866 "PeekMessageA should have returned FALSE instead of msg %04x\n",
11871 ok(qstatus == 0,
"wrong qstatus %08x\n", qstatus);
11878 skip(
"queuing key events not supported\n" );
11884 "wrong qstatus %08x\n", qstatus);
11890 "wrong qstatus %08x\n", qstatus);
11896 "wrong qstatus %08x\n", qstatus);
11898 trace(
"signalling to send message\n");
11904 "wrong qstatus %08x\n", qstatus);
11910 win_skip(
"PM_QS_* flags not supported in PeekMessage\n" );
11914 "PeekMessageA should have returned FALSE instead of msg %04x\n",
11918 win_skip(
"PM_QS_* flags not supported in PeekMessage\n" );
11925 "wrong qstatus %08x\n", qstatus);
11927 trace(
"signalling to send message\n");
11933 "wrong qstatus %08x\n", qstatus);
11938 "PeekMessageA should have returned FALSE instead of msg %04x\n",
11944 "wrong qstatus %08x\n", qstatus);
11949 "got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
11955 "wrong qstatus %08x\n", qstatus);
11960 "PeekMessageA should have returned FALSE instead of msg %04x\n",
11966 "wrong qstatus %08x\n", qstatus);
11971 "got %d and %04x instead of TRUE and WM_PAINT\n",
ret,
msg.message);
11977 "wrong qstatus %08x\n", qstatus);
11982 "PeekMessageA should have returned FALSE instead of msg %04x\n",
11988 "wrong qstatus %08x\n", qstatus);
11990 trace(
"signalling to send message\n");
11996 "wrong qstatus %08x\n", qstatus);
12002 "wrong qstatus %08x\n", qstatus);
12007 "got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
12013 "wrong qstatus %08x\n", qstatus);
12018 "PeekMessageA should have returned FALSE instead of msg %04x\n",
12024 "wrong qstatus %08x\n", qstatus);
12030 "wrong qstatus %08x\n", qstatus);
12032 trace(
"signalling to send message\n");
12038 "wrong qstatus %08x\n", qstatus);
12043 "PeekMessageA should have returned FALSE instead of msg %04x\n",
12049 "wrong qstatus %08x\n", qstatus);
12052 if (qs_all_input & QS_RAWINPUT)
12057 "got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
12063 "wrong qstatus %08x\n", qstatus);
12066 if (qs_all_input & QS_RAWINPUT)
12071 "got %d and %04x wParam %08lx instead of TRUE and WM_KEYUP wParam 'N'\n",
12077 "wrong qstatus %08x\n", qstatus);
12082 "PeekMessageA should have returned FALSE instead of msg %04x\n",
12088 "wrong qstatus %08x\n", qstatus);
12093 "got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
12099 "wrong qstatus %08x\n", qstatus);
12104 "PeekMessageA should have returned FALSE instead of msg %04x\n",
12110 "wrong qstatus %08x\n", qstatus);
12119 "wrong qstatus %08x\n", qstatus);
12125 "wrong qstatus %08x\n", qstatus);
12130 "got %d and %04x instead of TRUE and WM_USER\n",
ret,
msg.message);
12135 "wrong qstatus %08x\n", qstatus);
12140 "got %d and %04x instead of TRUE and WM_QUIT\n",
ret,
msg.message);
12141 ok(
msg.wParam == 0x1234abcd,
"got wParam %08lx instead of 0x1234abcd\n",
msg.wParam);
12142 ok(
msg.lParam == 0,
"got lParam %08lx instead of 0\n",
msg.lParam);
12148 "wrong qstatus %08x\n", qstatus);
12154 "PeekMessageA should have returned FALSE instead of msg %04x\n",
12160 "wrong qstatus %08x\n", qstatus);
12176 "got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
12186 "got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
12190 ok(qstatus == 0,
"wrong qstatus %08x\n", qstatus);
12201 if (qstatus & (
QS_KEY << 16))
12205 "got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
12216 "got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
12219 ok(qstatus == 0,
"wrong qstatus %08x\n", qstatus);
12230 trace(
"signalling to send message\n");
12235 "wrong qstatus %08x\n", qstatus);
12237 if (qstatus & (
QS_KEY << 16))
12241 "got %d and %04x wParam %08lx instead of TRUE and WM_KEYDOWN wParam 'N'\n",
12252 "got %d and %04x wParam %08lx instead of TRUE and WM_CHAR wParam 'z'\n",
12255 ok(qstatus == 0,
"wrong qstatus %08x\n", qstatus);
12283 trace(
"signalling to exit\n");
12318 DWORD time1, time2, time3;
12322 time1 = time2 = time3 = 0;
12329 trace(
"Window for test_PeekMessage2 %p\n",
hwnd);
12346 skip(
"queuing mouse events not supported\n" );
12351 trace(
"1st move event: %04x %x %d %d\n",
msg.message,
msg.time,
msg.pt.x,
msg.pt.y);
12369 ok(
ret,
"no message available\n");
12371 trace(
"2nd move event: %04x %x %d %d\n",
msg.message,
msg.time,
msg.pt.x,
msg.pt.y);
12377 ok(time2 > time1,
"message time not advanced: %x %x\n", time1, time2);
12387 ok(
ret,
"no message available\n");
12389 trace(
"3rd move event: %04x %x %d %d\n",
msg.message,
msg.time,
msg.pt.x,
msg.pt.y);
12395 ok(time3 > time2,
"message time not advanced: %x %x\n", time2, time3);
12396 ok(x3 !=
x2 && y3 !=
y2,
"coords not changed: (%d %d) (%d %d)\n",
x2,
y2, x3, y3);
12413 ok(
hwnd !=
NULL,
"expected hwnd != NULL\n");
12421 ok(
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12424 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12426 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12428 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12430 ok(!
ret,
"expected PeekMessage to return FALSE, got %u\n",
ret);
12434 ok(
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12437 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12439 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12441 ok(!
ret,
"expected PeekMessage to return FALSE, got %u\n",
ret);
12447 ok(
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12450 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12452 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12454 ok(!
ret,
"expected PeekMessage to return FALSE, got %u\n",
ret);
12461 ok(
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12463 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12465 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12467 ok(!
ret,
"expected PeekMessage to return FALSE, got %u\n",
ret);
12474 ok(
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12477 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12479 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12481 ok(
ret &&
msg.message ==
WM_USER + 1,
"msg.message = %u instead of WM_USER + 1\n",
msg.message);
12483 ok(!
ret,
"expected PeekMessage to return FALSE, got %u\n",
ret);
12489 ok(
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12493 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12495 ok(
ret &&
msg.message ==
WM_USER + 1,
"msg.message = %u instead of WM_USER + 1\n",
msg.message);
12497 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12499 ok(
ret &&
msg.message ==
WM_USER + 1,
"msg.message = %u instead of WM_USER + 1\n",
msg.message);
12501 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12503 ok(!
ret,
"expected PeekMessage to return FALSE, got %u\n",
ret);
12510 ok(
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12513 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12515 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12517 ok(!
ret,
"expected PeekMessage to return FALSE, got %u\n",
ret);
12522 ok(
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12524 ok(
ret &&
msg.message ==
WM_USER,
"msg.message = %u instead of WM_USER\n",
msg.message);
12526 ok(
ret &&
msg.message ==
WM_TIMER,
"msg.message = %u instead of WM_TIMER\n",
msg.message);
12528 ok(!
ret,
"expected PeekMessage to return FALSE, got %u\n",
ret);
12545 msg.descr =
"dialog";
12596 ok(!
ret,
"got %x message\n",
msg.message);
12600 ok(
msg.message ==
WM_QUIT,
"Received message 0x%04x instead of WM_QUIT\n",
msg.message);
12601 ok(
msg.wParam == 0xbeef,
"wParam was 0x%lx instead of 0xbeef\n",
msg.wParam);
12608 ok(
msg.message ==
WM_USER,
"Received message 0x%04x instead of WM_USER\n",
msg.message);
12613 ok(
msg.message ==
WM_QUIT,
"Received message 0x%04x instead of WM_QUIT\n",
msg.message);
12614 ok(
msg.wParam == 0xbeef,
"wParam was 0x%lx instead of 0xbeef\n",
msg.wParam);
12624 ok(
msg.message ==
WM_QUIT,
"Received message 0x%04x instead of WM_QUIT\n",
msg.message);
12625 ok(
msg.wParam == 0xdead,
"wParam was 0x%lx instead of 0xdead\n",
msg.wParam);
12633 ok(
msg.message ==
WM_QUIT,
"Received message 0x%04x instead of WM_QUIT\n",
msg.message);
12634 ok(
msg.wParam == 0xdead,
"wParam was 0x%lx instead of 0xdead\n",
msg.wParam);
12638 ok(
msg.message ==
WM_USER,
"Received message 0x%04x instead of WM_USER\n",
msg.message);
12643 ok(
ret == 1,
"expected 1, got %d\n",
ret);