32#define ID_EDITTESTDBUTTON 0x123
33#define ID_EDITTEST2 99
58 static int num_ok_commands = 0;
125 else if (hfocus == hedit2)
127 else if (hfocus == hedit3)
133 if ((hfocus == hedit) && (num_ok_commands == 0))
269 if ((hfocus == hok) &&
len == 0)
278 else if (hfocus == hcancel)
280 else if (hfocus == hedit)
392 if ((hfocus == hedit) &&
len == 0)
399 if ((hfocus == hok) &&
len == 0)
514 if ((hfocus == hedit) &&
len == 0)
521 if ((hfocus == hok) &&
len == 0)
528 if ((hfocus == hedit) &&
len == 2)
564 ok (
handle !=
NULL,
"CreateWindow EDIT Control failed\n");
573 static const WCHAR testtextW[] = {
'T',
'e',
's',
't',
' ',
't',
'e',
'x',
't',0};
590 ok(
b,
"AdjustWindowRect failed\n");
599 ok (parentWnd !=
NULL,
"CreateWindow EDIT Test failed\n");
607 ok (editWnd !=
NULL,
"CreateWindow EDIT Test Text failed\n");
618 trace(
"Edit control has no parent!\n");
648 RECT ClientRect, WindowRect;
672 "The client height should be %d, but is %d\n",
685 trace(
"EDIT: Single line\n");
689 for (
i = 0;
i < 65535;
i++)
691 msMessage.wParam =
i;
694 "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n",
r);
698 trace(
"EDIT: Single line want returns\n");
702 for (
i = 0;
i < 65535;
i++)
704 msMessage.wParam =
i;
707 "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n",
r);
711 trace(
"EDIT: Multiline line\n");
715 for (
i = 0;
i < 65535;
i++)
717 msMessage.wParam =
i;
720 "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n",
r);
724 trace(
"EDIT: Multi line want returns\n");
728 for (
i = 0;
i < 65535;
i++)
730 msMessage.wParam =
i;
733 "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n",
r);
747 char szLocalString[
MAXLEN];
765 trace(
"EDIT: SETTEXT atomicity\n");
768 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
770 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
772 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
776 "Wrong contents of edit: %s\n", szLocalString);
780 todo_wine ok(0 ==
r,
"SetCaretPos succeeded unexpectedly, expected: 0, got: %d\n",
r);
782 ok(phwnd !=
NULL,
"SetFocus failed unexpectedly, expected non-zero, got NULL\n");
784 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
786 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
787 ok(cpos.
x == 0 && cpos.
y == 0,
"Wrong caret position, expected: (0,0), got: (%d,%d)\n", cpos.
x, cpos.
y);
789 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
791 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
792 ok(cpos.
x == -1 && cpos.
y == -1,
"Wrong caret position, expected: (-1,-1), got: (%d,%d)\n", cpos.
x, cpos.
y);
794 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
796 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
797 ok(cpos.
x == (
w << 1) && cpos.
y == (
h << 1),
"Wrong caret position, expected: (%d,%d), got: (%d,%d)\n",
w << 1,
h << 1, cpos.
x, cpos.
y);
799 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
801 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
802 ok(cpos.
x ==
w && cpos.
y ==
h,
"Wrong caret position, expected: (%d,%d), got: (%d,%d)\n",
w,
h, cpos.
x, cpos.
y);
804 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
806 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
807 ok(cpos.
x == (
w - 1) && cpos.
y == (
h - 1),
"Wrong caret position, expected: (%d,%d), got: (%d,%d)\n",
w - 1,
h - 1, cpos.
x, cpos.
y);
815 char szLocalString[
MAXLEN];
818 if (!
strcmp(szLocalString,
"foo"))
820 strcpy(szLocalString,
"bar");
851#define test_notify(enchange, enmaxtext, enupdate) \
853 ok(notifications.en_change == enchange, "expected %d EN_CHANGE notifications, " \
854 "got %d\n", enchange, notifications.en_change); \
855 ok(notifications.en_maxtext == enmaxtext, "expected %d EN_MAXTEXT notifications, " \
856 "got %d\n", enmaxtext, notifications.en_maxtext); \
857 ok(notifications.en_update == enupdate, "expected %d EN_UPDATE notifications, " \
858 "got %d\n", enupdate, notifications.en_update); \
885 static LONG defwndproc_counter = 0;
907 defwndproc_counter++;
909 defwndproc_counter--;
917 static LONG defwndproc_counter = 0;
933 defwndproc_counter++;
938 defwndproc_counter--;
948 static const char *
str =
"this is a long string.";
949 static const char *str2 =
"this is a long string.\r\nthis is a long string.\r\nthis is a long string.\r\nthis is a long string.";
958 trace(
"EDIT: Test notifications\n");
966 ok(hParent !=
NULL,
"Failed to create control parent.\n");
968 trace(
"EDIT: Single line, no ES_AUTOHSCROLL\n");
969 hWnd =
CreateWindowExA(0,
WC_EDITA,
NULL, 0, 10, 10, 50, 50, hParent,
NULL,
NULL,
NULL);
970 ok(
hWnd !=
NULL,
"Failed to create Edit control.\n");
984 ok(1 ==
len,
"wrong text length, expected 1, got %d\n",
len);
1007 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1018 trace(
"EDIT: Single line, ES_AUTOHSCROLL\n");
1019 hWnd =
CreateWindowExA(0,
WC_EDITA,
NULL,
ES_AUTOHSCROLL, 10, 10, 50, 50, hParent,
NULL,
NULL,
NULL);
1020 ok(
hWnd !=
NULL,
"Failed to create Edit control.\n");
1038 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1044 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1053 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1064 trace(
"EDIT: Multline, no ES_AUTOHSCROLL, no ES_AUTOVSCROLL\n");
1066 10, 10, (50 *
dpi) / 96, (50 *
dpi) / 96,
1068 ok(
hWnd !=
NULL,
"Failed to create Edit control.\n");
1077 ok(0 ==
len,
"text should have been truncated, expected 0, got %d\n",
len);
1100 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1111 trace(
"EDIT: Multline, ES_AUTOHSCROLL, no ES_AUTOVSCROLL\n");
1113 10, 10, (50 *
dpi) / 96, (50 *
dpi) / 96,
1115 ok(
hWnd !=
NULL,
"Failed to create Edit control.\n");
1120 ok(0 ==
len,
"text should have been truncated, expected 0, got %d\n",
len);
1133 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1142 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1148 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1153 trace(
"EDIT: Multline, ES_AUTOHSCROLL and ES_AUTOVSCROLL\n");
1156 ok(
hWnd !=
NULL,
"Failed to create Edit control.\n");
1161 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1167 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1176 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1182 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1190 int lo, hi, mid,
ret,
i;
1199 mid = lo + (hi - lo) / 2;
1201 for (
i = lo;
i < mid;
i++)
1204 ok(0 ==
ret,
"expected 0 got %d\n",
ret);
1207 for (
i = mid;
i <= hi;
i++)
1210 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1214 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1221 mid = lo + (hi - lo) / 2;
1223 for (
i = lo;
i < mid;
i++)
1226 ok(0 ==
ret,
"expected 0 got %d\n",
ret);
1229 for (
i = mid;
i <= hi;
i++)
1232 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1236 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1243 mid = lo + (hi - lo) / 2;
1245 for (
i = lo;
i < mid;
i++)
1248 ok(0 ==
ret,
"expected 0 got %d\n",
ret);
1251 for (
i = mid;
i <= hi;
i++)
1254 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1258 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1265 mid = lo + (hi - lo) / 2 + 1;
1267 for (
i = lo;
i < mid;
i++)
1270 ok((0 ==
ret || 1 ==
ret ),
"expected 0 or 1 got %d\n",
ret);
1273 for (
i = mid;
i <= hi;
i++)
1276 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1280 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1287 mid = lo + (hi - lo) / 2 + 1;
1289 for (
i = lo;
i < mid;
i++)
1292 ok((0 ==
ret || 1 ==
ret ),
"expected 0 or 1 got %d\n",
ret);
1295 for (
i = mid;
i <= hi;
i++)
1298 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1302 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1309 mid = lo + (hi - lo) / 2 + 1;
1311 for (
i = lo;
i < mid;
i++)
1314 ok((0 ==
ret || 1 ==
ret ),
"expected 0 or 1 got %d\n",
ret);
1317 for (
i = mid;
i <= hi;
i++)
1320 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1324 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1341 ok(
ret == lo,
"Unexpected position %d vs %d.\n", lo,
ret);
1351 static const char *
str =
"test\r\ntest";
1355 RECT rc1 = { 10, 10, 11, 11};
1359 hWnd =
CreateWindowExA(0,
WC_EDITA,
str, 0, 10, 10, 1, 1,
NULL,
NULL,
NULL,
NULL);
1360 ok(
hWnd !=
NULL,
"Failed to create Edit control.\n");
1364 ok( rc.
right - rc.
left > 20,
"size of the window (%d) is smaller than expected\n",
1375 ok(parentWnd !=
NULL,
"Failed to create control parent.\n");
1381 ok(
hWnd !=
NULL,
"Failed to create Edit control.\n");
1392 ok(
hWnd !=
NULL,
"Failed to create Edit control.\n");
1407 static const char *
str =
"test\r\ntest";
1412 hWnd =
CreateWindowExA(0,
"EDIT",
"Test", 0, 10, 10, 1, 1,
NULL,
NULL,
hinst,
NULL);
1413 ok(
hWnd !=
NULL,
"Failed to create edit control.\n");
1424 ok(
ret == 1,
"Unexpected return value %d\n",
ret);
1431 ok(
ret == 0,
"Expected 0, got %d\n",
ret);
1446 trace(
"EDIT: buffer limit for single-line\n");
1449 ok(
r == 30000,
"Incorrect default text limit, expected 30000 got %u\n",
r);
1452 ok(
r == 2147483646,
"got limit %u (expected 2147483646)\n",
r);
1456 trace(
"EDIT: buffer limit for multi-line\n");
1459 ok(
r == 30000,
"Incorrect default text limit, expected 30000 got %u\n",
r);
1462 ok(
r == 4294967295U,
"got limit %u (expected 4294967295)\n",
r);
1469 static const char *single_line_str =
"a";
1470 static const char *multiline_str =
"Test\r\nText";
1479 ok(hwEdit !=
NULL,
"Failed to create Edit control.\n");
1482 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1485 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1488 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1491 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1500 ok(hwEdit !=
NULL,
"Failed to create Edit control.\n");
1503 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1514 case 932:
case 936:
case 949:
case 950:
case 1361:
1518 (
fs.fsCsb[0] & FS_DBCS_MASK));
1534 memset(&lf, 0,
sizeof(lf));
1544 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, 5000, 1000,
NULL,
NULL,
NULL,
NULL);
1573 empty_expect = threshold > 80 ? small_margins :
expect;
1576 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, threshold - 1, 100,
NULL,
NULL,
NULL,
NULL);
1592 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, threshold, 100,
NULL,
NULL,
NULL,
NULL);
1608 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, 0, 0,
NULL,
NULL,
NULL,
NULL);
1629 if (side_bearing < 0)
1630 margin =
min(-side_bearing,
width/2);
1665 const WCHAR EditW[] = {
'E',
'd',
'i',
't',0},
strW[] = {
'W',0};
1675 memset(&lf, 0,
sizeof(lf));
1685 hwnd =
CreateWindowExW(0, EditW,
strW,
WS_POPUP, 0, 0, 5000, 1000,
NULL,
NULL,
NULL,
NULL);
1703 if (cjk && pGetCharWidthInfo && pGetCharWidthInfo(
hdc, &
info)) {
1713 font_expect = small_margins;
1730 ok(
margins ==
expect,
"%s:%d: expected %d, %d, got %d, %d\n", facename,
charset,
HIWORD(
expect),
LOWORD(
expect),
HIWORD(
margins),
LOWORD(
margins));
1734 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, 5000, 1000,
NULL,
NULL,
NULL,
NULL);
1748 ok(
margins ==
expect,
"%s:%d: expected %d, %d, got %d, %d\n", facename,
charset,
HIWORD(
expect),
LOWORD(
expect),
HIWORD(
margins),
LOWORD(
margins));
1773 DWORD old_margins, new_margins;
1774 RECT old_rect, new_rect;
1775 INT old_right_margin;
1781 old_right_margin =
HIWORD(old_margins);
1787 ok(
LOWORD(new_margins) == 10,
"Wrong left margin: %d\n",
LOWORD(new_margins));
1788 ok(
HIWORD(new_margins) == old_right_margin,
"Wrong right margin: %d\n",
HIWORD(new_margins));
1792 ok(
LOWORD(new_margins) == 10,
"Wrong left margin: %d\n",
LOWORD(new_margins));
1793 ok(
HIWORD(new_margins) == 10,
"Wrong right margin: %d\n",
HIWORD(new_margins));
1801 ok(new_rect.
left == old_rect.
left + 10,
"The left border of the rectangle is wrong\n");
1802 ok(new_rect.
right == old_rect.
right - 15,
"The right border of the rectangle is wrong\n");
1803 ok(new_rect.
top == old_rect.
top,
"The top border of the rectangle must not change\n");
1804 ok(new_rect.
bottom == old_rect.
bottom,
"The bottom border of the rectangle must not change\n");
1810 SetRect(&old_rect, 1, 1, 99, 99);
1815 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1822 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1825 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1828 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1831 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1857 skip(
"MS PGothic is not available, skipping some margin tests\n");
1864 skip(
"Ume P Gothic is not available, skipping some margin tests\n");
1871 skip(
"SimSun is not available, skipping some margin tests\n");
1883 skip(
"Arial not found - skipping font change margin tests\n");
1891 memset(&lf, 0,
sizeof(lf));
1966#define edit_pos_ok(exp, got, txt) \
1967 ok(exp == got, "wrong " #txt " expected %d got %d\n", exp, got);
1969#define check_pos(hwEdit, set_height, test_top, test_height, test_left) \
1973 set_client_height(hwEdit, set_height); \
1974 SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM) &format_rect); \
1975 left_margin = LOWORD(SendMessageA(hwEdit, EM_GETMARGINS, 0, 0)); \
1976 edit_pos_ok(test_top, format_rect.top, vertical position); \
1977 edit_pos_ok((int)test_height, format_rect.bottom - format_rect.top, height); \
1978 edit_pos_ok(test_left, format_rect.left - left_margin, left); \
1997 ok (
font !=
NULL,
"GetStockObject SYSTEM_FONT failed\n");
1999 ok (
dc !=
NULL,
"GetDC() failed\n");
2002 ok (xb,
"GetTextMetrics failed\n");
2104 trace(
"EDIT: Text position (Single line)\n");
2106 trace(
"EDIT: Text position (Multi line)\n");
2119 ok(
r ==
ES_PASSWORD,
"Wrong style expected ES_PASSWORD got: 0x%x\n",
r);
2127 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2144 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2146 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2151 ok(
r == 0,
"Expected: 0, got: %d\n",
r);
2163 const char*
text =
"undo this";
2167 ok(0 ==
r,
"Wrong style expected 0x%x got: 0x%x\n", 0,
r);
2174 cpMin = cpMax = 0xdeadbeef;
2178 ok(0 == cpMin,
"Expected: %d, got %d\n", 0, cpMin);
2179 ok(9 == cpMax,
"Expected: %d, got %d\n", 9, cpMax);
2183 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2188 ok(0 ==
r,
"Expected: %d, got len %d\n", 0,
r);
2193 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2203 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2208 ok(
r == 0,
"Expected: %d, got len %d\n", 0,
r);
2230 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2235 ok(2 ==
r,
"Expected: %d, got len %d\n", 2,
r);
2243 ok(0 ==
r,
"Wrong style expected 0x%x got: 0x%x\n", 0,
r);
2250 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2255 ok(0 ==
r,
"Expected: %d, got len %d\n", 0,
r);
2270 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2275 ok(0 ==
r,
"Expected: %d, got len %d\n", 0,
r);
2297 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2302 ok(1 ==
r,
"Expected: %d, got len %d\n", 1,
r);
2310 ok(0 ==
r,
"Wrong style expected 0x%x got: 0x%x\n", 0,
r);
2317 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2322 ok(0 ==
r,
"Expected: %d, got len %d\n", 0,
r);
2334 ok(333 ==
r,
"Expected %d, got %d\n", 333,
r);
2336 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2338 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2342 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2344 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2346 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2350 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2352 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2354 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2358 ok(333 ==
r,
"Expected %d, got %d\n", 333,
r);
2360 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2362 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2366 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2368 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2370 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2374 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2376 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2378 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2382 ok(22 ==
r,
"Expected %d, got %d\n", 22,
r);
2384 ok(33 ==
r,
"Expected %d, got %d\n", 33,
r);
2393 ok(2222 ==
r,
"Expected %d, got %d\n", 2222,
r);
2395 ok(1111 ==
r,
"Expected %d, got %d\n", 1111,
r);
2397 ok(2222 ==
r,
"Expected %d, got %d\n", 2222,
r);
2399 ok(11 ==
r,
"Expected %d, got %d\n", 11,
r);
2408 ok(333 ==
r,
"Expected %d, got %d\n", 333,
r);
2410 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2412 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2416 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2418 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2420 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2424 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2426 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2428 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2437 ok(222 ==
r,
"Expected %d, got %d\n", 222,
r);
2439 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2441 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2445 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2447 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2449 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2453 ok(222 ==
r,
"Expected %d, got %d\n", 222,
r);
2455 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2457 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2461 ok(222 ==
r,
"Expected %d, got %d\n", 222,
r);
2463 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2465 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2469 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2471 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2473 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2477 ok(222 ==
r,
"Expected %d, got %d\n", 222,
r);
2479 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2481 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2503 HWND hwEdit, hwParent;
2510 ok(1 ==
r,
"expected 1, got %d\n",
r);
2621 "Expected no WM_COMMAND messages, got %d\n",
menu_messages.wm_command);
2623 "Expected 1 EM_SETSEL message, got %d\n",
menu_messages.em_setsel);
2639 test2.cbClsExtra = 0;
2640 test2.cbWndExtra = 0;
2651 test3.cbClsExtra = 0;
2652 test3.cbWndExtra = 0;
2663 test4.cbClsExtra = 0;
2664 test4.cbWndExtra = 0;
2685 memset(&wc, 0,
sizeof(wc));
2709 char szLocalString[
MAXLEN];
2722 trace(
"EDIT: Oversized font (Multi line)\n");
2733 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2735 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2737 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2740 ok(
strcmp(szLocalString,
"ABC")==0,
2741 "Wrong contents of edit: %s\n", szLocalString);
2744 ok(
r != -1,
"EM_POSFROMCHAR failed index 0\n");
2746 ok(
r != -1,
"EM_POSFROMCHAR failed index 1\n");
2748 ok(
r != -1,
"EM_POSFROMCHAR failed index 2\n");
2750 ok(
r == -1,
"EM_POSFROMCHAR succeeded index 3\n");
2771#define test_dm_messages(wmcommand, wmclose, wmgetdefid, wmnextdlgctl) \
2772 ok(dm_messages.wm_command == wmcommand, "expected %d WM_COMMAND messages, " \
2773 "got %d\n", wmcommand, dm_messages.wm_command); \
2774 ok(dm_messages.wm_close == wmclose, "expected %d WM_CLOSE messages, " \
2775 "got %d\n", wmclose, dm_messages.wm_close); \
2776 ok(dm_messages.wm_getdefid == wmgetdefid, "expected %d WM_GETDIFID messages, " \
2777 "got %d\n", wmgetdefid, dm_messages.wm_getdefid);\
2778 ok(dm_messages.wm_nextdlgctl == wmnextdlgctl, "expected %d WM_NEXTDLGCTL messages, " \
2779 "got %d\n", wmnextdlgctl, dm_messages.wm_nextdlgctl)
2804 HWND hwEdit, hwParent, hwButton;
2810 ok(1 ==
r,
"expected 1, got %d\n",
r);
2812 ok(11 ==
len,
"expected 11, got %d\n",
len);
2815 ok(0x8d ==
r,
"expected 0x8d, got 0x%x\n",
r);
2818 ok(1 ==
r,
"expected 1, got %d\n",
r);
2820 ok(13 ==
len,
"expected 13, got %d\n",
len);
2823 ok(0x8d ==
r,
"expected 0x8d, got 0x%x\n",
r);
2825 ok(1 ==
r,
"expected 1, got %d\n",
r);
2827 ok(13 ==
len,
"expected 13, got %d\n",
len);
2830 ok(1 ==
r,
"expected 1, got %d\n",
r);
2832 ok(13 ==
len,
"expected 13, got %d\n",
len);
2839 ok(1 ==
r,
"expected 1, got %d\n",
r);
2841 ok(11 ==
len,
"expected 11, got %d\n",
len);
2846 msg.lParam = 0xe0001;
2848 ok(0x8d ==
r,
"expected 0x8d, got 0x%x\n",
r);
2851 ok(1 ==
r,
"expected 1, got %d\n",
r);
2853 ok(11 ==
len,
"expected 11, got %d\n",
len);
2863 ok(1 ==
r,
"expected 1, got %d\n",
r);
2868 ok(1 ==
r,
"expected 1, got %d\n",
r);
2875 msg.lParam = 0xf0001;
2877 ok(0x89 ==
r,
"expected 0x89, got 0x%x\n",
r);
2882 ok(1 ==
r,
"expected 1, got %d\n",
r);
2893 ok(1 ==
r,
"expected 1, got %d\n",
r);
2900 msg.lParam = 0x10001;
2902 ok(0x8d ==
r,
"expected 0x8d, got 0x%x\n",
r);
2907 ok(1 ==
r,
"expected 1, got %d\n",
r);
2912 ok(1 ==
r,
"expected 1, got %d\n",
r);
2917 ok(1 ==
r,
"expected 1, got %d\n",
r);
2926 ok(1 ==
r,
"expected 1, got %d\n",
r);
2936 static const WCHAR str1W[] = {
'1',
'1',
'1',
'1',
'+',
'1',
'1',
'1',
'1',
'+',
'1',
'1',
'1',
'1',
'#',0};
2937 static const WCHAR str2W[] = {
'2',
'2',
'2',
'2',
'-',
'2',
'2',
'2',
'2',
'-',
'2',
'2',
'2',
'2',
'-',
'2',
'2',
'2',
'2',
'#',0};
2938 static const char str0[] =
"untouched";
2939 static const char str1[] =
"1111+1111+1111#";
2940 static const char str1_1[] =
"2111+1111+1111#";
2941 static const char str2[] =
"2222-2222-2222-2222#";
2942 static const char str3[] =
"3333*3333*3333*3333*3333#";
2952 trace(
"EDIT: EM_GETHANDLE\n");
2959 ok(hmem ==
NULL,
"got %p (expected NULL)\n", hmem);
2974 "got %d and \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str1), str1);
2977 ok(hmem !=
NULL,
"got %p (expected != NULL)\n", hmem);
2995 "Unexpected retval %d and text \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str1), str1);
3009 "Unexpected retval %d and text \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str1_1), str1_1);
3013 ok(
r,
"Failed to set text.\n");
3020 ok(
r,
"Failed to replace selection.\n");
3028 ok(halloc !=
NULL,
"got %p (expected != NULL)\n", halloc);
3039 ok(hmem2 !=
NULL,
"got %p (expected != NULL)\n", hmem2);
3049 "got %d and \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str2), str2);
3059 "got %d and \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str3), str3);
3079 ok(hmem2 == hmem,
"got %p (expected %p)\n", hmem2, hmem);