31#define ID_EDITTESTDBUTTON 0x123
32#define ID_EDITTEST2 99
43 static int num_ok_commands = 0;
110 else if (hfocus == hedit2)
112 else if (hfocus == hedit3)
118 if ((hfocus == hedit) && (num_ok_commands == 0))
254 if ((hfocus == hok) &&
len == 0)
263 else if (hfocus == hcancel)
265 else if (hfocus == hedit)
377 if ((hfocus == hedit) &&
len == 0)
384 if ((hfocus == hok) &&
len == 0)
499 if ((hfocus == hedit) &&
len == 0)
506 if ((hfocus == hok) &&
len == 0)
513 if ((hfocus == hedit) &&
len == 2)
553 ok (
handle !=
NULL,
"CreateWindow EDIT Control failed\n");
562 static const WCHAR testtextW[] = {
'T',
'e',
's',
't',
' ',
't',
'e',
'x',
't',0};
563 static const WCHAR editW[] = {
'E',
'd',
'i',
't',0};
580 ok(
b,
"AdjustWindowRect failed\n");
589 ok (parentWnd !=
NULL,
"CreateWindow EDIT Test failed\n");
598 ok (editWnd !=
NULL,
"CreateWindow EDIT Test Text failed\n");
610 trace(
"Edit control has no parent!\n");
640 RECT ClientRect, WindowRect;
664 "The client height should be %d, but is %d\n",
677 trace(
"EDIT: Single line\n");
681 for (
i=0;
i<65535;
i++)
683 msMessage.wParam =
i;
686 "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n",
r);
690 trace(
"EDIT: Single line want returns\n");
694 for (
i=0;
i<65535;
i++)
696 msMessage.wParam =
i;
699 "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n",
r);
703 trace(
"EDIT: Multiline line\n");
707 for (
i=0;
i<65535;
i++)
709 msMessage.wParam =
i;
712 "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n",
r);
716 trace(
"EDIT: Multi line want returns\n");
720 for (
i=0;
i<65535;
i++)
722 msMessage.wParam =
i;
725 "Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n",
r);
739 char szLocalString[
MAXLEN];
758 trace(
"EDIT: SETTEXT atomicity\n");
761 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
763 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
765 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
769 "Wrong contents of edit: %s\n", szLocalString);
773 todo_wine ok(0 ==
r,
"SetCaretPos succeeded unexpectedly, expected: 0, got: %d\n",
r);
775 ok(phwnd !=
NULL,
"SetFocus failed unexpectedly, expected non-zero, got NULL\n");
777 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
779 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
780 ok(cpos.
x == 0 && cpos.
y == 0,
"Wrong caret position, expected: (0,0), got: (%d,%d)\n", cpos.
x, cpos.
y);
782 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
784 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
785 ok(cpos.
x == -1 && cpos.
y == -1,
"Wrong caret position, expected: (-1,-1), got: (%d,%d)\n", cpos.
x, cpos.
y);
787 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
789 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
790 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);
792 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
794 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
795 ok(cpos.
x ==
w && cpos.
y ==
h,
"Wrong caret position, expected: (%d,%d), got: (%d,%d)\n",
w,
h, cpos.
x, cpos.
y);
797 ok(1 ==
r,
"SetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
799 ok(1 ==
r,
"GetCaretPos failed unexpectedly, expected: 1, got: %d\n",
r);
800 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);
808 char szLocalString[
MAXLEN];
811 if (
strcmp(szLocalString,
"foo")==0) {
812 strcpy(szLocalString,
"bar");
840#define test_notify(enchange, enmaxtext, enupdate) \
842 ok(notifications.en_change == enchange, "expected %d EN_CHANGE notifications, " \
843 "got %d\n", enchange, notifications.en_change); \
844 ok(notifications.en_maxtext == enmaxtext, "expected %d EN_MAXTEXT notifications, " \
845 "got %d\n", enmaxtext, notifications.en_maxtext); \
846 ok(notifications.en_update == enupdate, "expected %d EN_UPDATE notifications, " \
847 "got %d\n", enupdate, notifications.en_update); \
880 static const char *
str =
"this is a long string.";
881 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.";
887 trace(
"EDIT: Test notifications\n");
897 trace(
"EDIT: Single line, no ES_AUTOHSCROLL\n");
918 ok(1 ==
len,
"wrong text length, expected 1, got %d\n",
len);
941 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
952 trace(
"EDIT: Single line, ES_AUTOHSCROLL\n");
977 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
983 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
992 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1003 trace(
"EDIT: Multline, no ES_AUTOHSCROLL, no ES_AUTOVSCROLL\n");
1008 10, 10, (50 *
dpi) / 96, (50 *
dpi) / 96,
1019 ok(0 ==
len,
"text should have been truncated, expected 0, got %d\n",
len);
1042 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1053 trace(
"EDIT: Multline, ES_AUTOHSCROLL, no ES_AUTOVSCROLL\n");
1058 10, 10, (50 *
dpi) / 96, (50 *
dpi) / 96,
1065 ok(0 ==
len,
"text should have been truncated, expected 0, got %d\n",
len);
1078 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1087 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1093 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1098 trace(
"EDIT: Multline, ES_AUTOHSCROLL and ES_AUTOVSCROLL\n");
1110 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1116 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1125 ok(5 ==
len,
"text should have been truncated to limit, expected 5, got %d\n",
len);
1131 ok(
lstrlenA(str2) ==
len,
"text shouldn't have been truncated\n");
1146 trace(
"EDIT: Test EM_CHARFROMPOS and EM_POSFROMCHAR\n");
1151 mid = lo + (hi - lo) / 2;
1153 for (
i = lo;
i < mid;
i++) {
1155 ok(0 ==
ret,
"expected 0 got %d\n",
ret);
1157 for (
i = mid;
i <= hi;
i++) {
1159 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1162 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1169 mid = lo + (hi - lo) / 2;
1171 for (
i = lo;
i < mid;
i++) {
1173 ok(0 ==
ret,
"expected 0 got %d\n",
ret);
1175 for (
i = mid;
i <= hi;
i++) {
1177 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1180 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1187 mid = lo + (hi - lo) / 2;
1189 for (
i = lo;
i < mid;
i++) {
1191 ok(0 ==
ret,
"expected 0 got %d\n",
ret);
1193 for (
i = mid;
i <= hi;
i++) {
1195 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1198 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1205 mid = lo + (hi - lo) / 2 +1;
1207 for (
i = lo;
i < mid;
i++) {
1209 ok((0 ==
ret || 1 ==
ret ),
"expected 0 or 1 got %d\n",
ret);
1211 for (
i = mid;
i <= hi;
i++) {
1213 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1216 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1223 mid = lo + (hi - lo) / 2 +1;
1225 for (
i = lo;
i < mid;
i++) {
1227 ok((0 ==
ret || 1 ==
ret ),
"expected 0 or 1 got %d\n",
ret);
1229 for (
i = mid;
i <= hi;
i++) {
1231 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1234 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1241 mid = lo + (hi - lo) / 2 +1;
1243 for (
i = lo;
i < mid;
i++) {
1245 ok((0 ==
ret || 1 ==
ret ),
"expected 0 or 1 got %d\n",
ret);
1247 for (
i = mid;
i <= hi;
i++) {
1249 ok(1 ==
ret,
"expected 1 got %d\n",
ret);
1252 ok(-1 ==
ret,
"expected -1 got %d\n",
ret);
1261 static const char *
str =
"test\r\ntest";
1265 RECT rc1 = { 10, 10, 11, 11};
1278 ok( rc.
right - rc.
left > 20,
"size of the window (%d) is smaller than expected\n",
1327 static const char *
str =
"test\r\ntest";
1347 ok(
ret == 0,
"Expected 0, got %d\n",
ret);
1353 ok(
ret == 0,
"Expected 0, got %d\n",
ret);
1355 ok(
ret == 0,
"Expected 0, got len %d\n",
ret);
1367 trace(
"EDIT: buffer limit for single-line\n");
1370 ok(
r == 30000,
"Incorrect default text limit, expected 30000 got %u\n",
r);
1373 ok(
r == 2147483646,
"got limit %u (expected 2147483646)\n",
r);
1377 trace(
"EDIT: buffer limit for multi-line\n");
1380 ok(
r == 30000,
"Incorrect default text limit, expected 30000 got %u\n",
r);
1383 ok(
r == 4294967295U,
"got limit %u (expected 4294967295)\n",
r);
1390 static const char *single_line_str =
"a";
1391 static const char *multiline_str =
"Test\r\nText";
1408 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1411 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1414 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1417 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1433 ok(!
ret,
"Returned %x, expected 0.\n",
ret);
1441 case 932:
case 936:
case 949:
case 950:
case 1361:
1460 memset(&lf, 0,
sizeof(lf));
1470 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, 5000, 1000,
NULL,
NULL,
NULL,
NULL);
1499 empty_expect = threshold > 80 ? small_margins :
expect;
1502 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, threshold - 1, 100,
NULL,
NULL,
NULL,
NULL);
1518 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, threshold, 100,
NULL,
NULL,
NULL,
NULL);
1534 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, 0, 0,
NULL,
NULL,
NULL,
NULL);
1557 (
fs.fsCsb[0] & FS_DBCS_MASK));
1563 if (side_bearing < 0)
1564 margin =
min(-side_bearing,
width/2);
1598 BOOL cjk_charset, cjk_font;
1604 const WCHAR EditW[] = {
'E',
'd',
'i',
't',0},
strW[] = {
'W',0};
1614 memset(&lf, 0,
sizeof(lf));
1624 hwnd =
CreateWindowExW(0, EditW,
strW,
WS_POPUP, 0, 0, 5000, 1000,
NULL,
NULL,
NULL,
NULL);
1643 if ((cjk_charset || cjk_font) &&
1644 pGetCharWidthInfo && pGetCharWidthInfo(
hdc, &
info)) {
1654 font_expect = small_margins;
1667 ok(
margins == font_expect,
"%s:%d: expected %d, %d, got %d, %d\n", facename,
charset,
HIWORD(font_expect),
LOWORD(font_expect),
HIWORD(
margins),
LOWORD(
margins));
1671 ok(
margins ==
expect,
"%s:%d: expected %d, %d, got %d, %d\n", facename,
charset,
HIWORD(
expect),
LOWORD(
expect),
HIWORD(
margins),
LOWORD(
margins));
1675 hwnd =
CreateWindowExA(0,
"Edit",
"A",
WS_POPUP, 0, 0, 5000, 1000,
NULL,
NULL,
NULL,
NULL);
1686 font_expect = small_margins;
1699 ok(
margins == font_expect,
"%s:%d: expected %d, %d, got %d, %d\n", facename,
charset,
HIWORD(font_expect),
LOWORD(font_expect),
HIWORD(
margins),
LOWORD(
margins));
1703 ok(
margins ==
expect,
"%s:%d: expected %d, %d, got %d, %d\n", facename,
charset,
HIWORD(
expect),
LOWORD(
expect),
HIWORD(
margins),
LOWORD(
margins));
1729 RECT old_rect, new_rect;
1730 INT old_right_margin;
1731 DWORD old_margins, new_margins;
1736 old_right_margin =
HIWORD(old_margins);
1742 ok(
LOWORD(new_margins) == 10,
"Wrong left margin: %d\n",
LOWORD(new_margins));
1743 ok(
HIWORD(new_margins) == old_right_margin,
"Wrong right margin: %d\n",
HIWORD(new_margins));
1747 ok(
LOWORD(new_margins) == 10,
"Wrong left margin: %d\n",
LOWORD(new_margins));
1748 ok(
HIWORD(new_margins) == 10,
"Wrong right margin: %d\n",
HIWORD(new_margins));
1756 ok(new_rect.
left == old_rect.
left + 10,
"The left border of the rectangle is wrong\n");
1757 ok(new_rect.
right == old_rect.
right - 15,
"The right border of the rectangle is wrong\n");
1758 ok(new_rect.
top == old_rect.
top,
"The top border of the rectangle must not change\n");
1759 ok(new_rect.
bottom == old_rect.
bottom,
"The bottom border of the rectangle must not change\n");
1765 SetRect(&old_rect, 1, 1, 99, 99);
1770 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1777 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1780 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1783 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1786 ok(
EqualRect(&old_rect, &new_rect),
"The border of the rectangle has changed\n");
1812 skip(
"MS PGothic is not available, skipping some margin tests\n");
1819 skip(
"Ume P Gothic is not available, skipping some margin tests\n");
1826 skip(
"SimSun is not available, skipping some margin tests\n");
1838 skip(
"Arial not found - skipping font change margin tests\n");
1846 memset(&lf, 0,
sizeof(lf));
1932#define edit_pos_ok(exp, got, txt) \
1933 ok(exp == got, "wrong " #txt " expected %d got %d\n", exp, got);
1935#define check_pos(hwEdit, set_height, test_top, test_height, test_left) \
1939 set_client_height(hwEdit, set_height); \
1940 SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM) &format_rect); \
1941 left_margin = LOWORD(SendMessageA(hwEdit, EM_GETMARGINS, 0, 0)); \
1942 edit_pos_ok(test_top, format_rect.top, vertical position); \
1943 edit_pos_ok((int)test_height, format_rect.bottom - format_rect.top, height); \
1944 edit_pos_ok(test_left, format_rect.left - left_margin, left); \
1963 ok (
font !=
NULL,
"GetStockObject SYSTEM_FONT failed\n");
1965 ok (
dc !=
NULL,
"GetDC() failed\n");
1968 ok (xb,
"GetTextMetrics failed\n");
2070 trace(
"EDIT: Text position (Single line)\n");
2072 trace(
"EDIT: Text position (Multi line)\n");
2085 ok(
r ==
ES_PASSWORD,
"Wrong style expected ES_PASSWORD got: 0x%x\n",
r);
2093 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2110 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2112 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2117 ok(
r == 0,
"Expected: 0, got: %d\n",
r);
2129 const char*
text =
"undo this";
2133 ok(0 ==
r,
"Wrong style expected 0x%x got: 0x%x\n", 0,
r);
2140 cpMin = cpMax = 0xdeadbeef;
2144 ok(0 == cpMin,
"Expected: %d, got %d\n", 0, cpMin);
2145 ok(9 == cpMax,
"Expected: %d, got %d\n", 9, cpMax);
2149 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2154 ok(0 ==
r,
"Expected: %d, got len %d\n", 0,
r);
2159 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2169 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2174 ok(
r == 0,
"Expected: %d, got len %d\n", 0,
r);
2196 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2201 ok(2 ==
r,
"Expected: %d, got len %d\n", 2,
r);
2209 ok(0 ==
r,
"Wrong style expected 0x%x got: 0x%x\n", 0,
r);
2216 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2221 ok(0 ==
r,
"Expected: %d, got len %d\n", 0,
r);
2236 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2241 ok(0 ==
r,
"Expected: %d, got len %d\n", 0,
r);
2263 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2268 ok(1 ==
r,
"Expected: %d, got len %d\n", 1,
r);
2276 ok(0 ==
r,
"Wrong style expected 0x%x got: 0x%x\n", 0,
r);
2283 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2288 ok(0 ==
r,
"Expected: %d, got len %d\n", 0,
r);
2300 ok(333 ==
r,
"Expected %d, got %d\n", 333,
r);
2302 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2304 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2308 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2310 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2312 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2316 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2318 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2320 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2324 ok(333 ==
r,
"Expected %d, got %d\n", 333,
r);
2326 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2328 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2332 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2334 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2336 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2340 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);
2348 ok(22 ==
r,
"Expected %d, got %d\n", 22,
r);
2350 ok(33 ==
r,
"Expected %d, got %d\n", 33,
r);
2359 ok(2222 ==
r,
"Expected %d, got %d\n", 2222,
r);
2361 ok(1111 ==
r,
"Expected %d, got %d\n", 1111,
r);
2363 ok(2222 ==
r,
"Expected %d, got %d\n", 2222,
r);
2365 ok(11 ==
r,
"Expected %d, got %d\n", 11,
r);
2374 ok(333 ==
r,
"Expected %d, got %d\n", 333,
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(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2384 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2386 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2390 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2392 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2394 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2403 ok(222 ==
r,
"Expected %d, got %d\n", 222,
r);
2405 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2407 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2411 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2413 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2415 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2419 ok(222 ==
r,
"Expected %d, got %d\n", 222,
r);
2421 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2423 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2427 ok(222 ==
r,
"Expected %d, got %d\n", 222,
r);
2429 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2431 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2435 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2437 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2439 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2443 ok(222 ==
r,
"Expected %d, got %d\n", 222,
r);
2445 ok(111 ==
r,
"Expected %d, got %d\n", 111,
r);
2447 ok(444 ==
r,
"Expected %d, got %d\n", 444,
r);
2469 HWND hwEdit, hwParent;
2476 ok(1 ==
r,
"expected 1, got %d\n",
r);
2514 memset(&mbi, 0,
sizeof(mbi));
2515 mbi.
cbSize =
sizeof(mbi);
2518 ok(
ret,
"GetMenuBarInfo failed\n");
2527 memset(&mbi, 0,
sizeof(mbi));
2528 mbi.
cbSize =
sizeof(mbi);
2531 ok(
ret,
"GetMenuBarInfo failed\n");
2625 "Expected no WM_COMMAND messages, got %d\n",
menu_messages.wm_command);
2627 "Expected 1 EM_SETSEL message, got %d\n",
menu_messages.em_setsel);
2642 test2.cbClsExtra = 0;
2643 test2.cbWndExtra = 0;
2654 test3.cbClsExtra = 0;
2655 test3.cbWndExtra = 0;
2666 test4.cbClsExtra = 0;
2667 test4.cbWndExtra = 0;
2706 char szLocalString[
MAXLEN];
2719 trace(
"EDIT: Oversized font (Multi line)\n");
2730 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2732 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2734 ok(1 ==
r,
"Expected: %d, got: %d\n", 1,
r);
2737 ok(
strcmp(szLocalString,
"ABC")==0,
2738 "Wrong contents of edit: %s\n", szLocalString);
2741 ok(
r != -1,
"EM_POSFROMCHAR failed index 0\n");
2743 ok(
r != -1,
"EM_POSFROMCHAR failed index 1\n");
2745 ok(
r != -1,
"EM_POSFROMCHAR failed index 2\n");
2747 ok(
r == -1,
"EM_POSFROMCHAR succeeded index 3\n");
2768#define test_dm_messages(wmcommand, wmclose, wmgetdefid, wmnextdlgctl) \
2769 ok(dm_messages.wm_command == wmcommand, "expected %d WM_COMMAND messages, " \
2770 "got %d\n", wmcommand, dm_messages.wm_command); \
2771 ok(dm_messages.wm_close == wmclose, "expected %d WM_CLOSE messages, " \
2772 "got %d\n", wmclose, dm_messages.wm_close); \
2773 ok(dm_messages.wm_getdefid == wmgetdefid, "expected %d WM_GETDIFID messages, " \
2774 "got %d\n", wmgetdefid, dm_messages.wm_getdefid);\
2775 ok(dm_messages.wm_nextdlgctl == wmnextdlgctl, "expected %d WM_NEXTDLGCTL messages, " \
2776 "got %d\n", wmnextdlgctl, dm_messages.wm_nextdlgctl)
2801 HWND hwEdit, hwParent, hwButton;
2807 ok(1 ==
r,
"expected 1, got %d\n",
r);
2809 ok(11 ==
len,
"expected 11, got %d\n",
len);
2812 ok(0x8d ==
r,
"expected 0x8d, got 0x%x\n",
r);
2815 ok(1 ==
r,
"expected 1, got %d\n",
r);
2817 ok(13 ==
len,
"expected 13, got %d\n",
len);
2820 ok(0x8d ==
r,
"expected 0x8d, got 0x%x\n",
r);
2822 ok(1 ==
r,
"expected 1, got %d\n",
r);
2824 ok(13 ==
len,
"expected 13, got %d\n",
len);
2827 ok(1 ==
r,
"expected 1, got %d\n",
r);
2829 ok(13 ==
len,
"expected 13, got %d\n",
len);
2836 ok(1 ==
r,
"expected 1, got %d\n",
r);
2838 ok(11 ==
len,
"expected 11, got %d\n",
len);
2843 msg.lParam = 0xe0001;
2845 ok(0x8d ==
r,
"expected 0x8d, got 0x%x\n",
r);
2848 ok(1 ==
r,
"expected 1, got %d\n",
r);
2850 ok(11 ==
len,
"expected 11, got %d\n",
len);
2860 ok(1 ==
r,
"expected 1, got %d\n",
r);
2865 ok(1 ==
r,
"expected 1, got %d\n",
r);
2872 msg.lParam = 0xf0001;
2874 ok(0x89 ==
r,
"expected 0x89, got 0x%x\n",
r);
2879 ok(1 ==
r,
"expected 1, got %d\n",
r);
2890 ok(1 ==
r,
"expected 1, got %d\n",
r);
2897 msg.lParam = 0x10001;
2899 ok(0x8d ==
r,
"expected 0x8d, got 0x%x\n",
r);
2904 ok(1 ==
r,
"expected 1, got %d\n",
r);
2909 ok(1 ==
r,
"expected 1, got %d\n",
r);
2914 ok(1 ==
r,
"expected 1, got %d\n",
r);
2923 ok(1 ==
r,
"expected 1, got %d\n",
r);
2933 static const char str0[] =
"untouched";
2934 static const char str1[] =
"1111+1111+1111#";
2935 static const char str1_1[] =
"2111+1111+1111#";
2936 static const char str2[] =
"2222-2222-2222-2222#";
2937 static const char str3[] =
"3333*3333*3333*3333*3333#";
2947 trace(
"EDIT: EM_GETHANDLE\n");
2954 ok(hmem ==
NULL,
"got %p (expected NULL)\n", hmem);
2970 "got %d and \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str1), str1);
2973 ok(hmem !=
NULL,
"got %p (expected != NULL)\n", hmem);
2981 "got %d and \"%s\" (expected %d and \"%s\")\n",
len,
buffer,
lstrlenA(str1), str1);
2991 "Unexpected retval %d and text \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str1), str1);
3005 "Unexpected retval %d and text \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str1_1), str1_1);
3009 ok(
r,
"Failed to set text.\n");
3016 ok(
r,
"Failed to replace selection.\n");
3024 ok(halloc !=
NULL,
"got %p (expected != NULL)\n", halloc);
3035 ok(hmem2 !=
NULL,
"got %p (expected != NULL)\n", hmem2);
3045 "got %d and \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str2), str2);
3055 "got %d and \"%s\" (expected %d and \"%s\")\n",
r,
current,
lstrlenA(str3), str3);
3075 ok(hmem2 == hmem,
"got %p (expected %p)\n", hmem2, hmem);
3089 static const char *
str =
"this is a simple text";
3090 static const char *str2 =
"first line\r\nsecond line";
3097 ok(hmem !=
NULL,
"got %p (expected != NULL)\n", hmem);
3108 ok(hmem_ret == hmem,
"expected %p, got %p\n", hmem, hmem_ret);
3120 ok(hmem !=
NULL,
"got %p (expected != NULL)\n", hmem);
3131 ok(hmem_ret == hmem,
"expected %p, got %p\n", hmem, hmem_ret);
3162 static const WCHAR strW[] = {
't',
'e',
'x',
't',0};
3163 static const char *
str =
"text";
3187 memset(buffW, 0,
sizeof(buffW));
3193 memset(buffW, 0,
sizeof(buffW));
3220 ok(
ret == 1,
"Unexpected return value %ld.\n",
ret);
3226 ok(
ret == 1,
"Unexpected return value %ld.\n",
ret);
3240 ok (
b,
"RegisterWindowClasses failed\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
static const char * wine_dbgstr_rect(const RECT *prc)
static int get_cjk_fontinfo_margin(int width, int side_bearing)
#define GetProcAddress(x, y)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
static unsigned char buff[32768]
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
LPVOID NTAPI LocalLock(HLOCAL hMem)
BOOL NTAPI LocalUnlock(HLOCAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
struct task_struct * current
static struct dialog_mode_messages dm_messages
static LRESULT CALLBACK ET2_WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
static void test_edit_control_limittext(void)
static void test_edit_dialog(void)
static INT_PTR CALLBACK child_edit_wmkeydown_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
static HWND create_editcontrol(DWORD style, DWORD exstyle)
static const char szEditTest2Class[]
static HWND create_child_editcontrol(DWORD style, DWORD exstyle)
static LRESULT CALLBACK dialog_mode_wnd_proc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
static void test_margins_usefontinfo(UINT charset)
static void test_paste(void)
static struct context_menu_messages menu_messages
static void zero_notify(void)
static HWND create_editcontrolW(DWORD style, DWORD exstyle)
#define check_pos(hwEdit, set_height, test_top, test_height, test_left)
static void zero_dm_messages(void)
static void test_edit_control_3(void)
static struct edit_notify notifications
static void test_EM_GETLINE(void)
static void UnregisterWindowClasses(void)
static LRESULT CALLBACK child_edit_menu_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK edit4_wnd_procA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static void test_multi_edit_dialog(void)
static void test_wantreturn_edit_dialog(void)
static DWORD get_cjk_font_margins(HDC hdc)
static BOOL got_wm_capturechanged
static void test_edit_control_5(void)
static void test_margins_font_change(void)
static void test_edit_control_6(void)
static void test_contextmenu(void)
static void ET2_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
static INT_PTR CALLBACK edit_wantreturn_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
static LRESULT CALLBACK edit3_wnd_procA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static void test_margins_default(const char *facename, UINT charset)
static BOOL got_en_setfocus
static void set_client_height(HWND Wnd, unsigned Height)
static void test_dialogmode(void)
static const char szEditTextPositionClass[]
static void test_wordbreak_proc(void)
static void test_edit_control_scroll(void)
static void destroy_child_editcontrol(HWND hwndEdit)
static void test_singleline_wantreturn_edit_dialog(void)
static void test_espassword(void)
static const char szEditTest4Class[]
static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
#define ID_EDITTESTDBUTTON
static const char szEditTest3Class[]
static void test_child_edit_wmkeydown(void)
static LONG get_edit_style(HWND hwnd)
static void test_edit_control_1(void)
#define test_notify(enchange, enmaxtext, enupdate)
static INT_PTR CALLBACK multi_edit_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
static int CALLBACK test_wordbreak_procA(char *text, int current, int length, int code)
static void test_undo(void)
static void test_margins(void)
static INT_PTR CALLBACK edit_singleline_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
static void test_enter(void)
static void ET2_check_change(void)
static BOOL is_font_installed(const char *name)
static void test_EM_GETHANDLE(void)
static void test_text_position_style(DWORD style)
static int child_edit_wmkeydown_num_messages
static void test_text_position(void)
static INT_PTR CALLBACK edit_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
#define test_dm_messages(wmcommand, wmclose, wmgetdefid, wmnextdlgctl)
static void test_fontsize(void)
static void test_edit_control_2(void)
static void test_tab(void)
static CRYPT_DATA_BLOB b3[]
static CRYPT_DATA_BLOB b2[]
static UINT UINT LPWORD LPABC abc
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static const WCHAR testtextW[]
static BOOL is_cjk_charset(HDC dc)
static BOOL is_cjk_font(HDC dc)
static void test_edit_control_4(void)
static LRESULT CALLBACK edit_proc_proxy(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static BOOL RegisterWindowClasses(void)
#define WS_OVERLAPPEDWINDOW
CHAR lfFaceName[LF_FACESIZE]
TW_UINT32 TW_UINT16 TW_UINT16 MSG
_In_ HFONT _Out_ PUINT Height
static const WCHAR editW[]
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
DWORD WINAPI GetLastError(void)
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI GetCharABCWidthsA(_In_ HDC hdc, _In_ UINT wFirst, _In_ UINT wLast, _Out_writes_(wLast - wFirst+1) LPABC lpABC)
int WINAPI GetTextCharsetInfo(_In_ HDC, _Out_opt_ LPFONTSIGNATURE, _In_ DWORD)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
int WINAPI EnumFontFamiliesA(_In_ HDC, _In_opt_ LPCSTR, _In_ FONTENUMPROCA, _In_ LPARAM)
#define CHINESEBIG5_CHARSET
DWORD WINAPI GdiGetCodePage(HDC)
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
#define EASTEUROPE_CHARSET
BOOL WINAPI GetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wFirst, _In_ UINT wLast, _Out_writes_(wLast - wFirst+1) LPABC lpABC)
HWND WINAPI GetFocus(void)
HWND WINAPI SetCapture(_In_ HWND hWnd)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI EndMenu(void)
#define SetWindowLongPtrA
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define EM_GETWORDBREAKPROC
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
int(CALLBACK * EDITWORDBREAKPROCA)(LPSTR, int, int, int)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CAPTURECHANGED
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
struct tagMENUITEMINFOA MENUITEMINFOA
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
BOOL WINAPI CloseClipboard(void)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
struct tagMENUBARINFO MENUBARINFO
BOOL WINAPI IsWindowUnicode(_In_ HWND)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HWND WINAPI SetFocus(_In_opt_ HWND)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EmptyClipboard(void)
#define EM_SETWORDBREAKPROC
BOOL WINAPI GetCaretPos(_Out_ LPPOINT)
HDC WINAPI GetDC(_In_opt_ HWND)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI GetMenuItemInfoA(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOA)
BOOL WINAPI SetCaretPos(_In_ int, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI GetMenuBarInfo(_In_ HWND, _In_ LONG, _In_ LONG, _Inout_ PMENUBARINFO)
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)