90#define MAXKEYEVENTS 12
91#define MAXKEYMESSAGES MAXKEYEVENTS
95static const char *
MSGNAME[]={
"WM_KEYDOWN",
"WM_KEYUP",
"WM_CHAR",
"WM_DEADCHAR",
96 "WM_SYSKEYDOWN",
"WM_SYSKEYUP",
"WM_SYSCHAR",
"WM_SYSDEADCHAR" ,
"WM_KEYLAST"};
104static const int GETSCAN[]={0, 0x38, 0x38, 0x2D, 0x2D, 0x2A, 0x2A, 0x1D, 0x1D };
108static const char *
getdesc[]={
"",
"+alt",
"-alt",
"+X",
"-X",
"+shift",
"-shift",
"+ctrl",
"-ctrl"};
156#define GET_PROC(func) \
157 if (!(p ## func = (void*)GetProcAddress(hdll, #func))) \
158 trace("GetProcAddress(%s) failed\n", #func)
160 GET_PROC(GetCurrentInputMessageSource);
211 if( pwParam) *pwParam = VKey;
255 ok(
ret == evtctr,
"SendInput failed to send some events\n");
258 trace(
"======== key stroke sequence #%d: %s =============\n",
262 trace(
"message[%d] %-15s wParam %04lx lParam %08lx time %x\n",
i,
268 "%u/%u: wrong message %x/%08lx/%08lx expected %s/%08lx/%08lx\n",
269 seqnr,
i,
msg.message,
msg.wParam,
msg.lParam,
275 trace(
"%d messages retrieved\n",
i);
278 skip(
"simulated keyboard input doesn't work\n" );
281 ok(
i == kmctr,
"message count is wrong: got %d expected: %d\n",
i, kmctr);
298 kbuf[1] = kevdwn[1-
i];
300 kbuf[3] = kevup[1-
j];
311 if(
k==
i ||
k==
j)
continue;
316 if(
n==
l ||
n==
m)
continue;
398 int min_timeout = 50;
407 ok(
msg.time != 0,
"message %#x has time set to 0\n",
msg.message);
453 {
'F', 0,
FALSE, {{
'F', 0x00}, {0}},
466 {
'O', 0,
FALSE, {{
'O', 0x00}, {0}},
479 {
'X', 0,
FALSE, {{
'X', 0x00}, {0}},
492 {
'A', 0,
FALSE, {{
'A', 0x00}, {0}},
613 {{
VK_MENU, 0x00}, {
VK_LMENU, 0x00}, {
VK_CONTROL, 0x00, 1}, {
VK_LCONTROL, 0x01, 1}, {0}},
619 {{
VK_MENU, 0x80}, {
VK_LMENU, 0x80}, {
VK_CONTROL, 0x81, 1}, {
VK_LCONTROL, 0x80, 1}, {0}},
639 {{
VK_MENU, 0x00}, {
VK_RMENU, 0x00}, {
VK_CONTROL, 0x00, 1}, {
VK_LCONTROL, 0x01, 1}, {0}},
645 {{
VK_MENU, 0x80}, {
VK_RMENU, 0x80}, {
VK_CONTROL, 0x81, 1}, {
VK_LCONTROL, 0x80, 1}, {0}},
665 {{
VK_MENU, 0x00}, {
VK_RMENU, 0x00}, {
VK_CONTROL, 0x00, 1}, {
VK_LCONTROL, 0x01, 1}, {0}},
670 {{
VK_MENU, 0x80}, {
VK_RMENU, 0x80}, {
VK_CONTROL, 0x81, 1}, {
VK_LCONTROL, 0x80, 1}, {0}},
705 int i, failcount = 0;
710 while (
t->wVk && foreground) {
713 BOOL matched = ((ks1[
t->wVk]&0x80) == (
t->before_state&0x80)
714 && (ks2[
t->wVk]&0x80) == (~
t->before_state&0x80));
716 if (!matched && !
t->optional &&
test->_todo_wine)
720 ok(matched,
"%2d (%x/%x): %02x from %02x -> %02x "
721 "instead of %02x -> %02x\n",
id,
test->wVk,
test->dwFlags,
722 t->wVk, ks1[
t->wVk]&0x80, ks2[
t->wVk]&0x80,
t->before_state,
723 ~
t->before_state&0x80);
726 ok(matched ||
t->optional,
"%2d (%x/%x): %02x from %02x -> %02x "
727 "instead of %02x -> %02x\n",
id,
test->wVk,
test->dwFlags,
728 t->wVk, ks1[
t->wVk]&0x80, ks2[
t->wVk]&0x80,
t->before_state,
729 ~
t->before_state&0x80);
731 ks2[
t->wVk] = ks1[
t->wVk];
734 for (
i = 0;
i < 256;
i++)
735 if (ks2[
i] != ks1[
i] &&
test->_todo_wine)
739 ok(
FALSE,
"%2d (%x/%x): %02x from %02x -> %02x unexpected\n",
743 ok(ks2[
i] == ks1[
i],
"%2d (%x/%x): %02x from %02x -> %02x unexpected\n",
763 ok(
FALSE,
"%2d (%x/%x): in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
768 "%2d (%x/%x): in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
777 ok(
FALSE,
"%2d (%x/%x): in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
782 "%2d (%x/%x): in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
786 "%2d (%x/%x): the msg 0x%04x should have been sent by a hook\n",
808 "%2d (%x/%x): the msg 0x%04x should have been sent by a hook\n",
818 "%2d (%x/%x): the msg 0x%04x was expected, but got msg 0x%04x instead\n",
821 else if (
test->_todo_wine)
826 "%2d (%x/%x): the msg 0x%04x was expected, but got msg 0x%04x instead\n",
831 "%2d (%x/%x): the msg 0x%04x was expected, but got msg 0x%04x instead\n",
844 if (
test->_todo_wine)
848 ok(
FALSE,
"%2d (%x/%x): the msg sequence is not complete: expected %04x - actual %04x\n",
852 ok(
FALSE,
"%2d (%x/%x): the msg sequence is not complete: expected %04x - actual %04x\n",
856 if(
test->_todo_wine && !failcount)
858 ok(
TRUE,
"%2d (%x/%x): marked \"todo_wine\" but succeeds\n",
id,
test->wVk,
test->dwFlags);
907 trace(
"Hook: w=%lx vk:%8x sc:%8x fl:%8x %lx\n",
wparam,
916 BYTE ks1[256], ks2[256];
924 skip(
"Skipping Input_blackbox test on non-US keyboard\n");
934 skip(
"Failed to set foreground window; some tests will be skipped.\n");
939 win_skip(
"WH_KEYBOARD_LL is not supported\n");
952 i.u.ki.dwExtraInfo = 0;
956 i.u.ki.wScan = ii+1 ;
1012 "Last keydown msg should have been VK_PACKET[0x%04x] (was: 0x%x)\n", VK_PACKET,
key_status.last_key_down);
1014 "Last char msg wparam should have been 0x3c0 (was: 0x%x)\n",
key_status.last_char);
1017 "Last hookdown msg should have been 0x3c0, was: 0x%x\n",
key_status.last_hook_down);
1034 "Last keyup msg should have been VK_PACKET[0x%04x] (was: 0x%x)\n", VK_PACKET,
key_status.last_key_up);
1037 "Last hookup msg should have been 0x3c0, was: 0x%x\n",
key_status.last_hook_up);
1060 "Last syskeydown msg should have been VK_PACKET[0x%04x] (was: 0x%x)\n", VK_PACKET,
key_status.last_syskey_down);
1062 "Last syschar msg should have been 0x3041 (was: 0x%x)\n",
key_status.last_syschar);
1065 "Last hooksysdown msg should have been 0x3041, was: 0x%x\n",
key_status.last_hook_syskey_down);
1087 "Last keyup msg should have been VK_PACKET[0x%04x] (was: 0x%x)\n", VK_PACKET,
key_status.last_key_up);
1090 "Last hook up msg should have been 0x3041, was: 0x%x\n",
key_status.last_hook_up);
1094 inputs[0].
u.
ki.
wVk = 0x51;
1098 inputs[1].
u.
ki.
wVk = 0x51;
1152 win_skip(
"SendInput doesn't support unicode on this platform\n");
1181 WCHAR classNameW[] = {
'I',
'n',
'p',
'u',
't',
'U',
'n',
'i',
'c',
'o',
'd',
'e',
1182 'K',
'e',
'y',
'T',
'e',
's',
't',
'C',
'l',
'a',
's',
's',0};
1183 WCHAR windowNameW[] = {
'I',
'n',
'p',
'u',
't',
'U',
'n',
'i',
'c',
'o',
'd',
'e',
1184 'K',
'e',
'y',
'T',
'e',
's',
't',0};
1203 win_skip(
"Unicode functions not supported\n");
1209 pImmDisableIME = (
void *)
GetProcAddress(hModuleImm32,
"ImmDisableIME");
1213 pImmDisableIME =
NULL;
1226 win_skip(
"unable to set WH_KEYBOARD_LL hook\n");
1250 for (
i = 0;
i < 512;
i++)
1254 ok(
len || !
buff[0],
"%d: Buffer is not zeroed\n",
i);
1283 ok(pt1.
x ==
pt.x && pt1.
y ==
pt.y,
"Wrong set pos: (%d,%d)\n", pt1.
x, pt1.
y);
1335 win_skip(
"cannot set MOUSE_LL hook\n" );
1354 SetRect(&rc, 50, 50, 151, 151);
1396 SetRect(&rc, 150, 150, 150, 150);
1426 SetRect(&rc, 150, 150, 150, 150);
1433 SetRect(&rc, 150, 150, 150, 150);
1441 SetRect(&rc, 150, 150, 150, 150);
1458#define MYERROR 0xdeadbeef
1461 MOUSEMOVEPOINT
out[200];
1469 memset(&
in, 0,
sizeof(MOUSEMOVEPOINT));
1478 retval = pGetMouseMovePointsEx(0, &
in,
out,
BUFLIM, GMMP_USE_DISPLAY_POINTS);
1481 win_skip(
"GetMouseMovePointsEx broken on WinME\n" );
1484 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1486 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1489 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT)-1, &
in,
out,
BUFLIM, GMMP_USE_DISPLAY_POINTS);
1490 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1492 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1495 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT)+1, &
in,
out,
BUFLIM, GMMP_USE_DISPLAY_POINTS);
1496 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1498 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1503 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT),
NULL,
out,
BUFLIM, GMMP_USE_DISPLAY_POINTS);
1504 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1506 "expected error ERROR_NOACCESS, got %u\n",
GetLastError());
1509 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &
in,
NULL,
BUFLIM, GMMP_USE_DISPLAY_POINTS);
1510 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1512 "expected error ERROR_NOACCESS, got %u\n",
GetLastError());
1515 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT),
NULL,
NULL,
BUFLIM, GMMP_USE_DISPLAY_POINTS);
1516 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1518 "expected error ERROR_NOACCESS, got %u\n",
GetLastError());
1522 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &
in,
NULL,
count, GMMP_USE_DISPLAY_POINTS);
1526 ok(retval ==
count,
"expected GetMouseMovePointsEx to succeed, got %d\n", retval);
1533 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &
in,
out,
count, GMMP_USE_DISPLAY_POINTS);
1534 ok(retval ==
count,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1536 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1540 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &
in,
out,
count, GMMP_USE_DISPLAY_POINTS);
1544 ok(retval ==
count,
"expected GetMouseMovePointsEx to succeed, got %d\n", retval);
1548 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &
in,
out,
count, GMMP_USE_DISPLAY_POINTS);
1552 ok((0 <= retval) && (retval <=
count),
"expected GetMouseMovePointsEx to succeed, got %d\n", retval);
1555 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &
in,
out,
BUFLIM+1, GMMP_USE_DISPLAY_POINTS);
1556 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1558 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1564 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT)-1,
NULL,
out,
BUFLIM, GMMP_USE_DISPLAY_POINTS);
1565 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1567 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1570 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT)-1, &
in,
NULL,
BUFLIM, GMMP_USE_DISPLAY_POINTS);
1571 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1573 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1576 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT),
NULL,
out,
BUFLIM+1, GMMP_USE_DISPLAY_POINTS);
1577 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1579 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1582 retval = pGetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &
in,
NULL,
BUFLIM+1, GMMP_USE_DISPLAY_POINTS);
1583 ok(retval == -1,
"expected GetMouseMovePointsEx to fail, got %d\n", retval);
1585 "expected error ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1593 RAWINPUTDEVICELIST
devices[32];
1594 UINT ret, oret, devcount, odevcount,
i;
1600 ok(
ret == -1,
"expected -1, got %d\n",
ret);
1606 ok(
ret == -1,
"expected -1, got %d\n",
ret);
1610 ret = pGetRawInputDeviceList(
NULL, &devcount,
sizeof(
devices[0]));
1611 ok(
ret == 0,
"expected 0, got %d\n",
ret);
1612 ok(devcount > 0,
"expected non-zero\n");
1618 ok(
ret == -1,
"expected -1, got %d\n",
ret);
1620 ok(devcount > 0,
"expected non-zero\n");
1624 ok(
ret > 0,
"expected non-zero\n");
1626 for(
i = 0;
i < devcount; ++
i)
1631 RID_DEVICE_INFO
info;
1637 ret = pGetRawInputDeviceInfoW(
devices[
i].hDevice, RIDI_DEVICENAME,
name, &sz);
1638 ok(
ret == -1,
"GetRawInputDeviceInfo gave wrong failure: %d\n",
err);
1639 ok(sz > 5 && sz <
ARRAY_SIZE(
name),
"Size should have been set and not too large (got: %u)\n", sz);
1642 ret = pGetRawInputDeviceInfoW(
devices[
i].hDevice, RIDI_DEVICENAME,
name, &sz);
1643 ok(
ret == sz,
"GetRawInputDeviceInfo gave wrong return: %d\n",
err);
1645 ok(
len + 1 ==
ret,
"GetRawInputDeviceInfo returned wrong length (name: %u, ret: %u)\n",
len + 1,
ret);
1648 ret = pGetRawInputDeviceInfoA(
devices[
i].hDevice, RIDI_DEVICENAME, nameA, &sz);
1649 ok(
ret == sz,
"GetRawInputDeviceInfoA gave wrong return: %d\n",
err);
1651 ok(
len + 1 ==
ret,
"GetRawInputDeviceInfoA returned wrong length (name: %u, ret: %u)\n",
len + 1,
ret);
1656 sz =
sizeof(
info) - 1;
1657 ret = pGetRawInputDeviceInfoW(
devices[
i].hDevice, RIDI_DEVICEINFO, &
info, &sz);
1658 ok(
ret == -1,
"GetRawInputDeviceInfo gave wrong failure: %d\n",
err);
1659 ok(sz ==
sizeof(
info),
"GetRawInputDeviceInfo set wrong size\n");
1661 ret = pGetRawInputDeviceInfoW(
devices[
i].hDevice, RIDI_DEVICEINFO, &
info, &sz);
1662 ok(
ret ==
sizeof(
info),
"GetRawInputDeviceInfo gave wrong return: %d\n",
err);
1663 ok(sz ==
sizeof(
info),
"GetRawInputDeviceInfo set wrong size\n");
1664 ok(
info.dwType ==
devices[
i].dwType,
"GetRawInputDeviceInfo set wrong type: 0x%x\n",
info.dwType);
1668 ret = pGetRawInputDeviceInfoA(
devices[
i].hDevice, RIDI_DEVICEINFO, &
info, &sz);
1669 ok(
ret ==
sizeof(
info),
"GetRawInputDeviceInfo gave wrong return: %d\n",
err);
1670 ok(sz ==
sizeof(
info),
"GetRawInputDeviceInfo set wrong size\n");
1671 ok(
info.dwType ==
devices[
i].dwType,
"GetRawInputDeviceInfo set wrong type: 0x%x\n",
info.dwType);
1685 ok(
ret > 0,
"expected non-zero\n");
1686 ok(devcount == odevcount,
"expected %d, got %d\n", devcount, odevcount);
1687 devcount = odevcount;
1689 ret = pGetRawInputDeviceList(
NULL, &odevcount,
sizeof(
devices[0]));
1690 ok(
ret == 0,
"expected 0, got %d\n",
ret);
1691 ok(odevcount == oret,
"expected %d, got %d\n", oret, odevcount);
1701 ok(
ret == ~0
U,
"Expect ret %u, got %u\n", ~0
U,
ret);
1709 static const UINT numpad_collisions[][2] = {
1722 ok(
s != 0,
"MapVirtualKeyEx(VK_SHIFT) should return non-zero\n");
1725 "%x != %x\n",
s, sL);
1728 ok(kL ==
VK_SHIFT,
"Scan code -> vKey = %x (not VK_SHIFT)\n", kL);
1730 ok(kR ==
VK_SHIFT,
"Scan code -> vKey = %x (not VK_SHIFT)\n", kR);
1734 "Scan code -> vKey = %x (not VK_LSHIFT)\n", kL);
1737 "Scan code -> vKey = %x (not VK_RSHIFT)\n", kR);
1746 if (numpad_scan && other_scan == numpad_scan)
1749 ok(vkey != numpad_collisions[
i][0],
1750 "Got numpad vKey %x for scan code %x when there was another choice\n",
1768 {
'A', 0, 0, 1, {
'a',0}},
1769 {
'A',
ctrl, 0, 1, {1, 0}},
1775 {
'4',
ctrl, 0, 0, {0}},
1777 { 0,
ctrl,
'!', 0, {0}},
1778 { 0,
ctrl,
'\"', 0, {0}},
1779 { 0,
ctrl,
'#', 0, {0}},
1780 { 0,
ctrl,
'$', 0, {0}},
1781 { 0,
ctrl,
'%', 0, {0}},
1782 { 0,
ctrl,
'\'', 0, {0}},
1783 { 0,
ctrl,
'(', 0, {0}},
1784 { 0,
ctrl,
')', 0, {0}},
1785 { 0,
ctrl,
'*', 0, {0}},
1786 { 0,
ctrl,
'+', 0, {0}},
1787 { 0,
ctrl,
',', 0, {0}},
1788 { 0,
ctrl,
'-', 0, {0}},
1789 { 0,
ctrl,
'.', 0, {0}},
1790 { 0,
ctrl,
'/', 0, {0}},
1791 { 0,
ctrl,
':', 0, {0}},
1792 { 0,
ctrl,
';', 0, {0}},
1793 { 0,
ctrl,
'<', 0, {0}},
1794 { 0,
ctrl,
'=', 0, {0}},
1795 { 0,
ctrl,
'>', 0, {0}},
1796 { 0,
ctrl,
'?', 0, {0}},
1797 { 0,
ctrl,
'@', 1, {0}},
1798 { 0,
ctrl,
'[', 1, {0x1b}},
1799 { 0,
ctrl,
'\\', 1, {0x1c}},
1800 { 0,
ctrl,
']', 1, {0x1d}},
1801 { 0,
ctrl,
'^', 1, {0x1e}},
1802 { 0,
ctrl,
'_', 1, {0x1f}},
1803 { 0,
ctrl,
'`', 0, {0}},
1813 const BYTE SC_RETURN = 0x1c, SC_TAB = 0x0f, SC_A = 0x1e;
1814 const BYTE HIGHEST_BIT = 0x80;
1818 for(
i=0;
i<256;
i++)
1826 win_skip(
"ToUnicode is not implemented\n");
1830 ok(
ret == 1,
"ToUnicode for Return key didn't return 1 (was %i)\n",
ret);
1833 ok(wStr[0]==
'\r',
"ToUnicode for CTRL + Return was %i (expected 13)\n", wStr[0]);
1834 ok(wStr[1]==0 ||
broken(wStr[1]!=0) ,
1835 "ToUnicode didn't null-terminate the buffer when there was room.\n");
1846 if (!us_kbd)
continue;
1848 if (vk_ret == -1)
continue;
1851 if (vk_ret & 0x200)
mod |=
ctrl;
1869 ok(
ret == 0,
"ToUnicode with NULL keystate didn't return 0 (was %i)\n",
ret);
1871 ok(
ret == 0,
"ToUnicode with NULL keystate didn't return 0 (was %i)\n",
ret);
1873 ok(
ret == 0,
"ToUnicode with NULL keystate didn't return 0 (was %i)\n",
ret);
1875 ok(
ret == 0,
"ToUnicodeEx with NULL keystate didn't return 0 (was %i)\n",
ret);
1877 ok(
ret == 0,
"ToUnicodeEx with NULL keystate didn't return 0 (was %i)\n",
ret);
1879 ok(
ret == 0,
"ToUnicodeEx with NULL keystate didn't return 0 (was %i)\n",
ret);
1886 const BYTE SC_RETURN = 0x1c, SC_A = 0x1e;
1887 const BYTE HIGHEST_BIT = 0x80;
1894 ok(
ret == 1,
"ToAscii for Return key didn't return 1 (was %i)\n",
ret);
1895 ok(character ==
'\r',
"ToAscii for Return was %i (expected 13)\n", character);
1899 ok(
ret == 1,
"ToAscii for character 'A' didn't return 1 (was %i)\n",
ret);
1900 ok(character ==
'a',
"ToAscii for character 'A' was %i (expected %i)\n", character,
'a');
1906 ok(
ret == 1,
"ToAscii for CTRL + Return key didn't return 1 (was %i)\n",
ret);
1907 ok(character ==
'\n',
"ToAscii for CTRL + Return was %i (expected 10)\n", character);
1911 ok(
ret == 1,
"ToAscii for CTRL + character 'A' didn't return 1 (was %i)\n",
ret);
1912 ok(character == 1,
"ToAscii for CTRL + character 'A' was %i (expected 1)\n", character);
1917 ok(
ret == 0,
"ToAscii for CTRL + Shift + Return key didn't return 0 (was %i)\n",
ret);
1920 ok(
ret == 0,
"ToAscii for NULL keystate didn't return 0 (was %i)\n",
ret);
1922 ok(
ret == 0,
"ToAscii for NULL keystate didn't return 0 (was %i)\n",
ret);
1924 ok(
ret == 0,
"ToAsciiEx for NULL keystate didn't return 0 (was %i)\n",
ret);
1926 ok(
ret == 0,
"ToAsciiEx for NULL keystate didn't return 0 (was %i)\n",
ret);
1954 ok(!
strcmp(klid,
"00000409"),
"expected 00000409, got %s\n", klid);
1980 memset( bufferW, 0xcc,
sizeof(bufferW) );
1985 memset( bufferW, 0xcc,
sizeof(bufferW) );
1991 memset( bufferW, 0xcc,
sizeof(bufferW) );
1994 ok( bufferW[0] == 0xcccc,
"wrong string %s\n",
wine_dbgstr_w(bufferW) );
2013 ok(events_no == 2,
"SendInput returned %d\n", events_no);
2030 if (!
ret)
msg->message = 0;
2078 ok(
win != 0,
"CreateWindow failed\n");
2097 ok(hregion !=
NULL,
"CreateRectRgn failed\n");
2099 region_type =
GetRgnBox(hregion, region);
2100 ok(region_type ==
SIMPLEREGION,
"expected SIMPLEREGION, got %d\n", region_type);
2107 BOOL got_button_down, got_button_up;
2122 ok(!
ret,
"GetCursorPos succeed\n");
2127 ok(
ret,
"GetCursorPos failed\n");
2132 ok(button_win != 0,
"CreateWindow failed\n");
2136 if (
hwnd != button_win)
2138 skip(
"there's another window covering test window\n");
2145 got_button_down = got_button_up =
FALSE;
2152 got_button_down =
TRUE;
2156 got_button_up =
TRUE;
2160 ok(got_button_down,
"expected WM_LBUTTONDOWN message\n");
2161 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2166 ok(static_win != 0,
"CreateWindow failed\n");
2171 got_button_down = got_button_up =
FALSE;
2178 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2179 got_button_down =
TRUE;
2183 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2184 got_button_up =
TRUE;
2189 ok(got_button_down,
"expected WM_RBUTTONDOWN message\n");
2190 ok(got_button_up,
"expected WM_RBUTTONUP message\n");
2196 ok(static_win != 0,
"CreateWindow failed\n");
2201 got_button_down = got_button_up =
FALSE;
2208 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2209 got_button_down =
TRUE;
2213 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2214 got_button_up =
TRUE;
2219 ok(got_button_down,
"expected WM_LBUTTONDOWN message\n");
2220 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2231 got_button_down = got_button_up =
FALSE;
2239 got_button_down =
TRUE;
2241 got_button_up =
TRUE;
2247 ok(!got_button_down,
"unexpected WM_RBUTTONDOWN message\n");
2248 ok(!got_button_up,
"unexpected WM_RBUTTONUP message\n");
2255 got_button_down = got_button_up =
FALSE;
2258 "AttachThreadInput failed\n");
2267 got_button_down =
TRUE;
2269 got_button_up =
TRUE;
2274 ok(!got_button_down,
"unexpected WM_LBUTTONDOWN message\n");
2275 ok(!got_button_up,
"unexpected WM_LBUTTONUP message\n");
2280 ok(
hwnd != 0,
"CreateWindow failed\n");
2282 got_button_down = got_button_up =
FALSE;
2290 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2291 got_button_down =
TRUE;
2295 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2296 got_button_up =
TRUE;
2300 ok(got_button_down,
"expected WM_RBUTTONDOWN message\n");
2301 ok(got_button_up,
"expected WM_RBUTTONUP message\n");
2307 ok(
hwnd != 0,
"CreateWindow failed\n");
2308 got_button_down = got_button_up =
FALSE;
2316 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2317 got_button_down =
TRUE;
2321 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2322 got_button_up =
TRUE;
2326 ok(got_button_down,
"expected WM_LBUTTONDOWN message\n");
2327 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2354 ret = SetLayeredWindowAttributes(
hwnd, 0, 255, LWA_ALPHA);
2355 ok(
ret,
"SetLayeredWindowAttributes failed\n");
2359 if (pGetWindowRgnBox)
2361 region_type = pGetWindowRgnBox(
hwnd, ®ion);
2362 ok(region_type ==
ERROR,
"expected ERROR, got %d\n", region_type);
2367 "expected region (100,100)-(200,200), got %s\n",
wine_dbgstr_rect(®ion));
2370 "expected region (100,100)-(200,200), got %s\n",
wine_dbgstr_rect(®ion));
2373 "expected region (100,100)-(200,200), got %s\n",
wine_dbgstr_rect(®ion));
2376 "expected region (100,100)-(200,200), got %s\n",
wine_dbgstr_rect(®ion));
2379 "expected region (110,110)-(130,130), got %s\n",
wine_dbgstr_rect(®ion));
2382 "expected region (100,100)-(200,200), got %s\n",
wine_dbgstr_rect(®ion));
2384 got_button_down = got_button_up =
FALSE;
2393 got_button_down =
TRUE;
2398 got_button_up =
TRUE;
2402 ok(got_button_down,
"expected WM_LBUTTONDOWN message\n");
2403 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2405 ret = SetLayeredWindowAttributes(
hwnd, 0, 0, LWA_ALPHA);
2406 ok(
ret,
"SetLayeredWindowAttributes failed\n");
2410 if (pGetWindowRgnBox)
2412 region_type = pGetWindowRgnBox(
hwnd, ®ion);
2413 ok(region_type ==
ERROR,
"expected ERROR, got %d\n", region_type);
2416 got_button_down = got_button_up =
FALSE;
2424 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2425 got_button_down =
TRUE;
2429 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2430 got_button_up =
TRUE;
2434 ok(got_button_down ||
broken(!got_button_down),
"expected WM_LBUTTONDOWN message\n");
2435 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2437 ret = SetLayeredWindowAttributes(
hwnd,
RGB(0, 255, 0), 255, LWA_ALPHA | LWA_COLORKEY);
2438 ok(
ret,
"SetLayeredWindowAttributes failed\n");
2442 if (pGetWindowRgnBox)
2444 region_type = pGetWindowRgnBox(
hwnd, ®ion);
2445 ok(region_type ==
ERROR,
"expected ERROR, got %d\n", region_type);
2448 got_button_down = got_button_up =
FALSE;
2457 got_button_down =
TRUE;
2462 got_button_up =
TRUE;
2466 ok(got_button_down,
"expected WM_LBUTTONDOWN message\n");
2467 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2469 ret = SetLayeredWindowAttributes(
hwnd,
RGB(128, 128, 128), 0, LWA_COLORKEY);
2470 ok(
ret,
"SetLayeredWindowAttributes failed\n");
2474 if (pGetWindowRgnBox)
2476 region_type = pGetWindowRgnBox(
hwnd, ®ion);
2477 ok(region_type ==
ERROR,
"expected ERROR, got %d\n", region_type);
2480 got_button_down = got_button_up =
FALSE;
2489 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2490 got_button_down =
TRUE;
2495 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2496 got_button_up =
TRUE;
2500 ok(got_button_down,
"expected WM_LBUTTONDOWN message\n");
2501 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2507 if (pGetWindowRgnBox)
2509 region_type = pGetWindowRgnBox(
hwnd, ®ion);
2510 ok(region_type ==
ERROR,
"expected ERROR, got %d\n", region_type);
2513 got_button_down = got_button_up =
FALSE;
2522 got_button_down =
TRUE;
2527 got_button_up =
TRUE;
2531 ok(got_button_down,
"expected WM_LBUTTONDOWN message\n");
2532 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2535 ok(hregion !=
NULL,
"CreateRectRgn failed\n");
2537 ok(
ret,
"SetWindowRgn failed\n");
2542 if (pGetWindowRgnBox)
2544 region_type = pGetWindowRgnBox(
hwnd, ®ion);
2545 ok(region_type ==
SIMPLEREGION,
"expected SIMPLEREGION, got %d\n", region_type);
2548 got_button_down = got_button_up =
FALSE;
2556 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2557 got_button_down =
TRUE;
2561 ok(
msg.hwnd == button_win,
"msg.hwnd = %p\n",
msg.hwnd);
2562 got_button_up =
TRUE;
2566 ok(got_button_down,
"expected WM_LBUTTONDOWN message\n");
2567 ok(got_button_up,
"expected WM_LBUTTONUP message\n");
2609 "WaitForSingleObject failed\n");
2626 100, 100, 200, 200, 0, 0, 0,
NULL);
2662 cls.lpszMenuName =
NULL;
2663 cls.lpszClassName =
"TestWindowClass";
2673 win_skip(
"skipping interthread message test under win9x\n");
2684 0, 0, 0, 0, 0, 0, 0,
NULL);
2685 ok(ourWnd!= 0,
"failed to create ourWnd window\n");
2688 0, 0, 0, 0, 0, 0, 0,
NULL);
2689 ok(Wnd2!= 0,
"failed to create Wnd2 window\n");
2807 ok(!
ret,
"AttachThreadInput succeeded\n");
2809 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
2813 ok(!
ret,
"AttachThreadInput succeeded\n");
2815 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
2890 "expected that highest bit is set, got %x\n",
result);
2897 ok(!(
result & 0x8000),
"expected that highest bit is unset, got %x\n",
result);
2949 for (oem = 0; oem < 0x200; oem++)
2953 oem_char =
LOBYTE( oem );
2958 if (!
OemToCharBuffW( &oem_char, &wchr, 1 ) || (wchr ==
'?' && oem_char < 0))
2981 INPUT_MESSAGE_SOURCE
source;
2984 ok( pGetCurrentInputMessageSource( &
source ),
"GetCurrentInputMessageSource failed\n" );