42#define ID_RICHEDITTESTDBUTTON 0x123
46#define ok_w3(format, szString1, szString2, szString3) \
47 WideCharToMultiByte(CP_ACP, 0, szString1, -1, string1, MAX_PATH, NULL, NULL); \
48 WideCharToMultiByte(CP_ACP, 0, szString2, -1, string2, MAX_PATH, NULL, NULL); \
49 WideCharToMultiByte(CP_ACP, 0, szString3, -1, string3, MAX_PATH, NULL, NULL); \
50 ok(!lstrcmpW(szString3, szString1) || !lstrcmpW(szString3, szString2), \
51 format, string1, string2, string3);
56#if defined(__i386__) && !defined(__MINGW32__) && (!defined(_MSC_VER) || !defined(__clang__))
62#define ITextServices_OnTxPropertyBitsChange(This,a,b) (This)->lpVtbl->OnTxPropertyBitsChange(This,a,b)
76 IRichEditOle_Release( richole );
153 while (*szChars !=
'\0') {
156 ok(
ret == 0,
"WM_CHAR('%c') ret=%d\n", *szChars,
ret);
168 ok(
result,
"GetKeyboardState failed.\n");
170 key_state[
vk] |= 0x80;
172 ok(
result,
"SetKeyboardState failed.\n");
182 ok(
result,
"GetKeyboardState failed.\n");
184 key_state[
vk] &= ~0x80;
186 ok(
result,
"SetKeyboardState failed.\n");
190static const char haystack[] =
"WINEWine wineWine wine WineWine";
205 {0, -1,
"foo", 0, -1},
235 {20, 5,
"Wine", 0, 13},
254 {-20, 20,
"Wine",
FR_DOWN, -1},
255 {-20, 20,
"Wine",
FR_DOWN, -1},
256 {-15, -20,
"Wine",
FR_DOWN, -1},
257 {1<<12, 1<<13,
"Wine",
FR_DOWN, -1},
271 {0, -1,
"wineWine wine", 0, -1},
290 memset(&ftw, 0,
sizeof(ftw));
296 ok(findloc ==
f->expected_loc,
297 "EM_FINDTEXT(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
298 name,
id, unicode,
f->needle,
f->start,
f->end,
f->flags, findloc,
f->expected_loc);
301 ok(findloc ==
f->expected_loc,
302 "EM_FINDTEXTW(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
303 name,
id, unicode,
f->needle,
f->start,
f->end,
f->flags, findloc,
f->expected_loc);
308 memset(&fta, 0,
sizeof(fta));
314 ok(findloc ==
f->expected_loc,
315 "EM_FINDTEXT(%s,%d,%u) '%s' in range(%d,%d), flags %08x, got start at %d, expected %d\n",
316 name,
id, unicode,
f->needle,
f->start,
f->end,
f->flags, findloc,
f->expected_loc);
321 int id,
BOOL unicode)
324 int expected_end_loc;
328 memset(&ftw, 0,
sizeof(ftw));
333 ok(findloc ==
f->expected_loc,
334 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
335 name,
id,
f->needle,
f->start,
f->end,
f->flags, findloc);
337 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %ld\n",
339 expected_end_loc = ((
f->expected_loc == -1) ? -1
340 :
f->expected_loc +
strlen(
f->needle));
342 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, end at %ld, expected %d\n",
347 memset(&fta, 0,
sizeof(fta));
352 ok(findloc ==
f->expected_loc,
353 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n",
354 name,
id,
f->needle,
f->start,
f->end,
f->flags, findloc);
356 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %ld\n",
358 expected_end_loc = ((
f->expected_loc == -1) ? -1
359 :
f->expected_loc +
strlen(
f->needle));
361 "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, end at %ld, expected %d\n",
424 {0, 10,
"foo bar\r"},
439 static const int nBuf = 1024;
440 char dest[1024], origdest[1024];
441 const char text[] =
"foo bar\n"
447 memset(origdest, 0xBB, nBuf);
459 ok(nCopied == expected_nCopied,
"%d: %d!=%d\n",
i, nCopied,
462 if (
gl[
i].buffer_len == 0)
465 else if (
gl[
i].buffer_len == 1)
467 !
strncmp(
dest+2, origdest+2, nBuf-2),
"buffer_len=1\n");
471 char expectedbuf[1024];
472 char resultbuf[1024];
475 for (
j = 0;
j < 32;
j++)
477 expectedbuf[0] =
'\0';
478 for (
j = 0;
j < expected_bytes_written;
j++)
480 for (;
j <
gl[
i].buffer_len;
j++)
483 sprintf(expectedbuf+
strlen(expectedbuf),
"%02x", origdest[
j] & 0xFF);
493 "%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n",
494 i, expected_bytes_written, expectedbuf, resultbuf);
498 nBuf -
gl[
i].buffer_len),
499 "%d: expected_bytes_written=%d\n" "expected=0x%s\n" "but got= 0x%s\n",
500 i, expected_bytes_written, expectedbuf, resultbuf);
515 int offset_test[10][2] = {
532 for (
i = 0;
i < 10;
i++) {
534 ok(
result == offset_test[
i][1],
"Length of line at offset %d is %Id, expected %d\n",
535 offset_test[
i][0],
result, offset_test[
i][1]);
540 skip(
"Skip multibyte character tests on non-Japanese platform\n");
547 int offset_test1[3][2] = {
555 ok(
result == offset_test1[
i][1],
"Length of line at offset %d is %Id, expected %d\n",
556 offset_test1[
i][0],
result, offset_test1[
i][1]);
567 ok(
p.x != -1 &&
p.y != -1,
"p.x:%ld p.y:%ld\n",
p.x,
p.y);
574 cr.
cpMax = charindex;
575 cr.
cpMin = charindex;
587 const char text[] =
"aa\n"
588 "this is a long line of text that should be longer than the "
615 ok(prevY != curY,
"%d == %d\n", prevY, curY);
623 ok(prevY != curY,
"%d == %d\n", prevY, curY);
630 ok(prevY == curY,
"%d != %d\n", prevY, curY);
637 ok(prevY == curY,
"%d != %d\n", prevY, curY);
653 static const char text[] =
"aa\n"
654 "this is a long line of text that should be longer than the "
665 (sig.
lsUsb[3] & 0x08000000) != 0);
668 for (
i = 0;
i < 50;
i++)
687 for (
i = 0;
i < 50;
i++)
724 for (
i = 0;
i < 50;
i++)
729 "EM_POSFROMCHAR reports y=%hd, expected %d\n",
758 "EM_POSFROMCHAR reports x=%hd, expected value less than %d\n",
766 ok(
pt.x > 1,
"pt.x = %ld\n",
pt.x);
770 ok(
pt.x > xpos,
"pt.x = %ld\n",
pt.x);
771 xpos = (
rtl ?
pt.x + 7 :
pt.x);
774 ok(
pt.x == xpos,
"pt.x = %ld\n",
pt.x);
778 ok(
pt.x == 1,
"pt.x = %ld\n",
pt.x);
782 (
LPARAM)
"{\\rtf1\\pard\\fi-200\\li-200\\f1 TestSomeText\\par}");
784 ok(
pt.x == 1,
"pt.x = %ld\n",
pt.x);
788 ok(
fmt.dxStartIndent == -400,
"got %ld\n",
fmt.dxStartIndent);
789 ok(
fmt.dxOffset == 200,
"got %ld\n",
fmt.dxOffset);
803 int tested_effects[] = {
818 DWORD expect_effects;
822 (sig.
lsUsb[3] & 0x08000000) != 0);
841 memset(&cf2, 0,
sizeof(cf2));
843 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
846 memset(&cf2, 0,
sizeof(cf2));
848 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
851 memset(&cf2, 0,
sizeof(cf2));
853 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
856 memset(&cf2, 0,
sizeof(cf2));
858 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
861 memset(&cf2, 0,
sizeof(cf2));
863 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
866 memset(&cf2, 0,
sizeof(cf2));
869 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
871 ok(rc ==
FALSE,
"Should not be able to undo here.\n");
875 memset(&cf2, 0,
sizeof(cf2));
878 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
880 ok(rc ==
FALSE,
"Should not be able to undo here.\n");
884 memset(&cf2, 0,
sizeof(cf2));
887 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
889 ok(rc ==
FALSE,
"Should not be able to undo here.\n");
893 memset(&cf2, 0,
sizeof(cf2));
896 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
902 memset(&cf2, 0,
sizeof(cf2));
905 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
907 ok(rc ==
TRUE,
"Should not be able to undo here.\n");
922 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
924 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
928 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
931 skip(
"RTL language found\n");
936 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
938 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
940 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
944 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
946 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
948 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
951 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
953 ok(rc == -1,
"Text not marked as modified, expected modified! (%d)\n", rc);
958 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
960 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
962 ok(rc == -1,
"Text not marked as modified, expected modified! (%d)\n", rc);
967 for (
i = 0; tested_effects[
i];
i++)
988 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
989 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
990 ok((cf2.dwEffects & tested_effects[
i]) == 0,
991 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x clear\n",
i, cf2.dwEffects, tested_effects[
i]);
995 cf2.dwMask = tested_effects[
i];
998 cf2.dwEffects = tested_effects[
i];
1009 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
1010 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
1011 ok((cf2.dwEffects & tested_effects[
i]) == tested_effects[
i],
1012 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x\n",
i, cf2.dwEffects, tested_effects[
i]);
1021 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
1022 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
1023 ok((cf2.dwEffects & tested_effects[
i]) == 0,
1024 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x clear\n",
i, cf2.dwEffects, tested_effects[
i]);
1033 (cf2.dwMask & tested_effects[
i]) == 0),
1034 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x clear\n",
i, cf2.dwMask, tested_effects[
i]);
1039 for (
i = 0; tested_effects[
i];
i++)
1055 cf2.dwMask = tested_effects[
i];
1058 cf2.dwEffects = tested_effects[
i];
1069 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
1070 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
1071 ok((cf2.dwEffects & tested_effects[
i]) == 0,
1072 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x clear\n",
i, cf2.dwEffects, tested_effects[
i]);
1081 (cf2.dwMask & tested_effects[
i]) == tested_effects[
i]),
1082 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.dwMask, tested_effects[
i]);
1083 ok((cf2.dwEffects & tested_effects[
i]) == tested_effects[
i],
1084 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x\n",
i, cf2.dwEffects, tested_effects[
i]);
1093 (cf2.dwMask & tested_effects[
i]) == 0),
1094 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x clear\n",
i, cf2.dwMask, tested_effects[
i]);
1095 ok((cf2.dwEffects & tested_effects[
i]) == tested_effects[
i],
1096 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x set\n",
i, cf2.dwEffects, tested_effects[
i]);
1122 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.
dwMask,
CFM_BOLD);
1124 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x\n",
i, cf2.
dwEffects,
CFE_BOLD);
1192 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.
dwMask,
CFM_BOLD);
1194 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x\n",
i, cf2.
dwEffects,
CFE_BOLD);
1227 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.
dwMask,
CFM_BOLD);
1229 "%d, cf2.dwEffects == 0x%08lx not expecting effect 0x%08x\n",
i, cf2.
dwEffects,
CFE_BOLD);
1264 "%d, cf2.dwMask == 0x%08lx expected mask 0x%08x\n",
i, cf2.
dwMask,
CFM_BOLD);
1266 "%d, cf2.dwEffects == 0x%08lx expected effect 0x%08x\n",
i, cf2.
dwEffects,
CFE_BOLD);
1269 memset(&cf2, 0,
sizeof(cf2));
1270 cf2.
cbSize =
sizeof(cf2);
1274 memset(&cf2, 0,
sizeof(cf2));
1275 cf2.
cbSize =
sizeof(cf2);
1279 memset(&cf2, 0,
sizeof(cf2));
1280 cf2.
cbSize =
sizeof(cf2);
1284 memset(&cf2, 0,
sizeof(cf2));
1285 cf2.
cbSize =
sizeof(cf2);
1290 memset(&cfW, 0,
sizeof(cfW));
1291 cfW.
cbSize =
sizeof(cfW);
1295 memset(&cfW, 0,
sizeof(cfW));
1296 cfW.
cbSize =
sizeof(cfW);
1300 memset(&cfW, 0,
sizeof(cfW));
1301 cfW.
cbSize =
sizeof(cfW);
1305 memset(&cfW, 0,
sizeof(cfW));
1306 cfW.
cbSize =
sizeof(cfW);
1324 "got %08lx\n", cf2.
dwMask);
1336 "got %08lx\n", cf2.
dwMask);
1348 "got %08lx\n", cf2.
dwMask);
1360 "got %08lx\n", cf2.
dwMask);
1373 "got %08lx\n", cf2.
dwMask);
1385 "got %08lx\n", cf2.
dwMask);
1417#define send_paste(a) _send_paste(__LINE__, (a))
1424 for (retries = 0; retries < 7; retries++)
1426 if (retries)
Sleep(15);
1430 ok_(__FILE__,
line)(0,
"Failed to paste clipboard content\n");
1457 "EM_SETTEXTMODE: using mutually exclusive mode flags - returned: %x\n", rc);
1467 "EM_SETTEXTMODE: changed text mode in control containing text - returned: %x\n", rc);
1484 ok(rc == 0,
"Text marked as modified, expected not modified!\n");
1489 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
1492 ok(rc == -1,
"Text not marked as modified, expected modified! (%d)\n", rc);
1507 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
1514 ok(rc == 0,
"EM_SETTEXTMODE: unable to switch to plain text mode with empty control: returned: %d\n", rc);
1523 ok(
len == 8 ,
"Unexpected text length %u\n",
len);
1544 "two formats found in plain text mode - cf2.dwEffects: %lx cf2test.dwEffects: %lx\n",
1553 ok(rc != 0,
"EM_SETTEXTMODE: changed from plain text to rich text with text in control - returned: %d\n", rc);
1560 ok(rc == 0,
"EM_SETTEXTMODE: unable to change to rich text with empty control - returned: %d\n", rc);
1586 "expected different formats - cf2.dwMask: %lx, cf2test.dwMask: %lx, cf2.dwEffects: %lx, cf2test.dwEffects: %lx\n",
1603 ok(
ret != 0,
"expected non-zero got %ld\n",
ret);
1611 ret &= ~PFM_TABLEROWDELIMITER;
1612 fmt.dwMask &= ~PFM_TABLEROWDELIMITER;
1614 ok(
ret == expectedMask,
"expected %lx got %lx\n", expectedMask,
ret);
1615 ok(
fmt.dwMask == expectedMask,
"expected %lx got %lx\n", expectedMask,
fmt.dwMask);
1618 ok(
fmt.wNumbering == 0,
"got %d\n",
fmt.wNumbering );
1619 ok(
fmt.wNumberingStart == 0,
"got %d\n",
fmt.wNumberingStart );
1620 ok(
fmt.wNumberingStyle == 0,
"got %04x\n",
fmt.wNumberingStyle );
1621 ok(
fmt.wNumberingTab == 0,
"got %d\n",
fmt.wNumberingTab );
1656 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
1659 ok(rc == 0,
"EM_SETCHARFORMAT returned %d instead of 0\n", rc);
1662 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
1678 "two selections' formats differ - cf2.dwMask: %lx, cf2test.dwMask %lx, cf2.dwEffects: %lx, cf2test.dwEffects: %lx\n",
1703 ok(rc == 1,
"EM_SETCHARFORMAT returned %d instead of 1\n", rc);
1731 "Copied text retained formatting - cf2.dwMask: %lx, cf2test.dwMask: %lx, cf2.dwEffects: %lx, cf2test.dwEffects: %lx\n",
1739 static const char text[] =
"Hello. My name is RichEdit!";
1740 static const char text2[] =
"Hello. My name is RichEdit!\r";
1741 static const char text2_after[] =
"Hello. My name is RichEdit!\r\n";
1753 "WM_GETTEXT: settext and gettext differ. strcmp: %d\n",
result);
1758 "WM_GETTEXTLENGTH reports incorrect length %d, expected %d\n",
1771 "WM_GETTEXT: settext and gettext differ. strcmp: %d\n",
result);
1780 "WM_GETTEXT: settext and gettext differ. strcmp: %d\n",
result);
1785 "WM_GETTEXTLENGTH reports incorrect length %d, expected %d\n",
1793 "WM_GETTEXT returned %d, expected 0 or %d\n",
result,
lstrlenA(text2) - 1);
1798 "WM_GETTEXT: settext and gettext differ. strcmp: %d\n",
result);
1806 const char * text1 =
"foo bar\r\nfoo bar";
1807 const char * text2 =
"foo bar\rfoo bar";
1808 const char *
expect =
"bar\rfoo";
1873 skip(
"Skip multibyte character tests on non-Japanese platform\n");
1890 const char * text1 =
"foo bar\r\nfoo bar";
1891 const char * text2 =
"foo bar\rfoo bar";
1892 const char *
expect =
"bar\rfoo";
1903 ok((
result > 0 && gle == 0xdeadbeef) ||
1905 "EM_GETSELTEXT returned %Id gle=%lu\n",
result, gle);
1906 bad_getsel = (gle != 0xdeadbeef);
1908 trace(
"EM_GETSELTEXT is broken, some tests will be ignored\n");
1917 "EM_GETSELTEXT returned %Id gle=%lu\n",
result, gle);
1919 "EM_GETSELTEXT filled %s gle=%lu\n",
buffer, gle);
1927 "EM_GETSELTEXT returned %Id gle=%lu\n",
result, gle);
1929 "EM_GETSELTEXT filled %s gle=%lu\n",
buffer, gle);
1933 skip(
"Skip multibyte character tests on non-Japanese platform\n");
1950 static const char text[] =
"Hello. My name is RichEdit!";
1961 ok(hwndRichEdit !=
NULL,
"class: %s, error: %d\n",
1971 ok(hwndRichEdit !=
NULL,
"class: %s, error: %d\n",
1977 "Incorrect initial options %lx\n",
options);
1987 "EM_SETOPTIONS: Text not changed! s1:%s s2:%s\n",
text,
buffer);
1996 "EM_SETOPTIONS: Text changed! s1:%s s2:%s\n",
text,
buffer);
2001 ok(dwStyle &
ES_READONLY,
"Readonly style not set by EM_SETOPTIONS\n");
2009 "EM_SETOPTIONS: Text changed! s1:%s s2:%s\n",
text,
buffer);
2015 "Options set by SetWindowLong (%lx -> %lx)\n", oldOptions,
options);
2023 text_format.
cbSize =
sizeof(text_format);
2036 ok(link_present,
"URL Case: CFE_LINK not set for [%s].\n",
url);
2040 ok(!link_present,
"Non-URL Case: CFE_LINK set for [%s].\n",
url);
2057 {
"winehq.org",
FALSE},
2058 {
"http://www.winehq.org",
TRUE},
2059 {
"http//winehq.org",
FALSE},
2060 {
"ww.winehq.org",
FALSE},
2061 {
"www.winehq.org",
TRUE},
2062 {
"ftp://192.168.1.1",
TRUE},
2063 {
"ftp//192.168.1.1",
FALSE},
2064 {
"mailto:your@email.com",
TRUE},
2065 {
"prospero:prosperoserver",
TRUE},
2066 {
"telnet:test",
TRUE},
2067 {
"news:newserver",
TRUE},
2068 {
"wais:waisserver",
TRUE}
2076 const char * templates_delim[] = {
2077 "This is some text with X on it",
2078 "This is some text with (X) on it",
2079 "This is some text with X\r on it",
2080 "This is some text with ---X--- on it",
2081 "This is some text with \"X\" on it",
2082 "This is some text with 'X' on it",
2083 "This is some text with 'X' on it",
2084 "This is some text with :X: on it",
2086 "This text ends with X",
2088 "This is some text with X) on it",
2089 "This is some text with X--- on it",
2090 "This is some text with X\" on it",
2091 "This is some text with X' on it",
2092 "This is some text with X: on it",
2094 "This is some text with (X on it",
2095 "This is some text with \rX on it",
2096 "This is some text with ---X on it",
2097 "This is some text with \"X on it",
2098 "This is some text with 'X on it",
2099 "This is some text with :X on it",
2102 const char * templates_non_delim[] = {
2103 "This is some text with |X| on it",
2104 "This is some text with *X* on it",
2105 "This is some text with /X/ on it",
2106 "This is some text with +X+ on it",
2107 "This is some text with %X% on it",
2108 "This is some text with #X# on it",
2109 "This is some text with @X@ on it",
2110 "This is some text with \\X\\ on it",
2111 "This is some text with |X on it",
2112 "This is some text with *X on it",
2113 "This is some text with /X on it",
2114 "This is some text with +X on it",
2115 "This is some text with %X on it",
2116 "This is some text with #X on it",
2117 "This is some text with @X on it",
2118 "This is some text with \\X on it",
2119 "This is some text with _X on it",
2124 const char * templates_xten_delim[] = {
2125 "This is some text with X| on it",
2126 "This is some text with X* on it",
2127 "This is some text with X/ on it",
2128 "This is some text with X+ on it",
2129 "This is some text with X% on it",
2130 "This is some text with X# on it",
2131 "This is some text with X@ on it",
2132 "This is some text with X\\ on it",
2133 "This is some text with X_ on it",
2141 const char * templates_neutral_delim[] = {
2142 "This is some text with X-Y on it",
2143 "This is some text with X--Y on it",
2144 "This is some text with X!Y on it",
2145 "This is some text with X[Y on it",
2146 "This is some text with X]Y on it",
2147 "This is some text with X{Y on it",
2148 "This is some text with X}Y on it",
2149 "This is some text with X(Y on it",
2150 "This is some text with X)Y on it",
2151 "This is some text with X\"Y on it",
2152 "This is some text with X;Y on it",
2153 "This is some text with X:Y on it",
2154 "This is some text with X'Y on it",
2155 "This is some text with X?Y on it",
2156 "This is some text with X<Y on it",
2157 "This is some text with X>Y on it",
2158 "This is some text with X.Y on it",
2159 "This is some text with X,Y on it",
2167 ok(urlRet==0,
"Good wParam: urlRet is: %d\n", urlRet);
2169 ok(urlRet==0,
"Good wParam2: urlRet is: %d\n", urlRet);
2174 ok(urlRet==
E_INVALIDARG,
"Bad wParam2: urlRet is: %d\n", urlRet);
2198 at_pos =
strchr(templates_delim[
j],
'X');
2199 at_offset = at_pos - templates_delim[
j];
2201 buffer[at_offset] =
'\0';
2212 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2214 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2216 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2221 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2223 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2228 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2230 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2232 if (
buffer[end_offset] !=
'\0')
2235 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2236 if (
buffer[end_offset +1] !=
'\0')
2239 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2249 at_pos =
strchr(templates_non_delim[
j],
'X');
2250 at_offset = at_pos - templates_non_delim[
j];
2252 buffer[at_offset] =
'\0';
2263 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2265 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2267 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2270 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2272 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2273 if (
buffer[end_offset] !=
'\0')
2276 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2277 if (
buffer[end_offset +1] !=
'\0')
2280 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2290 at_pos =
strchr(templates_xten_delim[
j],
'X');
2291 at_offset = at_pos - templates_xten_delim[
j];
2293 buffer[at_offset] =
'\0';
2304 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2306 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2308 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2313 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2315 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2317 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset, end_offset +1,
buffer);
2322 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2324 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2326 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset +1,
buffer);
2328 if (
buffer[end_offset +1] !=
'\0')
2331 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset + 2,
buffer);
2332 if (
buffer[end_offset +2] !=
'\0')
2335 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +2, end_offset +3,
buffer);
2341 char * at_pos, * end_pos;
2345 if (!urls[
i].is_url)
continue;
2347 at_pos =
strchr(templates_neutral_delim[
j],
'X');
2348 at_offset = at_pos - templates_neutral_delim[
j];
2350 buffer[at_offset] =
'\0';
2355 end_offset = end_pos -
buffer;
2363 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2365 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2367 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2370 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2372 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2374 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset, end_offset +1,
buffer);
2382 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2384 "CFE_LINK set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2386 "CFE_LINK set in (%d-%d), text: %s\n", end_offset, end_offset +1,
buffer);
2390 hwndRichEdit =
NULL;
2395 for (
i = 0;
i < 2;
i++) {
2399 for (
j = 0;
j < 3;
j++) {
2405 at_pos =
strchr(templates_delim[
j],
'X');
2406 at_offset = at_pos - templates_delim[
j];
2411 for (
u = 0; templates_delim[
j][
u];
u++) {
2412 if (templates_delim[
j][
u] ==
'\r') {
2414 }
else if (templates_delim[
j][
u] !=
'X') {
2417 for (
v = 0; urls[
i].text[
v];
v++) {
2427 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2429 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2431 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2436 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2438 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2443 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2445 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2447 if (
buffer[end_offset] !=
'\0')
2450 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2451 if (
buffer[end_offset +1] !=
'\0')
2454 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2466 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2468 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2470 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2473 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2476 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset+1,
buffer);
2477 ok(
buffer[end_offset],
"buffer \"%s\" ended prematurely. Is it missing a newline character?\n",
buffer);
2478 if (
buffer[end_offset] != 0 &&
buffer[end_offset+1] !=
'\0')
2481 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset+1, end_offset +2,
buffer);
2482 if (
buffer[end_offset +2] !=
'\0')
2485 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +2, end_offset +3,
buffer);
2496 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2498 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2500 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2505 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2507 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2512 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2514 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2516 if (
buffer[end_offset] !=
'\0')
2519 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2520 if (
buffer[end_offset +1] !=
'\0')
2523 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2528 hwndRichEdit =
NULL;
2533 for (
i = 0;
i < 2;
i++) {
2556 at_pos =
strchr(templates_delim[
j],
'X');
2557 at_offset = at_pos - templates_delim[
j];
2559 buffer[at_offset] =
'\0';
2570 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2572 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2574 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2579 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2581 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2586 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2588 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2590 if (
buffer[end_offset] !=
'\0')
2593 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2594 if (
buffer[end_offset +1] !=
'\0')
2597 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2608 at_pos =
strchr(templates_delim[
j],
'X');
2609 at_offset = at_pos - templates_delim[
j];
2624 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2626 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2628 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2633 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2635 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2640 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2642 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2644 if (
buffer[end_offset] !=
'\0')
2647 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2648 if (
buffer[end_offset +1] !=
'\0')
2651 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2662 at_pos =
strchr(templates_delim[
j],
'X');
2663 at_offset = at_pos - templates_delim[
j];
2683 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2685 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2687 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2692 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2694 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2699 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2701 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2703 if (
buffer[end_offset] !=
'\0')
2706 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2707 if (
buffer[end_offset +1] !=
'\0')
2710 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2716 hwndRichEdit =
NULL;
2721 for (
i = 0;
i < 2;
i++) {
2730 at_pos =
strchr(templates_delim[
j],
'X');
2731 at_offset = at_pos - templates_delim[
j];
2743 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2745 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2747 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2752 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2754 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2759 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2761 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2763 if (
buffer[end_offset] !=
'\0')
2766 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2767 if (
buffer[end_offset +1] !=
'\0')
2770 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2781 at_pos =
strchr(templates_delim[
j],
'X');
2782 at_offset = at_pos - templates_delim[
j];
2799 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", 0, 1,
buffer);
2801 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -2, at_offset -1,
buffer);
2803 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset -1, at_offset,
buffer);
2808 "CFE_LINK not set in (%d-%d), text: %s\n", at_offset, at_offset +1,
buffer);
2810 "CFE_LINK not set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2815 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", at_offset, at_offset + 1,
buffer);
2817 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset -1, end_offset,
buffer);
2819 if (
buffer[end_offset] !=
'\0')
2822 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset, end_offset + 1,
buffer);
2823 if (
buffer[end_offset +1] !=
'\0')
2826 "CFE_LINK incorrectly set in (%d-%d), text: %s\n", end_offset +1, end_offset +2,
buffer);
2832 hwndRichEdit =
NULL;
2844 int y_before, y_after;
2849 for (
i = 0;
i < 4;
i++) {
2854 ok(
expr ==
r,
"EM_SCROLL improper return value returned (i == %d). "
2855 "Got 0x%08x, expected 0x%08x\n",
i,
r,
expr);
2856 ok(y_after == 0,
"EM_SCROLL improper scroll. scrolled to line %d, not 1 "
2857 "(i == %d)\n", y_after,
i);
2865 for (
i = 0;
i < 2;
i++) {
2870 "a LONG LINE LONG LINE LONG LINE LONG LINE LONG LINE "
2871 "LONG LINE LONG LINE LONG LINE LONG LINE LONG LINE "
2872 "LONG LINE \nb\nc\nd\ne");
2873 for (
j = 0;
j < 12;
j++)
2883 ok(((
r & 0xffffff00) == 0x00010000) &&
2884 ((
r & 0x000000ff) != 0x00000000),
2885 "EM_SCROLL page down didn't scroll by a small positive number of "
2886 "lines (r == 0x%08x)\n",
r);
2887 ok(y_after > y_before,
"EM_SCROLL page down not functioning "
2888 "(line %d scrolled to line %d\n", y_before, y_after);
2894 ok(((
r & 0xffffff00) == 0x0001ff00),
2895 "EM_SCROLL page up didn't scroll by a small negative number of lines "
2896 "(r == 0x%08x)\n",
r);
2897 ok(y_after < y_before,
"EM_SCROLL page up not functioning (line "
2898 "%d scrolled to line %d\n", y_before, y_after);
2906 ok(
r == 0x00010001,
"EM_SCROLL line down didn't scroll by one line "
2907 "(r == 0x%08x)\n",
r);
2908 ok(y_after -1 == y_before,
"EM_SCROLL line down didn't go down by "
2909 "1 line (%d scrolled to %d)\n", y_before, y_after);
2917 ok(
r == 0x0001ffff,
"EM_SCROLL line up didn't scroll by one line "
2918 "(r == 0x%08x)\n",
r);
2919 ok(y_after +1 == y_before,
"EM_SCROLL line up didn't go up by 1 "
2920 "line (%d scrolled to %d)\n", y_before, y_after);
2930 "EM_SCROLL line up returned indicating movement (0x%08x)\n",
r);
2931 ok(y_before == y_after,
2932 "EM_SCROLL line up beyond top worked (%d)\n", y_after);
2942 "EM_SCROLL page up returned indicating movement (0x%08x)\n",
r);
2943 ok(y_before == y_after,
2944 "EM_SCROLL page up beyond top worked (%d)\n", y_after);
2946 for (
j = 0;
j < 12;
j++)
2954 "EM_SCROLL page down returned indicating movement (0x%08x)\n",
r);
2955 ok(y_before == y_after,
2956 "EM_SCROLL page down beyond bottom worked (%d -> %d)\n",
2964 "EM_SCROLL line down returned indicating movement (0x%08x)\n",
r);
2965 ok(y_before == y_after,
2966 "EM_SCROLL line down beyond bottom worked (%d -> %d)\n",
3007 const char *
text=
"a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n";
3023 memset(&si, 0,
sizeof(si));
3028 "Vertical scrollbar is visible, should be invisible.\n");
3030 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3034 memset(&si, 0,
sizeof(si));
3039 "Vertical scrollbar is visible, should be invisible.\n");
3041 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3045 memset(&si, 0,
sizeof(si));
3050 "Vertical scrollbar is invisible, should be visible.\n");
3052 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3058 memset(&si, 0,
sizeof(si));
3063 "Vertical scrollbar is visible, should be invisible.\n");
3065 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3070 memset(&si, 0,
sizeof(si));
3075 "Vertical scrollbar is visible, should be invisible.\n");
3077 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3081 memset(&si, 0,
sizeof(si));
3086 "Vertical scrollbar is visible, should be invisible.\n");
3088 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3092 memset(&si, 0,
sizeof(si));
3097 "Vertical scrollbar is visible, should be invisible.\n");
3099 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3103 memset(&si, 0,
sizeof(si));
3108 "Vertical scrollbar is visible, should be invisible.\n");
3110 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3119 memset(&si, 0,
sizeof(si));
3124 "Vertical scrollbar is invisible, should be visible.\n");
3126 "reported page/range is %d (%d..%d) expected 0 (0..1)\n",
3130 memset(&si, 0,
sizeof(si));
3135 "Vertical scrollbar is invisible, should be visible.\n");
3137 "reported page/range is %d (%d..%d) expected 0 (0..1)\n",
3141 memset(&si, 0,
sizeof(si));
3146 "Vertical scrollbar is invisible, should be visible.\n");
3148 "reported page/range is %d (%d..%d)\n",
3153 memset(&si, 0,
sizeof(si));
3158 "Vertical scrollbar is invisible, should be visible.\n");
3160 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3165 memset(&si, 0,
sizeof(si));
3170 "Vertical scrollbar is invisible, should be visible.\n");
3172 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3176 memset(&si, 0,
sizeof(si));
3181 "Vertical scrollbar is invisible, should be visible.\n");
3183 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3187 memset(&si, 0,
sizeof(si));
3192 "Vertical scrollbar is invisible, should be visible.\n");
3194 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3198 memset(&si, 0,
sizeof(si));
3203 "Vertical scrollbar is invisible, should be visible.\n");
3205 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3215 memset(&si, 0,
sizeof(si));
3220 "Vertical scrollbar is invisible, should be visible.\n");
3222 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3227 memset(&si, 0,
sizeof(si));
3232 "Vertical scrollbar is invisible, should be visible.\n");
3234 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3239 memset(&si, 0,
sizeof(si));
3244 "Vertical scrollbar is invisible, should be visible.\n");
3246 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3251 memset(&si, 0,
sizeof(si));
3256 "Vertical scrollbar is invisible, should be visible.\n");
3258 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3263 memset(&si, 0,
sizeof(si));
3268 "Vertical scrollbar is invisible, should be visible.\n");
3270 "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
3275 memset(&si, 0,
sizeof(si));
3280 "Vertical scrollbar is visible, should be invisible.\n");
3282 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3290 memset(&si, 0,
sizeof(si));
3295 "Vertical scrollbar is visible, should be invisible.\n");
3297 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3301 memset(&si, 0,
sizeof(si));
3306 "Vertical scrollbar is visible, should be invisible.\n");
3308 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3312 memset(&si, 0,
sizeof(si));
3317 "Vertical scrollbar is visible, should be invisible.\n");
3319 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3323 memset(&si, 0,
sizeof(si));
3328 "Vertical scrollbar is visible, should be invisible.\n");
3330 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3334 memset(&si, 0,
sizeof(si));
3339 "Vertical scrollbar is invisible, should be visible.\n");
3341 "reported page/range is %d (%d..%d)\n",
3346 memset(&si, 0,
sizeof(si));
3351 "Vertical scrollbar is visible, should be invisible.\n");
3353 "reported page/range is %d (%d..%d)\n",
3357 memset(&si, 0,
sizeof(si));
3362 "Vertical scrollbar is visible, should be invisible.\n");
3364 "reported page/range is %d (%d..%d)\n",
3370 memset(&si, 0,
sizeof(si));
3375 "Vertical scrollbar is invisible, should be visible.\n");
3377 "reported page/range is %d (%d..%d)\n",
3381 memset(&si, 0,
sizeof(si));
3386 "Vertical scrollbar is visible, should be invisible.\n");
3388 "reported page/range is %d (%d..%d)\n",
3393 memset(&si, 0,
sizeof(si));
3398 "Vertical scrollbar is invisible, should be visible.\n");
3400 "reported page/range is %d (%d..%d)\n",
3404 memset(&si, 0,
sizeof(si));
3409 "Vertical scrollbar is visible, should be invisible.\n");
3411 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3415 memset(&si, 0,
sizeof(si));
3420 "Vertical scrollbar is invisible, should be visible.\n");
3422 "reported page/range is %d (%d..%d)\n",
3431#define ENABLE_WS_VSCROLL(hwnd) \
3432 SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | WS_VSCROLL)
3433#define DISABLE_WS_VSCROLL(hwnd) \
3434 SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_VSCROLL)
3438 memset(&si, 0,
sizeof(si));
3443 "Vertical scrollbar is invisible, should be visible.\n");
3445 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3450 memset(&si, 0,
sizeof(si));
3455 "Vertical scrollbar is invisible, should be visible.\n");
3457 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3462 memset(&si, 0,
sizeof(si));
3467 "Vertical scrollbar is invisible, should be visible.\n");
3469 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3474 memset(&si, 0,
sizeof(si));
3479 "Vertical scrollbar is invisible, should be visible.\n");
3481 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3486 memset(&si, 0,
sizeof(si));
3491 "Vertical scrollbar is invisible, should be visible.\n");
3493 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3498 memset(&si, 0,
sizeof(si));
3503 "Vertical scrollbar is visible, should be invisible.\n");
3505 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3513 memset(&si, 0,
sizeof(si));
3518 "Vertical scrollbar is visible, should be invisible.\n");
3520 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3524 memset(&si, 0,
sizeof(si));
3529 "Vertical scrollbar is visible, should be invisible.\n");
3531 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3535 memset(&si, 0,
sizeof(si));
3540 "Vertical scrollbar is visible, should be invisible.\n");
3542 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3546 memset(&si, 0,
sizeof(si));
3551 "Vertical scrollbar is visible, should be invisible.\n");
3553 "reported page/range is %d (%d..%d) expected all 0 or nMax=100\n",
3557 memset(&si, 0,
sizeof(si));
3562 "Vertical scrollbar is invisible, should be visible.\n");
3564 "reported page/range is %d (%d..%d)\n",
3569 memset(&si, 0,
sizeof(si));
3574 "Vertical scrollbar is visible, should be invisible.\n");
3576 "reported page/range is %d (%d..%d)\n",
3580 memset(&si, 0,
sizeof(si));
3585 "Vertical scrollbar is visible, should be invisible.\n");
3587 "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
3591 memset(&si, 0,
sizeof(si));
3596 "Vertical scrollbar is invisible, should be visible.\n");
3598 "reported page/range is %d (%d..%d)\n",
3602 memset(&si, 0,
sizeof(si));
3607 "Vertical scrollbar is visible, should be invisible.\n");
3609 "reported page/range is %d (%d..%d)\n",
3615 memset(&si, 0,
sizeof(si));
3620 "Vertical scrollbar is invisible, should be visible.\n");
3622 "reported page/range is %d (%d..%d)\n",
3626 memset(&si, 0,
sizeof(si));
3631 "Vertical scrollbar is visible, should be invisible.\n");
3633 "reported page/range is %d (%d..%d)\n",
3638 memset(&si, 0,
sizeof(si));
3643 "Vertical scrollbar is invisible, should be visible.\n");
3645 "reported page/range is %d (%d..%d)\n",
3667 "WM_SIZE/scrollbar mutual recursion detected, expected none!\n");
3674 "WM_SIZE/scrollbar mutual recursion detected, expected none!\n");
3708 for (
i=0;
i<101;
i++)
3710 for (
i=0;
i<100;
i++)
3713 "EM_SETUNDOLIMIT allowed more than a hundred undo's by default.\n");
3721 "EM_SETUNDOLIMIT allowed undo with UNDOLIMIT set to 0\n");
3731 "EM_SETUNDOLIMIT didn't allow the first undo with UNDOLIMIT set to 2\n");
3734 "EM_SETUNDOLIMIT didn't allow a second undo with UNDOLIMIT set to 2\n");
3737 "EM_SETUNDOLIMIT allowed a third undo with UNDOLIMIT set to 2\n");
3743 "EM_SETUNDOLIMIT returned %d when set to -1, instead of 100\n",
result);
3758 "EM_GETPASSWORDCHAR returned %c by default, instead of NULL\n",
result);
3764 "EM_GETPASSWORDCHAR returned %c (%d) when set to 'x', instead of x (120)\n",
result,
result);
3770 "EM_GETPASSWORDCHAR returned %c (%d) when set to 'x', instead of x (120)\n",
result,
result);
3781 char**
str = (
char**)dwCookie;
3794 const char * TestItem1 =
"TestSomeText";
3795 const char * TestItem2 =
"TestSomeText\r";
3796 const char * TestItem2_after =
"TestSomeText\r\n";
3797 const char * TestItem3 =
"TestSomeText\rSomeMoreText\r";
3798 const char * TestItem3_after =
"TestSomeText\r\nSomeMoreText\r\n";
3799 const char * TestItem4 =
"TestSomeText\n\nTestSomeText";
3800 const char * TestItem4_after =
"TestSomeText\r\n\r\nTestSomeText";
3801 const char * TestItem5 =
"TestSomeText\r\r\nTestSomeText";
3802 const char * TestItem5_after =
"TestSomeText TestSomeText";
3803 const char * TestItem6 =
"TestSomeText\r\r\n\rTestSomeText";
3804 const char * TestItem6_after =
"TestSomeText \r\nTestSomeText";
3805 const char * TestItem7 =
"TestSomeText\r\n\r\r\n\rTestSomeText";
3806 const char * TestItem7_after =
"TestSomeText\r\n \r\nTestSomeText";
3808 const char rtftextA[] =
"{\\rtf sometext}";
3809 const char urtftextA[] =
"{\\urtf sometext}";
3810 const WCHAR rtftextW[] = {
'{',
'\\',
'r',
't',
'f',
' ',
's',
'o',
'm',
'e',
't',
'e',
'x',
't',
'}',0};
3811 const WCHAR urtftextW[] = {
'{',
'\\',
'u',
'r',
't',
'f',
' ',
's',
'o',
'm',
'e',
't',
'e',
'x',
't',
'}',0};
3812 const WCHAR sometextW[] = {
's',
'o',
'm',
'e',
't',
'e',
'x',
't',0};
3814 char buf[1024] = {0};
3815 WCHAR bufW[1024] = {0};
3824#define TEST_SETTEXT(a, b) \
3825 result = SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)a); \
3826 ok (result == 1, "WM_SETTEXT returned %Id instead of 1\n", result); \
3827 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buf); \
3828 ok (result == lstrlenA(buf), \
3829 "WM_GETTEXT returned %Id instead of expected %u\n", \
3830 result, lstrlenA(buf)); \
3831 result = strcmp(b, buf); \
3833 "WM_SETTEXT round trip: strcmp = %Id, text=\"%s\"\n", result, buf);
3852#define TEST_SETTEXTW(a, b) \
3853 result = SendMessageW(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)a); \
3854 ok (result == 1, "WM_SETTEXT returned %Id instead of 1\n", result); \
3855 result = SendMessageW(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)bufW); \
3856 ok (result == lstrlenW(bufW), \
3857 "WM_GETTEXT returned %Id instead of expected %u\n", \
3858 result, lstrlenW(bufW)); \
3859 result = lstrcmpW(b, bufW); \
3860 ok(result == 0, "WM_SETTEXT round trip: strcmp = %Id\n", result);
3876 ok(
result == 1,
"WM_SETTEXT returned %Id, expected 12\n",
result);
3878 ok(
result == 5,
"WM_GETTEXT returned %Id, expected 5\n",
result);
3879 ok(!
strcmp(
buf,
"line1"),
"WM_GETTEXT returned incorrect string '%s'\n",
buf);
3881 ok(
result == 1,
"WM_SETTEXT returned %Id, expected 1\n",
result);
3883 ok(
result == 3,
"WM_GETTEXT returned %Id, expected 3\n",
result);
3884 ok(!
strcmp(
buf,
"ABC"),
"WM_GETTEXT returned incorrect string '%s'\n",
buf);
3895 char**
str = (
char**)dwCookie;
3896 ok(*pcb ==
cb || *pcb == 0,
"cb %ld, *pcb %ld\n",
cb, *pcb);
3908 const char *
p =
buf;
3924 char buf[1024] = {0};
3928 const char * TestItem1 =
"TestSomeText";
3929 const char * TestItem2 =
"TestSomeText\r";
3930 const char * TestItem3 =
"TestSomeText\r\n";
3940 ok(
r == 12,
"streamed text length is %d, expecting 12\n",
r);
3942 "streamed text different, got %s\n",
buf);
3971 ok(
r == 14,
"streamed text length is %d, expecting 14\n",
r);
3973 "streamed text different from, got %s\n",
buf);
4000 ok(
r == 14,
"streamed text length is %d, expecting 14\n",
r);
4002 "streamed text different, got %s\n",
buf);
4012 ok(
r == 14,
"streamed text length is %d, expecting 14\n",
r);
4014 "streamed text different, got %s\n",
buf);
4025 char buf[1024] = {0};
4030 const char * TestItem =
"TestSomeText";
4045 ok(fontTbl !=
NULL,
"missing \\fonttbl section\n");
4050 while(*fontTbl && brackCount)
4054 else if(*fontTbl ==
'}')
4059 ok(brackCount == 0,
"missing closing bracket in \\fonttbl block\n");
4064 ok(*fontTbl ==
'}',
"spurious character '%02x' before \\fonttbl closing bracket\n", *fontTbl);
4068 ok(*fontTbl == 0x0d && *(fontTbl+1) == 0x0a,
"missing crlf after \\fonttbl block\n");
4098 int sel_start, sel_end;
4101 WCHAR TestItem1[] = {
'T',
'e',
's',
't',
4103 'T',
'e',
'x',
't', 0};
4104 WCHAR TestItem1alt[] = {
'T',
'T',
'e',
's',
4110 WCHAR TestItem1altn[] = {
'T',
'T',
'e',
's',
't',
'S',
'o',
'm',
'e',
'T',
'e',
'x',
't',
4111 '\r',
't',
'S',
'o',
'm',
'e',
'T',
'e',
'x',
't',0};
4112 WCHAR TestItem2[] = {
'T',
'e',
's',
't',
4116 const char * TestItem2_after =
"TestSomeText\r\n";
4117 WCHAR TestItem3[] = {
'T',
'e',
's',
't',
4120 '\r',
'\n',
'\r',
'\n', 0};
4121 WCHAR TestItem3alt[] = {
'T',
'e',
's',
't',
4125 WCHAR TestItem3_after[] = {
'T',
'e',
's',
't',
4129 WCHAR TestItem4[] = {
'T',
'e',
's',
't',
4132 '\r',
'\r',
'\n',
'\r',
4134 WCHAR TestItem4_after[] = {
'T',
'e',
's',
't',
4138#define MAX_BUF_LEN 1024
4157 ok (
parent != 0,
"Failed to create parent window\n");
4168 (
LPARAM)
"{\\rtf 1\\par 2\\par 3\\par 4\\par 5\\par 6\\par 7\\par 8\\par 9\\par}");
4175 ok(sel_start == 18,
"Selection start incorrectly at %d\n", sel_start);
4176 ok(sel_end == 18,
"Selection end incorrectly at %d\n", sel_end);
4185 (
LPARAM)
"{\\rtf 1\\par 2\\par 3\\par 4\\par 5\\par 6\\par 7\\par 8\\par 9\\par}");
4190 ok(si.
nPos != 0,
"Position is incorrectly at %d\n", si.
nPos);
4192 ok(sel_start == 18,
"Selection start incorrectly at %d\n", sel_start);
4193 ok(sel_end == 18,
"Selection end incorrectly at %d\n", sel_end);
4200 (
LPARAM)
"{\\rtf 1\\par 2\\par 3\\par 4\\par 5\\par 6\\par 7\\par 8\\par 9\\par}");
4201 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4205 ok(si.
nPos == 0,
"Position is incorrectly at %d\n", si.
nPos);
4207 ok(sel_start == 0,
"Selection start incorrectly at %d\n", sel_start);
4208 ok(sel_end == 0,
"Selection end incorrectly at %d\n", sel_end);
4219 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4222 "EM_GETTEXTEX results not what was set by EM_SETTEXTEX\n");
4235 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4238 "EM_GETTEXTEX results not what was set by EM_SETTEXTEX\n");
4242 ok(
strcmp((
const char *)
buf, TestItem2_after) == 0,
4243 "WM_GETTEXT did *not* see \\r converted to \\r\\n pairs.\n");
4254 "EM_GETTEXTEX results not what was set by EM_SETTEXTEX\n");
4269 "EM_GETTEXTEX results not what was set by EM_SETTEXTEX\n");
4281 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4284 "EM_SETTEXTEX did not convert properly\n");
4295 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4298 "EM_SETTEXTEX did not convert properly\n");
4309 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4312 "EM_SETTEXTEX did not convert properly\n");
4319 "EM_SETTEXTEX returned %d, instead of 1\n",
result);
4320 ok(!
buf[0],
"EM_SETTEXTEX with NULL lParam should clear rich edit.\n");
4325 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4334 "EM_SETTEXTEX with NULL lParam to replace selection"
4335 " with no text should return 0. Got %i\n",
4341 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4352 "EM_SETTEXTEX with NULL lParam to replace selection"
4353 " with no text should return 0. Got %i\n",
4356 "EM_SETTEXTEX to replace selection with more text failed: %i.\n",
4368 trace(
"EM_STREAMOUT produced:\n%s\n", (
char *)
buf);
4380 ok(
result == 1,
"EM_SETTEXTEX returned %d, expected 1\n",
result);
4383 "EM_GETTEXTEX results not what was set by EM_SETTEXTEX\n");
4399 ok(
lstrcmpA(bufACP,
"not unicode") == 0,
"'%s' != 'not unicode'\n", bufACP);
4410 trace(
"EM_STREAMOUT produced:\n%s\n", (
char *)
buf);
4428 ok_w3(
"Expected \"%s\" or \"%s\", got \"%s\"\n", TestItem1alt, TestItem1altn,
buf);
4456 "EM_GETTEXTEX results not what was set by EM_SETTEXTEX when"
4457 " using ST_SELECTION and non-Unicode\n");
4469 ok(!
strcmp(bufACP,
"richtext"),
"expected 'richtext' but got '%s'\n", bufACP);
4480 ok(!
strcmp(bufACP,
"morerichtext"),
"expected 'morerichtext' but got '%s'\n", bufACP);
4487 ok(
result == 15,
"EM_SETTEXTEX: Test UTF8 with BOM returned %d, expected 15\n",
result);
4489 ok(
result == 0,
"EM_SETTEXTEX: Test UTF8 with BOM set wrong text: Result: %s\n", bufACP);
4495 ok(
result == 15,
"EM_SETTEXTEX: Test UTF8 with BOM returned %d, expected 15\n",
result);
4497 ok(
result == 0,
"EM_SETTEXTEX: Test UTF8 with BOM set wrong text: Result: %s\n", bufACP);
4501 skip(
"Skip multibyte character tests on non-Japanese platform\n");
4510 ok(
result == 5,
"WM_GETTEXT incorrectly returned %d, expected 5\n",
result);
4512 "EM_SETTEXTEX: Test multibyte character set wrong text: Result: %s\n", bufACP);
4515 setText.codepage =
CP_ACP;
4517 ok(
result == 1,
"EM_SETTEXTEX incorrectly returned %d, expected 1\n",
result);
4519 ok(
result == 5,
"WM_GETTEXT incorrectly returned %d, expected 5\n",
result);
4521 "EM_SETTEXTEX: Test multibyte character set wrong text: Result: %s\n", bufACP);
4525 setText.codepage =
CP_ACP;
4529 ok(
result == 5,
"WM_GETTEXT incorrectly returned %d, expected 5\n",
result);
4531 "EM_SETTEXTEX: Test multibyte character set wrong text: Result: %s\n", bufACP);
4541 ok(
result == 1,
"EM_SETTEXTEX incorrectly returned %d, expected 1\n",
result);
4543 ok(
result == 5,
"WM_GETTEXT incorrectly returned %d, expected 5\n",
result);
4544 ok(!
strcmp(bufACP,
"line1"),
"EM_SETTEXTEX: Test single-line text: Result: %s\n", bufACP);
4564 "EM_LIMITTEXT: set to 100, returned: %d, expected: 100\n",
ret);
4570 "EM_LIMITTEXT: set to 0, returned: %d, expected: 65536\n",
ret);
4576 "EM_LIMITTEXT: set to -1, returned: %d, expected: -1\n",
ret);
4582 "EM_LIMITTEXT: set to -2, returned: %d, expected: -2\n",
ret);
4590 int i, selBegin, selEnd, len1, len2;
4592 char text[1024 + 1];
4598 ok(32767 ==
i,
"EM_EXLIMITTEXT: expected: %d, actual: %d\n", 32767,
i);
4604 ok(textlimit ==
i,
"EM_EXLIMITTEXT: expected: %d, actual: %d\n", textlimit,
i);
4610 ok(textlimit ==
i,
"EM_EXLIMITTEXT: expected: %d, actual: %d\n", textlimit,
i);
4615 ok(65536 ==
i,
"EM_EXLIMITTEXT: expected: %d, actual: %d\n", 65536,
i);
4617 textlimit =
sizeof(
text)-1;
4626 len1 = selEnd - selBegin;
4633 len2 = selEnd - selBegin;
4636 "EM_EXLIMITTEXT: Change Expected\nOld Length: %d, New Length: %d, Limit: %d\n",
4644 len1 = selEnd - selBegin;
4647 "EM_EXLIMITTEXT: Change Expected\nOld Length: %d, New Length: %d, Limit: %d\n",
4655 len2 = selEnd - selBegin;
4658 "EM_EXLIMITTEXT: No Change Expected\nOld Length: %d, New Length: %d, Limit: %d\n",
4664 text[textlimit] = 0;
4676 text[textlimit] = 0;
4681 ok(10 ==
i,
"expected 10 chars\n");
4683 ok(10 ==
i,
"EM_EXLIMITTEXT: expected: %d, actual: %d\n", 10,
i);
4687 ok(0 ==
i,
"WM_CHAR wasn't processed\n");
4690 ok(10 ==
i,
"expected 10 chars, got %i\n",
i);
4692 ok(10 ==
i,
"EM_EXLIMITTEXT: expected: %d, actual: %d\n", 10,
i);
4697 ok(0 ==
i,
"WM_CHAR wasn't processed\n");
4700 ok(10 ==
i,
"expected 10 chars, got %i\n",
i);
4702 ok(10 ==
i,
"EM_EXLIMITTEXT: expected: %d, actual: %d\n", 10,
i);
4709 ok(0 ==
i,
"WM_CHAR wasn't processed\n");
4711 ok(0 ==
i,
"WM_CHAR wasn't processed\n");
4714 ok(1 ==
i,
"expected 1 chars, got %i instead\n",
i);
4725 ok(32767 ==
i,
"expected: %d, actual: %d\n", 32767,
i);
4729 ok(50000 ==
i,
"expected: %d, actual: %d\n", 50000,
i);
4755 returnedCF2A.
cbSize =
sizeof(returnedCF2A);
4763 "EM_GETCHARFORMAT: Returned wrong font on test 1. Sent: %s, Returned: %s\n",
4770 "EM_GETCHARFORMAT: Returned wrong font on test 2. Sent: %s, Returned: %s\n",
4777 "EM_GETCHARFORMAT: Returned wrong font on test 3. Sent: %s, Returned: %s\n",
4782 ZeroMemory(&returnedCF2A,
sizeof(returnedCF2A));
4783 ZeroMemory(&sentLogFont,
sizeof(sentLogFont));
4784 returnedCF2A.
cbSize =
sizeof(returnedCF2A);
4790 "EM_GETCHARFORMAT: Returned wrong font on test 4. Sent: NULL, Returned: %s. Expected \"System\".\n",returnedCF2A.
szFaceName);
4801 const char**
str = (
const char**)dwCookie;
4816#define open_clipboard(hwnd) open_clipboard_(__LINE__, hwnd)
4851 WCHAR TestItem1[] = {
'T',
'e',
's',
't',
4853 'T',
'e',
'x',
't', 0};
4854 WCHAR TestItem2[] = {
'T',
'e',
's',
't',
4856 'O',
't',
'h',
'e',
'r',
4857 'T',
'e',
'x',
't', 0};
4858 const char* streamText =
"hello world";
4876 "EM_GETMODIFY returned non-zero, instead of zero on create\n");
4882 "EM_GETMODIFY returned zero, instead of non-zero on EM_SETMODIFY\n");
4888 "EM_GETMODIFY returned non-zero, instead of zero on EM_SETMODIFY\n");
4895 "EM_GETMODIFY returned non-zero, instead of zero on setting font\n");
4902 "EM_GETMODIFY returned zero, instead of non-zero on setting text\n");
4908 "EM_GETMODIFY returned zero, instead of non-zero on undo after setting text\n");
4916 "EM_GETMODIFY returned non-zero, instead of zero when setting text while not keeping undo stack\n");
4923 "EM_GETMODIFY returned non-zero for WM_SETTEXT\n");
4930 "EM_GETMODIFY returned non-zero, instead of zero for WM_CLEAR\n");
4939 "EM_GETMODIFY returned zero, instead of non-zero when replacing text\n");
4948 "EM_GETMODIFY returned zero, instead of non-zero when pasting identical text\n");
4958 "EM_GETMODIFY returned zero, instead of non-zero when pasting different text\n");
4966 "EM_GETMODIFY returned zero, instead of non-zero for WM_CHAR\n");
4974 "EM_GETMODIFY returned zero, instead of non-zero for backspace\n");
4984 ok(
result == 1,
"EM_SETCHARFORMAT returned %Id instead of 1\n",
result);
4987 "EM_GETMODIFY returned zero, instead of non-zero for EM_SETCHARFORMAT\n");
4998 "EM_GETMODIFY returned zero, instead of non-zero for EM_SETPARAFORMAT\n");
5008 "EM_GETMODIFY returned zero, instead of non-zero for EM_STREAM\n");
5027 ok(
strcmp(
str,
"alive") == 0,
"unexpected clipboard content: %s\n",
str);
5045 {5, 10, 10, 5, 10 },
5046 {15, 17, 17, 15, 17 },
5048 {0, 100, 18, 0, 18 },
5050 {-1, 1, 17, 17, 17 },
5058 {-1, -1, 17, 17, 17 },
5059 {-4, -5, 17, 17, 17 },
5061 {0, -1, 18, 0, 18 },
5062 {17, -5, 18, 17, 18 },
5063 {18, -3, 17, 17, 17 },
5065 {15, 19, 18, 15, 18 },
5066 {19, 15, 18, 15, 18 },
5068 {17, 18, 18, 17, 18 },
5069 {17, 50, 18, 17, 18 },
5106 skip(
"Skip multibyte character tests on non-Japanese platform\n");
5120 ok(!
strcmp(bufA,
"ef\x8e\xf0g"),
"EM_GETSELTEXT return incorrect string\n");
5122 ok(cr.
cpMin == 4,
"Selection start incorrectly: %ld expected 4\n", cr.
cpMin);
5123 ok(cr.
cpMax == 8,
"Selection end incorrectly: %ld expected 8\n", cr.
cpMax);
5149 const char textwithlines[] =
"This is a text\n"
5151 "I expect this text\n"
5152 "to be\nlarge\nenough\n";
5158 ok(oldY < curY, "oldY %d >= curY %
d\
n", oldY, curY);
5161static void test_EM_SETSEL(void)
5163 char buffA[32] = {0};
5164 HWND hwndRichEdit = new_richedit(NULL);
5166 const int num_tests = ARRAY_SIZE(exsetsel_tests);
5168 /* sending some text to the window */
5169 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"testing
selection");
5170 /* 01234567890123456*/
5173 for (i = 0; i < num_tests; i++) {
5174 check_EM_SETSEL(hwndRichEdit, &exsetsel_tests[i], i);
5177 SendMessageA(hwndRichEdit, EM_SETSEL, 17, 18);
5179 SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffA);
5182 if (!is_lang_japanese)
5186 int sel_start, sel_end;
5189 /* Test with multibyte character */
5190 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"abcdef\x8e\xf0ghijk
");
5191 /* 012345 6 78901 */
5192 result = SendMessageA(hwndRichEdit, EM_SETSEL, 4, 8);
5194 result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffA);
5195 ok(!strcmp(buffA, "ef\x8e\xf0g
"), "EM_GETSELTEXT return incorrect
string\
n");
5196 result = SendMessageA(hwndRichEdit, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
5197 ok(sel_start == 4, "Selection
start incorrectly: %
d expected 4\
n", sel_start);
5198 ok(sel_end == 8, "Selection
end incorrectly: %
d expected 8\
n", sel_end);
5201 check_EM_SETSEL_multiline(hwndRichEdit);
5203 DestroyWindow(hwndRichEdit);
5206static void test_EM_REPLACESEL(int redraw)
5208 HWND hwndRichEdit = new_richedit(NULL);
5209 char buffer[1024] = {0};
5213 CHAR rtfstream[] = "{\\rtf1 TestSomeText}
";
5214 CHAR urtfstream[] = "{\\urtf1 TestSomeText}
";
5216 /* sending some text to the window */
5217 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"testing
selection");
5218 /* 01234567890123456*/
5221 /* FIXME add more tests */
5222 SendMessageA(hwndRichEdit, EM_SETSEL, 7, 17);
5223 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, 0);
5225 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5226 r = strcmp(buffer, "testing
");
5227 ok(0 == r, "expected %
d, got %d\n
", 0, r);
5229 DestroyWindow(hwndRichEdit);
5231 hwndRichEdit = new_richedit(NULL);
5234 SendMessageA(hwndRichEdit, WM_SETREDRAW, redraw, 0);
5236 /* Test behavior with carriage returns and newlines */
5237 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5238 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"RichEdit1
");
5240 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5241 r = strcmp(buffer, "RichEdit1
");
5242 ok(0 == r, "expected %
d, got %d\n
", 0, r);
5244 getText.codepage = CP_ACP;
5245 getText.flags = GT_DEFAULT;
5246 getText.lpDefaultChar = NULL;
5247 getText.lpUsedDefChar = NULL;
5248 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5249 ok(strcmp(buffer, "RichEdit1
") == 0,
5252 /* Test number of lines reported after EM_REPLACESEL */
5253 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5256 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5257 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"RichEdit1\r
");
5259 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5260 r = strcmp(buffer, "RichEdit1\r\n
");
5261 ok(0 == r, "expected %
d, got %d\n
", 0, r);
5263 getText.codepage = CP_ACP;
5264 getText.flags = GT_DEFAULT;
5265 getText.lpDefaultChar = NULL;
5266 getText.lpUsedDefChar = NULL;
5267 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5268 ok(strcmp(buffer, "RichEdit1\r
") == 0,
5271 /* Test number of lines reported after EM_REPLACESEL */
5272 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5275 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5276 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"RichEdit1\r\n
");
5279 /* Test number of lines reported after EM_REPLACESEL */
5280 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5283 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5288 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5289 r = strcmp(buffer, "RichEdit1\r\n
");
5290 ok(0 == r, "expected %
d, got %d\n
", 0, r);
5292 getText.codepage = CP_ACP;
5293 getText.flags = GT_DEFAULT;
5294 getText.lpDefaultChar = NULL;
5295 getText.lpUsedDefChar = NULL;
5296 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5297 ok(strcmp(buffer, "RichEdit1\r
") == 0,
5300 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5305 /* The following tests show that richedit should handle the special \r\r\n
5306 sequence by turning it into a single space on insertion. However,
5307 EM_REPLACESEL on WinXP returns the number of characters in the original
5311 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5312 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"\r\r
");
5314 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5319 /* Test the actual string */
5321 getText.codepage = CP_ACP;
5322 getText.flags = GT_DEFAULT;
5323 getText.lpDefaultChar = NULL;
5324 getText.lpUsedDefChar = NULL;
5325 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5326 ok(strcmp(buffer, "\r\r
") == 0,
5329 /* Test number of lines reported after EM_REPLACESEL */
5330 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5333 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5334 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"\r\r\n
");
5336 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5341 /* Test the actual string */
5343 getText.codepage = CP_ACP;
5344 getText.flags = GT_DEFAULT;
5345 getText.lpDefaultChar = NULL;
5346 getText.lpUsedDefChar = NULL;
5347 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5348 ok(strcmp(buffer, " ") == 0,
5351 /* Test number of lines reported after EM_REPLACESEL */
5352 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5355 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5356 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"\r\r\r\r\r\n\r\r\r
");
5358 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5363 /* Test the actual string */
5365 getText.codepage = CP_ACP;
5366 getText.flags = GT_DEFAULT;
5367 getText.lpDefaultChar = NULL;
5368 getText.lpUsedDefChar = NULL;
5369 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5370 ok(strcmp(buffer, "\r\r\r \r\r\r
") == 0,
5373 /* Test number of lines reported after EM_REPLACESEL */
5374 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5377 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5378 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"\r\r\n\r\n
");
5380 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5385 /* Test the actual string */
5387 getText.codepage = CP_ACP;
5388 getText.flags = GT_DEFAULT;
5389 getText.lpDefaultChar = NULL;
5390 getText.lpUsedDefChar = NULL;
5391 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5392 ok(strcmp(buffer, " \
r") == 0,
5395 /* Test number of lines reported after EM_REPLACESEL */
5396 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5399 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5400 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"\r\r\n\r\r
");
5402 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5407 /* Test the actual string */
5409 getText.codepage = CP_ACP;
5410 getText.flags = GT_DEFAULT;
5411 getText.lpDefaultChar = NULL;
5412 getText.lpUsedDefChar = NULL;
5413 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5414 ok(strcmp(buffer, " \r\r
") == 0,
5417 /* Test number of lines reported after EM_REPLACESEL */
5418 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5421 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5422 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"\rX\r\n\r\r
");
5424 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5429 /* Test the actual string */
5431 getText.codepage = CP_ACP;
5432 getText.flags = GT_DEFAULT;
5433 getText.lpDefaultChar = NULL;
5434 getText.lpUsedDefChar = NULL;
5435 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5436 ok(strcmp(buffer, "\rX\r\r\r
") == 0,
5439 /* Test number of lines reported after EM_REPLACESEL */
5440 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5443 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5444 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"\n\n
");
5446 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5451 /* Test the actual string */
5453 getText.codepage = CP_ACP;
5454 getText.flags = GT_DEFAULT;
5455 getText.lpDefaultChar = NULL;
5456 getText.lpUsedDefChar = NULL;
5457 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5458 ok(strcmp(buffer, "\r\r
") == 0,
5461 /* Test number of lines reported after EM_REPLACESEL */
5462 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5465 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5466 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"\n\n\n\n\r\r\r\r\n
");
5468 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5473 /* Test the actual string */
5475 getText.codepage = CP_ACP;
5476 getText.flags = GT_DEFAULT;
5477 getText.lpDefaultChar = NULL;
5478 getText.lpUsedDefChar = NULL;
5479 SendMessageA(hwndRichEdit, EM_GETTEXTEX, (WPARAM)&getText, (LPARAM)buffer);
5480 ok(strcmp(buffer, "\r\r\r\r\r\r
") == 0,
5483 /* Test number of lines reported after EM_REPLACESEL */
5484 r = SendMessageA(hwndRichEdit, EM_GETLINECOUNT, 0, 0);
5487 /* Test with multibyte character */
5488 if (!is_lang_japanese)
5492 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5493 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"abc\x8e\xf0
");
5495 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5499 r = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5500 ok(!strcmp(buffer, "abc\x8e\xf0
"), "WM_GETTEXT returned incorrect string\n
");
5503 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5504 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"{\\rtf abc\x8e\xf0}
");
5506 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5510 r = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5511 todo_wine ok(!strcmp(buffer, "abc\x8e\xf0
"), "WM_GETTEXT returned incorrect string\n
");
5515 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5516 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)rtfstream);
5518 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5522 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5523 todo_wine ok(!strcmp(buffer, "TestSomeText
"), "WM_GETTEXT returned incorrect string\n
");
5525 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5526 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)urtfstream);
5528 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5532 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5533 todo_wine ok(!strcmp(buffer, "TestSomeText
"), "WM_GETTEXT returned incorrect string\n
");
5535 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"Wine
");
5536 SendMessageA(hwndRichEdit, EM_SETSEL, 1, 2);
5537 todo_wine r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)rtfstream);
5539 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5543 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5544 todo_wine ok(!strcmp(buffer, "WTestSomeTextne
"), "WM_GETTEXT returned incorrect string\n
");
5546 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"{\\rtf1 Wine}
");
5547 SendMessageA(hwndRichEdit, EM_SETSEL, 1, 2);
5548 todo_wine r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)rtfstream);
5550 r = SendMessageA(hwndRichEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
5554 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5555 todo_wine ok(!strcmp(buffer, "WTestSomeTextne
"), "WM_GETTEXT returned incorrect string\n
");
5558 /* This is needed to avoid interfering with keybd_event calls
5559 * on other tests that simulate keyboard events. */
5560 SendMessageA(hwndRichEdit, WM_SETREDRAW, TRUE, 0);
5562 DestroyWindow(hwndRichEdit);
5564 /* Single-line richedit */
5565 hwndRichEdit = new_richedit_with_style(NULL, 0);
5566 r = SendMessageA(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)"line1\r\nline2
");
5568 r = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5570 ok(!strcmp(buffer, "line1
"), "WM_GETTEXT returned incorrect
string '%s'\
n", buffer);
5571 DestroyWindow(hwndRichEdit);
5574/* Native riched20 inspects the keyboard state (e.g. GetKeyState)
5575 * to test the state of the modifiers (Ctrl/Alt/Shift).
5577 * Therefore Ctrl-<key> keystrokes need to be simulated with
5578 * keybd_event or by using SetKeyboardState to set the modifiers
5579 * and SendMessage to simulate the keystrokes.
5581static LRESULT send_ctrl_key(HWND hwnd, UINT key)
5584 hold_key(VK_CONTROL);
5585 result = SendMessageA(hwnd, WM_KEYDOWN, key, 1);
5586 release_key(VK_CONTROL);
5590static void test_WM_PASTE(void)
5593 char buffer[1024] = {0};
5594 const char* text1 = "testing paste\r
";
5595 const char* text1_step1 = "testing paste\r\ntesting paste\r\n
";
5596 const char* text1_after = "testing paste\r\n
";
5597 const char* text2 = "testing paste\r\rtesting paste
";
5598 const char* text2_after = "testing paste\r\n\r\ntesting paste
";
5599 const char* text3 = "testing paste\r\npaste\r\ntesting paste
";
5600 HWND hwndRichEdit = new_richedit(NULL);
5602 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text1);
5603 SendMessageA(hwndRichEdit, EM_SETSEL, 0, 14);
5605 send_ctrl_key(hwndRichEdit, 'C'); /* Copy */
5606 SendMessageA(hwndRichEdit, EM_SETSEL, 14, 14);
5607 send_ctrl_key(hwndRichEdit, 'V'); /* Paste */
5608 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5609 /* Pasted text should be visible at this step */
5610 ok(strcmp(text1_step1, buffer) == 0, "1:Ctrl-
V %s\n
", wine_dbgstr_a(buffer));
5612 send_ctrl_key(hwndRichEdit, 'Z'); /* Undo */
5613 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5614 /* Text should be the same as before (except for \r -> \r\n conversion) */
5615 ok(strcmp(text1_after, buffer) == 0, "1:Ctrl-
Z %s\n
", wine_dbgstr_a(buffer));
5617 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2);
5618 SendMessageA(hwndRichEdit, EM_SETSEL, 8, 13);
5619 send_ctrl_key(hwndRichEdit, 'C'); /* Copy */
5620 SendMessageA(hwndRichEdit, EM_SETSEL, 14, 14);
5621 send_ctrl_key(hwndRichEdit, 'V'); /* Paste */
5622 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5623 /* Pasted text should be visible at this step */
5624 ok(strcmp(text3, buffer) == 0, "2:Ctrl-
V %s\n
", wine_dbgstr_a(buffer));
5625 send_ctrl_key(hwndRichEdit, 'Z'); /* Undo */
5626 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5627 /* Text should be the same as before (except for \r -> \r\n conversion) */
5628 ok(strcmp(text2_after, buffer) == 0, "2:Ctrl-
Z %s\n
", wine_dbgstr_a(buffer));
5629 send_ctrl_key(hwndRichEdit, 'Y'); /* Redo */
5630 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5631 /* Text should revert to post-paste state */
5632 ok(strcmp(buffer,text3) == 0, "2:Ctrl-
Y %s\n
", wine_dbgstr_a(buffer));
5634 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5635 /* Send WM_CHAR to simulate Ctrl-V */
5636 SendMessageA(hwndRichEdit, WM_CHAR, 22,
5637 (MapVirtualKeyA('V', MAPVK_VK_TO_VSC) << 16) | 1);
5638 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5639 /* Shouldn't paste because pasting is handled by WM_KEYDOWN */
5640 ok(strcmp(buffer, "") == 0, "3:Ctrl-
V %s\n
", wine_dbgstr_a(buffer));
5642 /* Send keystrokes with WM_KEYDOWN after setting the modifiers
5643 * with SetKeyboard state. */
5645 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5646 /* Simulates paste (Ctrl-V) */
5647 hold_key(VK_CONTROL);
5648 SendMessageA(hwndRichEdit, WM_KEYDOWN, 'V',
5649 (MapVirtualKeyA('V', MAPVK_VK_TO_VSC) << 16) | 1);
5650 release_key(VK_CONTROL);
5651 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5652 ok(strcmp(buffer, "paste
") == 0, "VK:Ctrl-
V %s\n
", wine_dbgstr_a(buffer));
5654 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text1);
5655 SendMessageA(hwndRichEdit, EM_SETSEL, 0, 7);
5656 /* Simulates copy (Ctrl-C) */
5657 hold_key(VK_CONTROL);
5658 SendMessageA(hwndRichEdit, WM_KEYDOWN, 'C',
5659 (MapVirtualKeyA('C', MAPVK_VK_TO_VSC) << 16) | 1);
5660 release_key(VK_CONTROL);
5661 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5662 send_paste(hwndRichEdit);
5663 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5664 ok(strcmp(buffer, "testing
") == 0, "VK:Ctrl-
C %s\n
", wine_dbgstr_a(buffer));
5666 /* Cut with WM_KEYDOWN to simulate Ctrl-X */
5667 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"cut
");
5668 /* Simulates select all (Ctrl-A) */
5669 hold_key(VK_CONTROL);
5670 SendMessageA(hwndRichEdit, WM_KEYDOWN, 'A',
5671 (MapVirtualKeyA('A', MAPVK_VK_TO_VSC) << 16) | 1);
5672 /* Simulates select cut (Ctrl-X) */
5673 SendMessageA(hwndRichEdit, WM_KEYDOWN, 'X',
5674 (MapVirtualKeyA('X', MAPVK_VK_TO_VSC) << 16) | 1);
5675 release_key(VK_CONTROL);
5676 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5677 ok(strcmp(buffer, "") == 0, "VK:Ctrl-
A,
X %s\n
", wine_dbgstr_a(buffer));
5678 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, 0);
5679 send_paste(hwndRichEdit);
5680 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5681 ok(strcmp(buffer, "cut\r\n
") == 0, "VK:paste %s\n
", wine_dbgstr_a(buffer));
5682 /* Simulates undo (Ctrl-Z) */
5683 hold_key(VK_CONTROL);
5684 SendMessageA(hwndRichEdit, WM_KEYDOWN, 'Z',
5685 (MapVirtualKeyA('Z', MAPVK_VK_TO_VSC) << 16) | 1);
5686 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5687 ok(strcmp(buffer, "") == 0, "VK:Ctrl-
Z %s\n
", wine_dbgstr_a(buffer));
5688 /* Simulates redo (Ctrl-Y) */
5689 SendMessageA(hwndRichEdit, WM_KEYDOWN, 'Y',
5690 (MapVirtualKeyA('Y', MAPVK_VK_TO_VSC) << 16) | 1);
5691 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5692 ok(strcmp(buffer, "cut\r\n
") == 0, "VK:Ctrl-
Y %s\n
", wine_dbgstr_a(buffer));
5693 release_key(VK_CONTROL);
5695 /* Copy multiline text to clipboard for future use */
5696 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text3);
5697 SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1);
5698 SendMessageA(hwndRichEdit, WM_COPY, 0, 0);
5699 SendMessageA(hwndRichEdit, EM_SETSEL, 0, 0);
5701 /* Paste into read-only control */
5702 result = SendMessageA(hwndRichEdit, EM_SETREADONLY, TRUE, 0);
5703 ok(result, "ro:
set failed\n
");
5704 SendMessageA(hwndRichEdit, WM_PASTE, 0, 0);
5705 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5706 ok(strcmp(buffer, text3) == 0, "ro:paste %s\n
", wine_dbgstr_a(buffer));
5708 /* Cut from read-only control */
5709 SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1);
5710 SendMessageA(hwndRichEdit, WM_CUT, 0, 0);
5711 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5712 ok(strcmp(buffer, text3) == 0, "ro:cut %s\n
", wine_dbgstr_a(buffer));
5714 /* FIXME: Wine doesn't flush Ole clipboard when window is destroyed so do it manually */
5715 OleFlushClipboard();
5716 DestroyWindow(hwndRichEdit);
5718 /* Paste multi-line text into single-line control */
5719 hwndRichEdit = new_richedit_with_style(NULL, 0);
5720 send_paste(hwndRichEdit);
5721 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
5722 ok(strcmp(buffer, "testing paste
") == 0, "multi:paste %s\n
", wine_dbgstr_a(buffer));
5723 DestroyWindow(hwndRichEdit);
5726static void test_EM_FORMATRANGE(void)
5728 int r, i, tpp_x, tpp_y;
5730 HWND hwndRichEdit = new_richedit(NULL);
5732 BOOL skip_non_english;
5733 static const struct {
5734 const char *string; /* The string */
5735 int first; /* First 'pagebreak', 0 for don't care */
5736 int second; /* Second 'pagebreak', 0 for don't care */
5738 {"WINE
wine", 0, 0},
5739 {"WINE wineWine
", 0, 0},
5740 {"WINE\r\nwine\r\nwine
", 5, 10},
5741 {"WINE\r\nWINEwine\r\nWINEwine
", 5, 14},
5742 {"WINE\r\n\r\nwine\r\nwine
", 5, 6}
5745 skip_non_english = (PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH);
5746 if (skip_non_english)
5747 skip("Skipping some
tests on non-English platform\n
");
5749 hdc = GetDC(hwndRichEdit);
5750 ok(hdc != NULL, "Could not
get HDC\n
");
5752 /* Calculate the twips per pixel */
5753 tpp_x = 1440 / GetDeviceCaps(hdc, LOGPIXELSX);
5754 tpp_y = 1440 / GetDeviceCaps(hdc, LOGPIXELSY);
5756 /* Test the simple case where all the text fits in the page rect. */
5757 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"a");
5758 fr.hdc = fr.hdcTarget = hdc;
5759 fr.rc.top = fr.rcPage.top = fr.rc.left = fr.rcPage.left = 0;
5760 fr.rc.right = fr.rcPage.right = 500 * tpp_x;
5761 fr.rc.bottom = fr.rcPage.bottom = 500 * tpp_y;
5764 r = SendMessageA(hwndRichEdit, EM_FORMATRANGE, FALSE, (LPARAM)&fr);
5767 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"ab");
5768 fr.rc.bottom = fr.rcPage.bottom;
5769 r = SendMessageA(hwndRichEdit, EM_FORMATRANGE, FALSE, (LPARAM)&fr);
5772 SendMessageA(hwndRichEdit, EM_FORMATRANGE, FALSE, 0);
5774 for (i = 0; i < ARRAY_SIZE(fmtstrings); i++)
5776 GETTEXTLENGTHEX gtl;
5780 winetest_push_context("%
d", i);
5781 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)fmtstrings[i].string);
5783 gtl.flags = GTL_NUMCHARS | GTL_PRECISE;
5784 gtl.codepage = CP_ACP;
5785 len = SendMessageA(hwndRichEdit, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0);
5787 /* Get some size information for the string */
5788 GetTextExtentPoint32A(hdc, fmtstrings[i].string, strlen(fmtstrings[i].string), &stringsize);
5790 /* Define the box to be half the width needed and a bit larger than the height.
5791 * Changes to the width means we have at least 2 pages. Changes to the height
5792 * is done so we can check the changing of fr.rc.bottom.
5794 fr.hdc = fr.hdcTarget = hdc;
5795 fr.rc.top = fr.rcPage.top = fr.rc.left = fr.rcPage.left = 0;
5796 fr.rc.right = fr.rcPage.right = (stringsize.cx / 2) * tpp_x;
5797 fr.rc.bottom = fr.rcPage.bottom = (stringsize.cy + 10) * tpp_y;
5799 r = SendMessageA(hwndRichEdit, EM_FORMATRANGE, TRUE, 0);
5801 ok(r == len, "Expected %
d, got %d\n
", len, r);
5804 /* We know that the page can't hold the full string. See how many characters
5805 * are on the first one
5809 r = SendMessageA(hwndRichEdit, EM_FORMATRANGE, TRUE, (LPARAM)&fr);
5811 if (! skip_non_english)
5812 ok(fr.rc.bottom == (stringsize.cy * tpp_y), "Expected bottom to be %ld, got %ld\n
", (stringsize.cy * tpp_y), fr.rc.bottom);
5814 if (fmtstrings[i].first)
5816 ok(r == fmtstrings[i].first, "Expected %
d, got %d\n
", fmtstrings[i].first, r);
5819 ok(r < len, "Expected < %
d, got %d\n
", len, r);
5821 /* Do another page */
5823 r = SendMessageA(hwndRichEdit, EM_FORMATRANGE, TRUE, (LPARAM)&fr);
5824 if (fmtstrings[i].second)
5826 ok(r == fmtstrings[i].second, "Expected %
d, got %d\n
", fmtstrings[i].second, r);
5828 else if (! skip_non_english)
5829 ok (r < len, "Expected < %
d, got %d\n
", len, r);
5831 /* There is at least one more page, but we don't care */
5833 r = SendMessageA(hwndRichEdit, EM_FORMATRANGE, TRUE, 0);
5835 ok(r == len, "Expected %
d, got %d\n
", len, r);
5837 winetest_pop_context();
5840 ReleaseDC(NULL, hdc);
5841 DestroyWindow(hwndRichEdit);
5844static int nCallbackCount = 0;
5846static DWORD CALLBACK EditStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff,
5849 const char text[] = {'t','e','s','t'};
5851 if (sizeof(text) <= cb)
5853 if ((int)dwCookie != nCallbackCount)
5859 memcpy (pbBuff, text, sizeof(text));
5860 *pcb = sizeof(text);
5867 return 1; /* indicates callback failed */
5870static DWORD CALLBACK test_EM_STREAMIN_esCallback(DWORD_PTR dwCookie,
5875 const char** str = (const char**)dwCookie;
5876 int size = strlen(*str);
5882 memcpy(pbBuff, *str, *pcb);
5888static DWORD CALLBACK test_EM_STREAMIN_esCallback_UTF8Split(DWORD_PTR dwCookie,
5893 DWORD *phase = (DWORD *)dwCookie;
5896 static const char first[] = "\xef\xbb\xbf\xc3\x96\xc3
";
5897 *pcb = sizeof(first) - 1;
5898 memcpy(pbBuff, first, *pcb);
5899 }else if(*phase == 1){
5900 static const char second[] = "\x8f\xc3\x8b
";
5901 *pcb = sizeof(second) - 1;
5902 memcpy(pbBuff, second, *pcb);
5911static DWORD CALLBACK test_EM_STREAMIN_null_bytes(DWORD_PTR cookie, BYTE *buf, LONG size, LONG *written)
5913 DWORD *phase = (DWORD *)cookie;
5917 static const char first[] = "{\\rtf1\\
ansi{Th\0is
";
5918 *written = sizeof(first);
5919 memcpy(buf, first, *written);
5921 else if (*phase == 1)
5923 static const char second[] = " is
a test}}
";
5924 *written = sizeof(second);
5925 memcpy(buf, second, *written);
5935struct StringWithLength {
5940/* This callback is used to handled the null characters in a string. */
5941static DWORD CALLBACK test_EM_STREAMIN_esCallback2(DWORD_PTR dwCookie,
5946 struct StringWithLength* str = (struct StringWithLength*)dwCookie;
5947 int size = str->length;
5953 memcpy(pbBuff, str->buffer, *pcb);
5954 str->buffer += *pcb;
5955 str->length -= *pcb;
5960static void test_EM_STREAMIN(void)
5962 HWND hwndRichEdit = new_richedit(NULL);
5966 char buffer[1024] = {0}, tmp[16];
5971 const char * streamText0 = "{\\rtf1\\fi100\\li200\\rtlpar\\qr TestSomeText}
";
5972 const char * streamText0a = "{\\rtf1\\fi100\\li200\\rtlpar\\qr TestSomeText\\par}
";
5973 const char * streamText0b = "{\\rtf1 TestSomeText\\par\\par}
";
5976 const char * streamText1 =
5977 "{\\rtf1\\
ansi\\ansicpg1252\\deff0\\deflang12298{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0
System;}}\r\n
"
5978 "\\viewkind4\\uc1\\pard\\f0\\fs17 TestSomeText\\par\r\n
"
5981 /* In richedit 2.0 mode, this should NOT be accepted, unlike 1.0 */
5982 const char * streamText2 =
5983 "{{\\colortbl;\\red0\\green255\\blue102;\\red255\\green255\\blue255;
"
5984 "\\red170\\green255\\blue255;\\red255\\green238\\blue0;\\red51\\green255
"
5985 "\\blue221;\\red238\\green238\\blue238;}\\tx0 \\tx424 \\tx848 \\tx1272
"
5986 "\\tx1696 \\tx2120 \\tx2544 \\tx2968 \\tx3392 \\tx3816 \\tx4240 \\tx4664
"
5987 "\\tx5088 \\tx5512 \\tx5936 \\tx6360 \\tx6784 \\tx7208 \\tx7632 \\tx8056
"
5988 "\\tx8480 \\tx8904 \\tx9328 \\tx9752 \\tx10176 \\tx10600 \\tx11024
"
5989 "\\tx11448 \\tx11872 \\tx12296 \\tx12720 \\tx13144 \\cf2 RichEdit1\\
line }
";
5991 const char * streamText3 = "RichEdit1
";
5993 const char * streamTextUTF8BOM = "\xef\xbb\xbfTestUTF8WithBOM
";
5995 const char * streamText4 =
5996 "This text just needs to be
long enough to cause run to be
split onto
"
5998 "handled properly.\0
";
6000 const WCHAR UTF8Split_exp[4] = {0xd6, 0xcf, 0xcb, 0};
6002 int length4 = strlen(streamText4) + 1;
6003 struct StringWithLength cookieForStream4 = {
6005 (char *)streamText4,
6008 const WCHAR streamText5[] = { 'T', 'e', 's', 't', 'S', 'o', 'm', 'e', 'T', 'e', 'x', 't' };
6009 int length5 = ARRAY_SIZE(streamText5);
6010 struct StringWithLength cookieForStream5 = {
6011 sizeof(streamText5),
6012 (char *)streamText5,
6015 /* Minimal test without \par at the end */
6016 es.dwCookie = (DWORD_PTR)&streamText0;
6018 es.pfnCallback = test_EM_STREAMIN_esCallback;
6019 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
6020 ok(result == 12, "got %
Id,
expected %d\n
", result, 12);
6022 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6025 result = strcmp (buffer,"TestSomeText
");
6029 /* Show that para fmts are ignored */
6032 result = SendMessageA(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM)&range);
6033 memset(&fmt, 0xcc, sizeof(fmt));
6034 fmt.cbSize = sizeof(fmt);
6035 result = SendMessageA(hwndRichEdit, EM_GETPARAFORMAT, 0, (LPARAM)&fmt);
6036 ok(fmt.dxStartIndent == 0, "got %ld\n
", fmt.dxStartIndent);
6037 ok(fmt.dxOffset == 0, "got %ld\n
", fmt.dxOffset);
6038 ok(fmt.wAlignment == PFA_LEFT, "got %d\n
", fmt.wAlignment);
6039 ok((fmt.wEffects & PFE_RTLPARA) == 0, "got %x\n
", fmt.wEffects);
6041 /* Native richedit 2.0 ignores last \par */
6043 es.dwCookie = (DWORD_PTR)&ptr;
6045 es.pfnCallback = test_EM_STREAMIN_esCallback;
6046 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
6047 ok(result == 12, "got %
Id,
expected %d\n
", result, 12);
6049 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6052 result = strcmp (buffer,"TestSomeText
");
6056 /* This time para fmts are processed */
6059 result = SendMessageA(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM)&range);
6060 memset(&fmt, 0xcc, sizeof(fmt));
6061 fmt.cbSize = sizeof(fmt);
6062 result = SendMessageA(hwndRichEdit, EM_GETPARAFORMAT, 0, (LPARAM)&fmt);
6063 ok(fmt.dxStartIndent == 300, "got %ld\n
", fmt.dxStartIndent);
6064 ok(fmt.dxOffset == -100, "got %ld\n
", fmt.dxOffset);
6065 ok(fmt.wAlignment == PFA_RIGHT, "got %d\n
", fmt.wAlignment);
6066 ok((fmt.wEffects & PFE_RTLPARA) == PFE_RTLPARA, "got %x\n
", fmt.wEffects);
6068 /* Native richedit 2.0 ignores last \par, next-to-last \par appears */
6069 es.dwCookie = (DWORD_PTR)&streamText0b;
6071 es.pfnCallback = test_EM_STREAMIN_esCallback;
6072 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
6073 ok(result == 13, "got %
Id,
expected %d\n
", result, 13);
6075 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6078 result = strcmp (buffer,"TestSomeText\r\n
");
6083 /* Show that when using SFF_SELECTION the last \par is not ignored. */
6085 es.dwCookie = (DWORD_PTR)&ptr;
6087 es.pfnCallback = test_EM_STREAMIN_esCallback;
6088 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
6089 ok(result == 12, "got %
Id,
expected %d\n
", result, 12);
6091 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6094 result = strcmp (buffer,"TestSomeText
");
6101 result = SendMessageA(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM)&range);
6102 ok (result == 13, "got %Id\n
", result);
6105 es.dwCookie = (DWORD_PTR)&ptr;
6107 es.pfnCallback = test_EM_STREAMIN_esCallback;
6109 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SFF_SELECTION | SF_RTF, (LPARAM)&es);
6110 ok(result == 13, "got %
Id,
expected 13\
n", result);
6112 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6115 result = strcmp (buffer,"TestSomeText\r\n
");
6120 es.dwCookie = (DWORD_PTR)&streamText1;
6122 es.pfnCallback = test_EM_STREAMIN_esCallback;
6123 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
6124 ok(result == 12, "got %
Id,
expected %d\n
", result, 12);
6126 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6129 result = strcmp (buffer,"TestSomeText
");
6134 es.dwCookie = (DWORD_PTR)&streamText2;
6136 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
6137 ok(result == 0, "got %
Id,
expected %d\n
", result, 0);
6139 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6145 es.dwCookie = (DWORD_PTR)&streamText3;
6147 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
6148 ok(result == 0, "got %
Id,
expected %d\n
", result, 0);
6150 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6156 es.dwCookie = (DWORD_PTR)&streamTextUTF8BOM;
6158 es.pfnCallback = test_EM_STREAMIN_esCallback;
6159 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es);
6160 ok(result == 18, "got %
Id,
expected %d\n
", result, 18);
6162 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6165 result = strcmp (buffer,"TestUTF8WithBOM
");
6171 es.dwCookie = (DWORD_PTR)&phase;
6173 es.pfnCallback = test_EM_STREAMIN_esCallback_UTF8Split;
6174 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es);
6175 ok(result == 8, "got %Id\n
", result);
6177 len = WideCharToMultiByte(CP_ACP, 0, UTF8Split_exp, -1, tmp, sizeof(tmp), NULL, NULL);
6179 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6180 ok(result + 1 == len,
6182 result = memcmp (buffer, tmp, result);
6187 es.dwCookie = (DWORD_PTR)&cookieForStream4;
6189 es.pfnCallback = test_EM_STREAMIN_esCallback2;
6190 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es);
6191 ok(result == length4, "got %
Id,
expected %d\n
", result, length4);
6193 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6194 ok (result == length4,
6198 es.dwCookie = (DWORD_PTR)&cookieForStream5;
6200 es.pfnCallback = test_EM_STREAMIN_esCallback2;
6201 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT | SF_UNICODE, (LPARAM)&es);
6202 ok(result == sizeof(streamText5), "got %
Id,
expected %u\n
", result, (UINT)sizeof(streamText5));
6204 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6205 ok (result == length5,
6209 DestroyWindow(hwndRichEdit);
6211 /* Single-line richedit */
6212 hwndRichEdit = new_richedit_with_style(NULL, 0);
6213 ptr = "line1\r\nline2
";
6214 es.dwCookie = (DWORD_PTR)&ptr;
6216 es.pfnCallback = test_EM_STREAMIN_esCallback;
6217 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es);
6218 ok(result == 12, "got %
Id,
expected %d\n
", result, 12);
6219 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6220 ok (!strcmp(buffer, "line1
"),
6223 /* Test 0-bytes inside text */
6224 hwndRichEdit = new_richedit_with_style(NULL, 0);
6226 es.dwCookie = (DWORD_PTR)&phase;
6228 es.pfnCallback = test_EM_STREAMIN_null_bytes;
6229 result = SendMessageA(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
6230 ok(result == 16, "got %
Id,
expected %d\n
", result, 16);
6231 result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6235static void test_EM_StreamIn_Undo(void)
6237 /* The purpose of this test is to determine when a EM_StreamIn should be
6238 * undoable. This is important because WM_PASTE currently uses StreamIn and
6239 * pasting should always be undoable but streaming isn't always.
6242 * StreamIn plain text without SFF_SELECTION.
6243 * StreamIn plain text with SFF_SELECTION set but a zero-length selection
6244 * StreamIn plain text with SFF_SELECTION and a valid, normal selection
6245 * StreamIn plain text with SFF_SELECTION and a backwards-selection (from>to)
6246 * Feel free to add tests for other text modes or StreamIn things.
6250 HWND hwndRichEdit = new_richedit(NULL);
6253 char buffer[1024] = {0};
6254 const char randomtext[] = "Some
text";
6256 es.pfnCallback = EditStreamCallback;
6258 /* StreamIn, no SFF_SELECTION */
6259 es.dwCookie = nCallbackCount;
6260 SendMessageA(hwndRichEdit,EM_EMPTYUNDOBUFFER, 0,0);
6261 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)randomtext);
6262 SendMessageA(hwndRichEdit, EM_SETSEL,0,0);
6263 SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es);
6264 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6265 result = strcmp (buffer,"test");
6269 result = SendMessageA(hwndRichEdit, EM_CANUNDO, 0, 0);
6270 ok (result == FALSE,
6273 /* StreamIn, SFF_SELECTION, but nothing selected */
6274 es.dwCookie = nCallbackCount;
6275 SendMessageA(hwndRichEdit,EM_EMPTYUNDOBUFFER, 0,0);
6276 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)randomtext);
6277 SendMessageA(hwndRichEdit, EM_SETSEL,0,0);
6278 SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT|SFF_SELECTION, (LPARAM)&es);
6279 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6280 result = strcmp (buffer,"testSome
text");
6284 result = SendMessageA(hwndRichEdit, EM_CANUNDO, 0, 0);
6287 "should
create an undo\n
");
6289 /* StreamIn, SFF_SELECTION, with a selection */
6290 es.dwCookie = nCallbackCount;
6291 SendMessageA(hwndRichEdit,EM_EMPTYUNDOBUFFER, 0,0);
6292 SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)randomtext);
6293 SendMessageA(hwndRichEdit, EM_SETSEL,4,5);
6294 SendMessageA(hwndRichEdit, EM_STREAMIN, SF_TEXT|SFF_SELECTION, (LPARAM)&es);
6295 SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
6296 result = strcmp (buffer,"Sometesttext
");
6300 result = SendMessageA(hwndRichEdit, EM_CANUNDO, 0, 0);
6303 "should
create an undo\n
");
6305 DestroyWindow(hwndRichEdit);
6308static BOOL is_em_settextex_supported(HWND hwnd)
6310 SETTEXTEX stex = { ST_DEFAULT, CP_ACP };
6311 return SendMessageA(hwnd, EM_SETTEXTEX, (WPARAM)&stex, 0) != 0;
6314static void test_unicode_conversions(void)
6316 static const WCHAR tW[] = {'t',0};
6317 static const WCHAR teW[] = {'t','e',0};
6318 static const WCHAR textW[] = {'t','e','s','t',0};
6319 static const char textA[] = "test";
6323 int em_settextex_supported, ret;
6325#define set_textA(hwnd, wm_set_text, txt) \
6327 SETTEXTEX stex = { ST_DEFAULT, CP_ACP }; \
6328 WPARAM wparam = (wm_set_text == WM_SETTEXT) ? 0 : (WPARAM)&stex; \
6329 assert(wm_set_text == WM_SETTEXT || wm_set_text == EM_SETTEXTEX); \
6330 ret = SendMessageA(hwnd, wm_set_text, wparam, (LPARAM)txt); \
6333#define expect_textA(hwnd, wm_get_text, txt) \
6335 GETTEXTEX gtex = { 64, GT_DEFAULT, CP_ACP, NULL, NULL }; \
6336 WPARAM wparam = (wm_get_text == WM_GETTEXT) ? 64 : (WPARAM)>ex; \
6337 assert(wm_get_text == WM_GETTEXT || wm_get_text == EM_GETTEXTEX); \
6338 memset(bufA, 0xAA, sizeof(bufA)); \
6339 ret = SendMessageA(hwnd, wm_get_text, wparam, (LPARAM)bufA); \
6341 ret = lstrcmpA(bufA, txt); \
6345#define set_textW(hwnd, wm_set_text, txt) \
6347 SETTEXTEX stex = { ST_DEFAULT, 1200 }; \
6348 WPARAM wparam = (wm_set_text == WM_SETTEXT) ? 0 : (WPARAM)&stex; \
6349 assert(wm_set_text == WM_SETTEXT || wm_set_text == EM_SETTEXTEX); \
6350 ret = SendMessageW(hwnd, wm_set_text, wparam, (LPARAM)txt); \
6353#define expect_textW(hwnd, wm_get_text, txt) \
6355 GETTEXTEX gtex = { 64, GT_DEFAULT, 1200, NULL, NULL }; \
6356 WPARAM wparam = (wm_get_text == WM_GETTEXT) ? 64 : (WPARAM)>ex; \
6357 assert(wm_get_text == WM_GETTEXT || wm_get_text == EM_GETTEXTEX); \
6358 memset(bufW, 0xAA, sizeof(bufW)); \
6359 ret = SendMessageW(hwnd, wm_get_text, wparam, (LPARAM)bufW); \
6361 ret = lstrcmpW(bufW, txt); \
6364#define expect_empty(hwnd, wm_get_text) \
6366 GETTEXTEX gtex = { 64, GT_DEFAULT, CP_ACP, NULL, NULL }; \
6367 WPARAM wparam = (wm_get_text == WM_GETTEXT) ? 64 : (WPARAM)>ex; \
6368 assert(wm_get_text == WM_GETTEXT || wm_get_text == EM_GETTEXTEX); \
6369 memset(bufA, 0xAA, sizeof(bufA)); \
6370 ret = SendMessageA(hwnd, wm_get_text, wparam, (LPARAM)bufA); \
6371 ok(!ret, "empty richedit should
return 0, got %d\n
", ret); \
6375 hwnd = CreateWindowExA(0, "RichEdit20W
", NULL, WS_POPUP,
6376 0, 0, 200, 60, 0, 0, 0, 0);
6379 ret = IsWindowUnicode(hwnd);
6380 ok(ret, "RichEdit20W should be unicode under NT\n
");
6382 /* EM_SETTEXTEX is supported starting from version 3.0 */
6383 em_settextex_supported = is_em_settextex_supported(hwnd);
6384 trace("EM_SETTEXTEX is %ssupported on
this platform\n
",
6385 em_settextex_supported ? "" : "NOT ");
6387 expect_empty(hwnd, WM_GETTEXT);
6388 expect_empty(hwnd, EM_GETTEXTEX);
6390 ret = SendMessageA(hwnd, WM_CHAR, textW[0], 0);
6392 expect_textA(hwnd, WM_GETTEXT, "t");
6393 expect_textA(hwnd, EM_GETTEXTEX, "t");
6394 expect_textW(hwnd, EM_GETTEXTEX, tW);
6396 ret = SendMessageA(hwnd, WM_CHAR, textA[1], 0);
6398 expect_textA(hwnd, WM_GETTEXT, "te
");
6399 expect_textA(hwnd, EM_GETTEXTEX, "te
");
6400 expect_textW(hwnd, EM_GETTEXTEX, teW);
6402 set_textA(hwnd, WM_SETTEXT, NULL);
6403 expect_empty(hwnd, WM_GETTEXT);
6404 expect_empty(hwnd, EM_GETTEXTEX);
6406 set_textA(hwnd, WM_SETTEXT, textA);
6407 expect_textA(hwnd, WM_GETTEXT, textA);
6408 expect_textA(hwnd, EM_GETTEXTEX, textA);
6409 expect_textW(hwnd, EM_GETTEXTEX, textW);
6411 if (em_settextex_supported)
6413 set_textA(hwnd, EM_SETTEXTEX, textA);
6414 expect_textA(hwnd, WM_GETTEXT, textA);
6415 expect_textA(hwnd, EM_GETTEXTEX, textA);
6416 expect_textW(hwnd, EM_GETTEXTEX, textW);
6419 set_textW(hwnd, WM_SETTEXT, textW);
6420 expect_textW(hwnd, WM_GETTEXT, textW);
6421 expect_textA(hwnd, WM_GETTEXT, textA);
6422 expect_textW(hwnd, EM_GETTEXTEX, textW);
6423 expect_textA(hwnd, EM_GETTEXTEX, textA);
6425 if (em_settextex_supported)
6427 set_textW(hwnd, EM_SETTEXTEX, textW);
6428 expect_textW(hwnd, WM_GETTEXT, textW);
6429 expect_textA(hwnd, WM_GETTEXT, textA);
6430 expect_textW(hwnd, EM_GETTEXTEX, textW);
6431 expect_textA(hwnd, EM_GETTEXTEX, textA);
6433 DestroyWindow(hwnd);
6435 hwnd = CreateWindowExA(0, "RichEdit20A
", NULL, WS_POPUP,
6436 0, 0, 200, 60, 0, 0, 0, 0);
6439 ret = IsWindowUnicode(hwnd);
6440 ok(!ret, "RichEdit20A should
NOT be unicode\n
");
6442 set_textA(hwnd, WM_SETTEXT, textA);
6443 expect_textA(hwnd, WM_GETTEXT, textA);
6444 expect_textA(hwnd, EM_GETTEXTEX, textA);
6445 expect_textW(hwnd, EM_GETTEXTEX, textW);
6447 if (em_settextex_supported)
6449 set_textA(hwnd, EM_SETTEXTEX, textA);
6450 expect_textA(hwnd, WM_GETTEXT, textA);
6451 expect_textA(hwnd, EM_GETTEXTEX, textA);
6452 expect_textW(hwnd, EM_GETTEXTEX, textW);
6455 set_textW(hwnd, WM_SETTEXT, textW);
6456 expect_textW(hwnd, WM_GETTEXT, textW);
6457 expect_textA(hwnd, WM_GETTEXT, textA);
6458 expect_textW(hwnd, EM_GETTEXTEX, textW);
6459 expect_textA(hwnd, EM_GETTEXTEX, textA);
6461 if (em_settextex_supported)
6463 set_textW(hwnd, EM_SETTEXTEX, textW);
6464 expect_textW(hwnd, WM_GETTEXT, textW);
6465 expect_textA(hwnd, WM_GETTEXT, textA);
6466 expect_textW(hwnd, EM_GETTEXTEX, textW);
6467 expect_textA(hwnd, EM_GETTEXTEX, textA);
6469 DestroyWindow(hwnd);
6472static void test_WM_CHAR(void)
6476 const char * char_list = "abc\rabc\r
";
6477 const char * expected_content_single = "abcabc
";
6478 const char * expected_content_multi = "abc\r\nabc\r\n
";
6479 char buffer[64] = {0};
6482 /* single-line control must IGNORE carriage returns */
6483 hwnd = CreateWindowExA(0, "RichEdit20W
", NULL, WS_POPUP,
6484 0, 0, 200, 60, 0, 0, 0, 0);
6486 disable_beep( hwnd );
6489 while (*p != '\0') {
6490 SendMessageA(hwnd, WM_KEYDOWN, *p, 1);
6491 ret = SendMessageA(hwnd, WM_CHAR, *p, 1);
6505 0, 0, 200, 60, 0, 0, 0, 0);
6512 ok(
ret == 0,
"WM_CHAR('%c') ret=%d\n", *
p,
ret);
6519 ok(
ret == 0,
"WM_GETTEXT recovered incorrect string!\n");
6529 const char * base_string =
"base string";
6531 const char * test_string_after =
"a";
6532 const char * test_string_2 =
"a\rtest\rstring";
6537 0, 0, 200, 60, 0, 0, 0, 0);
6576 ok(
ret == 0,
"WM_GETTEXT recovered incorrect string!\n");
6582 0, 0, 200, 60, 0, 0, 0, 0);
6638 "GTL_DEFAULT gave %i, expected %i\n",
ret,
lstrlenA(test_string_2));
6644 "GTL_NUMCHARS gave %i, expected %i\n",
ret,
lstrlenA(test_string_2));
6650 "GTL_NUMBYTES gave %i, expected %i\n",
ret,
lstrlenA(test_string_2)*2);
6656 "GTL_PRECISE gave %i, expected %i\n",
ret,
lstrlenA(test_string_2)*2);
6662 "GTL_NUMCHAR | GTL_PRECISE gave %i, expected %i\n",
ret,
lstrlenA(test_string_2));
6668 "GTL_NUMCHARS | GTL_NUMBYTES gave %i, expected %li\n",
ret,
E_INVALIDARG);
6695 const char text[] =
"foo bar\n";
6704 ok (
parent != 0,
"Failed to create parent window\n");
6713 ok(
ret == eventMask,
"failed to set event mask\n");
6719 ok(
ret ==
TRUE,
"failed to set text\n");
6780 int sel_start, sel_end;
6788 ok (
parent != 0,
"Failed to create parent window\n");
6840 ok(sel_start == 1 && sel_end == 1,
6841 "selections is incorrectly at (%d,%d)\n", sel_start, sel_end);
6846 ok(sel_start == 1 && sel_end == 1,
6847 "selections is incorrectly at (%d,%d)\n", sel_start, sel_end);
6853 ok(sel_start == 1 && sel_end == 1,
6854 "selections is incorrectly at (%d,%d)\n", sel_start, sel_end);
6861#define CURSOR_CLIENT_X 5
6862#define CURSOR_CLIENT_Y 5
6901 memset(&junk_enlink, 0x23,
sizeof(junk_enlink));
6925 "%s test %i: Expected lParam 0x%Ix got 0x%Ix\n",
6933 "%s test %i: Expected enlink to remain unmodified\n",
desc,
i);
6942 POINT orig_cursor_pos;
6953 link_notify_tests[] =
7014 ok(
parent != 0,
"Failed to create parent window\n");
7017 ok(
hwnd != 0,
"Failed to create edit window\n");
7045 link_notify_tests[
i].notifies);
7061 0, 0, 200, 60, 0, 0, 0, 0);
7068 ok (
result ==
FALSE,
"Undo operation successful with nothing to undo.\n");
7072 ok (
result ==
FALSE,
"Redo operation successful with nothing undone.\n");
7081 ok (
result ==
FALSE,
"Can redo before anything is undone.\n");
7083 ok (
result ==
TRUE,
"Cannot undo typed characters.\n");
7085 ok (
result ==
TRUE,
"EM_UNDO Failed to undo typed characters.\n");
7090 ok (
result == 0,
"expected '%s' but got '%s'\n",
"one two three",
buffer);
7093 ok (
result ==
TRUE,
"Cannot undo typed characters.\n");
7095 ok (
result ==
TRUE,
"Failed to undo typed characters.\n");
7103 ok (
result ==
FALSE,
"Redo buffer should have been cleared by typing.\n");
7108 ok (
result ==
TRUE,
"Failed to undo typed characters.\n");
7111 ok (
result == 0,
"expected '%s' but got '%s'\n",
"one two three",
buffer);
7119 ok (
result ==
FALSE,
"Redo buffer should have been cleared by typing.\n");
7124 ok (
result ==
TRUE,
"Failed to undo typed characters.\n");
7139 ok (
result ==
TRUE,
"Failed to undo typed characters.\n");
7144 ok (
result ==
TRUE,
"Failed to undo typed characters.\n");
7147 ok (
result == 0,
"expected '%s' but got '%s'\n",
"abcd",
buffer);
7158 ok (
result ==
TRUE,
"Failed to undo typed characters.\n");
7161 ok (
result == 0,
"expected '%s' but got '%s'\n",
"one two three",
buffer);
7163 ok (
result ==
TRUE,
"Failed to undo typed characters.\n");
7212 int sel_start, sel_end;
7213 const WCHAR textW[] = {
'o',
'n',
'e',
' ',
't',
'w',
'o',
'X',
't',
'h',
'r',
'e',
'e',0};
7226 ok(sel_start == sel_end,
"Selection should be empty\n");
7227 ok(sel_start == 4,
"Cursor is at %d instead of %d\n", sel_start, 4);
7232 ok(sel_start == sel_end,
"Selection should be empty\n");
7233 ok(sel_start == 9,
"Cursor is at %d instead of %d\n", sel_start, 9);
7238 ok(sel_start == sel_end,
"Selection should be empty\n");
7239 ok(sel_start == 4,
"Cursor is at %d instead of %d\n", sel_start, 4);
7244 ok(sel_start == sel_end,
"Selection should be empty\n");
7245 ok(sel_start == 0,
"Cursor is at %d instead of %d\n", sel_start, 0);
7252 ok(sel_start == sel_end,
"Selection should be empty\n");
7253 ok(sel_start == 9,
"Cursor is at %d instead of %d\n", sel_start, 9);
7260 ok(sel_start == sel_end,
"Selection should be empty\n");
7261 ok(sel_start == 9,
"Cursor is at %d instead of %d\n", sel_start, 9);
7271 ok(sel_start == sel_end,
"Selection should be empty\n");
7272 ok(sel_start == 8,
"Cursor is at %d instead of %d\n", sel_start, 8);
7291 ok(sel_start == sel_end,
"Selection should be empty\n");
7292 ok(sel_start == 8,
"Cursor is at %d instead of %d\n", sel_start, 8);
7299 DWORD sel_start, sel_end;
7313 sel_start = sel_end = 0xdeadbeefUL;
7315 ok(sel_start == sel_end,
"expected sel length to be 0, got %lu.\n", sel_end - sel_start);
7316 ok(sel_start == 6,
"expected sel_start to be %u, got %lu.\n", 6, sel_start);
7320 sel_start = sel_end = 0xdeadbeefUL;
7322 ok(sel_start == sel_end,
"expected sel length to be 0, got %lu.\n", sel_end - sel_start);
7323 ok(sel_start == 11,
"expected sel_start to be %u, got %lu.\n", 11, sel_start);
7327 sel_start = sel_end = 0xdeadbeefUL;
7329 ok(sel_start == sel_end,
"expected sel length to be 0, got %lu.\n", sel_end - sel_start);
7330 ok(sel_start == 12,
"expected sel_start to be %u, got %lu.\n", 12, sel_start);
7334 sel_start = sel_end = 0xdeadbeefUL;
7336 ok(sel_start == sel_end,
"expected sel length to be 0, got %lu.\n", sel_end - sel_start);
7337 ok(sel_start == 11,
"expected sel_start to be %u, got %lu.\n", 11, sel_start);
7354 (
LPARAM)
"one two three four five six seven\reight");
7359 ok(
result == 34,
"expected character index of 34 but got %d\n",
result);
7365 ok(
result == 34,
"expected character index of 34 but got %d\n",
result);
7370 ok(
result == 33,
"expected character index of 33 but got %d\n",
result);
7375 ok(
result == 39,
"expected character index of 39 but got %d\n",
result);
7392 ok(
result == 39,
"expected character index of 39 but got %d\n",
result);
7401 const char *
text =
"Must be long enough to test line wrapping";
7411 ok(
res,
"WM_SETTEXT failed.\n");
7413 ok(
pos,
"pos=%d indicating no word wrap when it is expected.\n",
pos);
7415 ok(
lines > 1,
"Line was expected to wrap (lines=%d).\n",
lines);
7419 ok(
pos,
"pos=%d indicating no word wrap when it is expected.\n",
pos);
7427 ok(
res,
"WM_SETTEXT failed.\n");
7429 ok(!
pos,
"pos=%d indicating word wrap when none is expected.\n",
pos);
7431 ok(
lines == 1,
"Line wasn't expected to wrap (lines=%d).\n",
lines);
7435 ok(!
pos,
"pos=%d indicating word wrap when none is expected.\n",
pos);
7442 ok(
res,
"WM_SETTEXT failed.\n");
7444 ok(!
pos,
"pos=%d indicating word wrap when none is expected.\n",
pos);
7448 ok(!
pos,
"pos=%d indicating word wrap when none is expected.\n",
pos);
7456 ok(
res,
"WM_SETTEXT failed.\n");
7458 ok(!
pos,
"pos=%d indicating word wrap when none is expected.\n",
pos);
7462 ok(!
pos,
"pos=%d indicating word wrap when none is expected.\n",
pos);
7466 ok(
res,
"EM_SETTARGETDEVICE failed (returned %d).\n",
res);
7468 ok(!
pos,
"pos=%d indicating word wrap when none is expected.\n",
pos);
7471 ok(
res,
"EM_SETTARGETDEVICE failed (returned %d).\n",
res);
7473 ok(
pos,
"pos=%d indicating no word wrap when it is expected.\n",
pos);
7482 ok(
res,
"EM_REPLACESEL failed.\n");
7484 ok(
lines == 1,
"Line wasn't expected to wrap (lines=%d).\n",
lines);
7487 ok(
lines > 1,
"Line was expected to wrap (lines=%d).\n",
lines);
7506 ok(
ret == 1,
"EM_GETSCROLLPOS returned %d instead of 1\n",
ret);
7507 ok(
pt.y != 0,
"Didn't scroll down after replacing text.\n");
7515 ok(
ret == 1,
"EM_GETSCROLLPOS returned %d instead of 1\n",
ret);
7516 ok(
pt.y == 0,
"y scroll position is %ld after clearing text.\n",
pt.y);
7572 for (
n = -3;
n <= 3;
n++)
7743 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7761 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7772 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7783 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7794 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7808 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7819 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7832 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7843 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7859 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7870 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7883 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7894 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7904 ok(
res ==
expected,
"WM_GETDLGCODE returned %x but expected %x\n",
7915 int numerator, denominator;
7925 ok(numerator == 0,
"Numerator should be initialized to 0 (got %d).\n", numerator);
7926 ok(denominator == 0,
"Denominator should be initialized to 0 (got %d).\n", denominator);
7933 ok(!
ret,
"WM_MOUSEWHEEL failed (%d).\n",
ret);
7937 ok(numerator == 110,
"incorrect numerator is %d\n", numerator);
7938 ok(denominator == 100,
"incorrect denominator is %d\n", denominator);
7948 ok(!
ret,
"WM_MOUSEWHEEL failed (%d).\n",
ret);
7952 ok(numerator == 500,
"incorrect numerator is %d\n", numerator);
7953 ok(denominator == 100,
"incorrect denominator is %d\n", denominator);
7962 ok(!
ret,
"WM_MOUSEWHEEL failed (%d).\n",
ret);
7966 ok(numerator == 491,
"incorrect numerator is %d\n", numerator);
7967 ok(denominator == 100,
"incorrect denominator is %d\n", denominator);
7976 ok(!
ret,
"WM_MOUSEWHEEL failed (%d).\n",
ret);
7980 ok(numerator == 10,
"incorrect numerator is %d\n", numerator);
7981 ok(denominator == 100,
"incorrect denominator is %d\n", denominator);
7990 ok(!
ret,
"WM_MOUSEWHEEL failed (%d).\n",
ret);
7994 ok(numerator == 19,
"incorrect numerator is %d\n", numerator);
7995 ok(denominator == 100,
"incorrect denominator is %d\n", denominator);
8005 ok(!
ret,
"WM_MOUSEWHEEL failed (%d).\n",
ret);
8009 ok(numerator == 394,
"incorrect numerator is %d\n", numerator);
8010 ok(denominator == 100,
"incorrect denominator is %d\n", denominator);
8015 ok(
ret ==
TRUE,
"EM_SETZOOM rejected valid values (%d).\n",
ret);
8018 ok(
ret ==
TRUE,
"EM_SETZOOM rejected valid values (%d).\n",
ret);
8021 ok(
ret ==
FALSE,
"EM_SETZOOM accepted invalid values (%d).\n",
ret);
8024 ok(numerator == 127,
"incorrect numerator is %d\n", numerator);
8025 ok(denominator == 2,
"incorrect denominator is %d\n", denominator);
8029 ok(
ret ==
FALSE,
"EM_SETZOOM accepted invalid values (%d).\n",
ret);
8033 ok(
ret ==
FALSE,
"EM_SETZOOM accepted invalid values (%d).\n",
ret);
8040 ok(numerator == 127,
"incorrect numerator is %d\n", numerator);
8041 ok(denominator == 2,
"incorrect denominator is %d\n", denominator);
8058#define test_dm_messages(wmclose, wmgetdefid, wmnextdlgctl) \
8059 ok(dm_messages.wm_close == wmclose, "expected %d WM_CLOSE message, " \
8060 "got %d\n", wmclose, dm_messages.wm_close); \
8061 ok(dm_messages.wm_getdefid == wmgetdefid, "expected %d WM_GETDIFID message, " \
8062 "got %d\n", wmgetdefid, dm_messages.wm_getdefid);\
8063 ok(dm_messages.wm_nextdlgctl == wmnextdlgctl, "expected %d WM_NEXTDLGCTL message, " \
8064 "got %d\n", wmnextdlgctl, dm_messages.wm_nextdlgctl)
8086 HWND hwRichEdit, hwParent, hwButton;
8102 ok(0 ==
r,
"expected 0, got %d\n",
r);
8104 ok(2 == lcount,
"expected 2, got %d\n", lcount);
8107 ok(0x8f ==
r,
"expected 0x8f, got 0x%x\n",
r);
8110 ok(0 ==
r,
"expected 0, got %d\n",
r);
8112 ok(3 == lcount,
"expected 3, got %d\n", lcount);
8115 ok(0x8f ==
r,
"expected 0x8f, got 0x%x\n",
r);
8117 ok(0 ==
r,
"expected 0, got %d\n",
r);
8119 ok(3 == lcount,
"expected 3, got %d\n", lcount);
8128 ok(0 ==
r,
"expected 0, got %d\n",
r);
8130 ok(2 == lcount,
"expected 2, got %d\n", lcount);
8133 ok(0x8f ==
r,
"expected 0x8f, got 0x%x\n",
r);
8136 ok(0 ==
r,
"expected 0, got %d\n",
r);
8138 ok(2 == lcount,
"expected 2, got %d\n", lcount);
8150 ok(0x8f ==
r,
"expected 0x8f, got 0x%x\n",
r);
8154 ok(0 ==
r,
"expected 0, got %d\n",
r);
8159 ok(0 ==
r,
"expected 0, got %d\n",
r);
8170 ok(0 ==
r,
"expected 0, got %d\n",
r);
8174 ok(2 == lcount,
"expected 2, got %d\n", lcount);
8178 ok(0 ==
r,
"expected 0, got %d\n",
r);
8183 ok(0 ==
r,
"expected 0, got %d\n",
r);
8188 ok(0x8f ==
r,
"expected 0x8f, got 0x%x\n",
r);
8193 ok(0 ==
r,
"expected 0, got %d\n",
r);
8197 ok(2 == lcount,
"expected 2, got %d\n", lcount);
8201 ok(0 ==
r,
"expected 0, got %d\n",
r);
8206 ok(0 ==
r,
"expected 0, got %d\n",
r);
8215 ok(0 ==
r,
"expected 0, got %d\n",
r);
8219 ok(2 == lcount,
"expected 2, got %d\n", lcount);
8230 ok(0 ==
r,
"expected 0, got %d\n",
r);
8234 ok(2 == lcount,
"expected 2, got %d\n", lcount);
8238 ok(0 ==
r,
"expected 0, got %d\n",
r);
8243 ok(0 ==
r,
"expected 0, got %d\n",
r);
8248 ok(0x8f ==
r,
"expected 0x8f, got 0x%x\n",
r);
8253 ok(0 ==
r,
"expected 0, got %d\n",
r);
8257 ok(3 == lcount,
"expected 3, got %d\n", lcount);
8261 ok(0 ==
r,
"expected 0, got %d\n",
r);
8266 ok(0 ==
r,
"expected 0, got %d\n",
r);
8275 ok(0 ==
r,
"expected 0, got %d\n",
r);
8279 ok(4 == lcount,
"expected 4, got %d\n", lcount);
8290 ok(0 ==
r,
"expected 0, got %d\n",
r);
8295 ok(0 ==
r,
"expected 0, got %d\n",
r);
8300 ok(0 ==
r,
"expected 0, got %d\n",
r);
8305 ok(0x8b ==
r,
"expected 0x8b, got 0x%x\n",
r);
8310 ok(0 ==
r,
"expected 0, got %d\n",
r);
8315 ok(0 ==
r,
"expected 0, got %d\n",
r);
8320 ok(0 ==
r,
"expected 0, got %d\n",
r);
8329 ok(0 ==
r,
"expected 0, got %d\n",
r);
8340 ok(0 ==
r,
"expected 0, got %d\n",
r);
8345 ok(0x8b ==
r,
"expected 0x8b, got 0x%x\n",
r);
8350 ok(0 ==
r,
"expected 0, got %d\n",
r);
8359 ok(0 ==
r,
"expected 0, got %d\n",
r);
8368 static const struct {
8371 } delimiter_tests[] = {
8398 wbuf[0] = delimiter_tests[
i].c;
8403 ok(
result == delimiter_tests[
i].isdelimiter,
8404 "wanted ISDELIMITER_W(0x%x) %d, got %d\n",
8405 delimiter_tests[
i].
c, delimiter_tests[
i].isdelimiter,
result);
8412 static const struct {
8415 } delimiter_tests[] = {
8431 buf[0] = delimiter_tests[
i].c;
8436 ok(
result == delimiter_tests[
i].isdelimiter,
8437 "wanted ISDELIMITER_A(0x%x) %d, got %d\n",
8438 delimiter_tests[
i].
c, delimiter_tests[
i].isdelimiter,
result);
8461 static const struct {
8462 const char *initialtext;
8464 const char *expectedwmtext;
8465 const char *expectedemtext;
8466 const char *expectedemtextcrlf;
8467 } testenteritems[] = {
8468 {
"aaabbb\r\n", 3,
"aaa\r\nbbb\r\n",
"aaa\rbbb\r",
"aaa\r\nbbb\r\n"},
8469 {
"aaabbb\r\n", 6,
"aaabbb\r\n\r\n",
"aaabbb\r\r",
"aaabbb\r\n\r\n"},
8470 {
"aa\rabbb\r\n", 7,
"aa\r\nabbb\r\n\r\n",
"aa\rabbb\r\r",
"aa\r\nabbb\r\n\r\n"},
8471 {
"aa\rabbb\r\n", 3,
"aa\r\n\r\nabbb\r\n",
"aa\r\rabbb\r",
"aa\r\n\r\nabbb\r\n"},
8472 {
"aa\rabbb\r\n", 2,
"aa\r\n\r\nabbb\r\n",
"aa\r\rabbb\r",
"aa\r\n\r\nabbb\r\n"}
8475 char expectedbuf[1024];
8476 char resultbuf[1024];
8479 char buf[1024] = {0};
8488 ok (
result == 1,
"[%d] WM_SETTEXT returned %Id instead of 1\n",
i,
result);
8497 expected = testenteritems[
i].expectedwmtext;
8504 "[%d] WM_GETTEXT unexpected '%s' expected '%s'\n",
8505 i, resultbuf, expectedbuf);
8512 expected = testenteritems[
i].expectedemtext;
8519 "[%d] EM_GETTEXTEX, GT_DEFAULT unexpected '%s', expected '%s'\n",
8520 i, resultbuf, expectedbuf);
8524 getText.codepage =
CP_ACP;
8527 expected = testenteritems[
i].expectedemtextcrlf;
8534 "[%d] EM_GETTEXTEX, GT_USECRLF unexpected '%s', expected '%s'\n",
8535 i, resultbuf, expectedbuf);
8543 ok (
result == 1,
"[%d] WM_SETTEXT returned %Id instead of 1\n",
i,
result);
8552 ok (
result == 0,
"[%d] EM_GETTEXTEX, GT_DEFAULT unexpected '%s', expected '%s'\n",
i, resultbuf, expectedbuf);
8555 ok (
result == 1,
"[%d] WM_SETTEXT returned %Id instead of 1\n",
i,
result);
8564 ok (
result == 0,
"[%d] EM_GETTEXTEX, GT_DEFAULT unexpected '%s', expected '%s'\n",
i, resultbuf, expectedbuf);
8571 static const WCHAR titleW[] = {
'l',
'i',
'n',
'e',
'1',
'\n',
'l',
'i',
'n',
'e',
'2',0};
8572 static const char title[] =
"line1\nline2";
8584 ok(
len == 5,
"GetWindowText returned %d\n",
len);
8588 ok(
res == 0,
"SendMessage(EM_GETSEL) returned %Ix\n",
res);
8597 ok(
len == 12,
"GetWindowText returned %d\n",
len);
8601 ok(
res == 0,
"SendMessage(EM_GETSEL) returned %Ix\n",
res);
8614 WORD def_align, new_align;
8620 def_align =
fmt.wAlignment;
8627 fmt.wAlignment = new_align;
8631 ok(
fmt.wAlignment == new_align,
"got %d expect %d\n",
fmt.wAlignment, new_align );
8637 ok(
fmt.wAlignment == def_align,
"got %d expect %d\n",
fmt.wAlignment, def_align );
8649 ok(
res == 1,
"EM_SETREADONLY\n");
8651 ok(dwStyle &
ES_READONLY,
"got wrong value: 0x%lx\n", dwStyle);
8654 ok(
res == 1,
"EM_SETREADONLY\n");
8656 ok(!(dwStyle &
ES_READONLY),
"got wrong value: 0x%lx\n", dwStyle);
8666#define TEST_EM_SETFONTSIZE(hwnd,size,expected_size,expected_res,expected_undo) \
8667 _test_font_size(__LINE__,hwnd,size,expected_size,expected_res,expected_undo)
8675 cf.cbSize =
sizeof(
cf);
8681 ok_(__FILE__,
line)(
res == expected_res,
"EM_SETFONTSIZE unexpected return value: %Ix.\n",
res);
8682 ok_(__FILE__,
line)(
twips2points(
cf.yHeight) == expected_size,
"got wrong font size: %ld, expected: %ld\n",
8684 ok_(__FILE__,
line)(isundo == expected_undo,
"get wrong undo mark: %d, expected: %d.\n",
8685 isundo, expected_undo);
8695 tmp_cf.
cbSize =
sizeof(tmp_cf);
8707 ok(default_size == 9,
"Default font size should not be changed.\n");
8764 const char * streamtext =
8765 "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang12298{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 System;}}\r\n"
8766 "\\viewkind4\\uc1\\pard\\f0\\fs17 TestSomeText\\par\r\n"
8773 DWORD dwStyle, new_align;
8776 memset(&pf, 0,
sizeof(pf));
8781 ok(pf.wAlignment == align_mask[
i],
"(i = %d) got %d expected %ld\n",
8782 i, pf.wAlignment, align_mask[
i]);
8784 ok((
i ? (dwStyle & align_style[
i]) : (!(dwStyle & 0x0000000f))) ,
8785 "(i = %d) didn't set right align style: 0x%lx\n",
i, dwStyle);
8794 pf.wAlignment = new_align;
8798 ok(pf.wAlignment == new_align,
"got %d expect %ld\n", pf.wAlignment, new_align);
8804 ok(pf.wAlignment == align_mask[
i],
"got %d expect %ld\n", pf.wAlignment, align_mask[
i]);
8808 pf.cTabCount = -25000;
8810 ok(pf.cTabCount == -25000,
"Got %d\n", pf.cTabCount);
8812 ok(pf.cTabCount == 0,
"Got %d\n", pf.cTabCount);
8814 pf.cTabCount = 25000;
8816 ok(pf.cTabCount == 25000,
"Got %d\n", pf.cTabCount);
8818 ok(pf.cTabCount == 32,
"Got %d\n", pf.cTabCount);
8823 ok(pf.cTabCount == 32,
"Got %d\n", pf.cTabCount);
8828 ok(pf.cTabCount == 32,
"Got %d\n", pf.cTabCount);
8833 ok(pf.cTabCount == 1,
"Got %d\n", pf.cTabCount);
8846 memset(&pf, 0,
sizeof(pf));
8857 static const char text1[] =
"aaa\r\nbbb\r\nccc\r\nddd\r\neee";
8858 static const char text2[] =
"aaa\r\nbbb\r\nccc\r\nddd\r\neee\r\n";
8859 static const char text3[] =
"abcdef\x8e\xf0";
8864 ok(
result ==
lstrlenA(text1),
"WM_GETTEXTLENGTH returned %d, expected %d\n",
8869 ok(
result ==
lstrlenA(text2),
"WM_GETTEXTLENGTH returned %d, expected %d\n",
8874 skip(
"Skip multibyte character tests on non-Japanese platform\n");
8887 const char *specials =
"{\\rtf1\\emspace\\enspace\\bullet\\lquote"
8888 "\\rquote\\ldblquote\\rdblquote\\ltrmark\\rtlmark\\zwj\\zwnj}";
8889 const WCHAR expect_specials[] = {
' ',
' ',0x2022,0x2018,0x2019,0x201c,
8890 0x201d,0x200e,0x200f,0x200d,0x200c};
8891 const char *pard =
"{\\rtf1 ABC\\rtlpar\\par DEF\\par HIJ\\pard\\par}";
8892 const char *highlight =
"{\\rtf1{\\colortbl;\\red0\\green0\\blue0;\\red128\\green128\\blue128;\\red192\\green192\\blue192;}\\cf2\\highlight3 foo\\par}";
8893 const char *crash =
"{\\rtf2 {\\par \\pard \\trowd \\cellx6000 \\intbl \\cell \\row \\par \\pard \\li300 \\bullet packages... \\par }";
8894 const char *crash2 =
"{\\rtf1 \\trowd row1 \\intbl \\cell \\row \\par \\trowd row2 \\intbl \\cell \\row}";
8920 fmt.cbSize =
sizeof(
fmt);
8940 cf.cbSize =
sizeof(
cf);
8943 ok(
cf.crTextColor ==
RGB(128,128,128),
"got %08lx\n",
cf.crTextColor );
8944 ok(
cf.crBackColor ==
RGB(192,192,192),
"got %08lx\n",
cf.crBackColor );
8973 const char *rtf =
"{\\rtf1{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 Arial;}{\\f1\\fnil\\fcharset2 Symbol;}}"
8974 "{\\fs10{\\pard\\fs16\\fi200\\li360\\f0 First\\par"
8975 "\\f0\\fs25 Second\\par"
8976 "{\\f0\\fs26 Third}\\par"
8977 "{\\f0\\fs22 Fourth}\\par}}}";
8980 int i,
num, expect_height;
8988 for (
i = 0;
i <=
num;
i++)
8991 cf.cbSize =
sizeof(
cf);
8995 if (
i < 6) expect_height = 160;
8996 else if (
i < 13) expect_height = 250;
8997 else if (
i < 18) expect_height = 260;
8998 else if (
i == 18 ||
i == 25) expect_height = 250;
8999 else expect_height = 220;
9000 ok(
cf.yHeight == expect_height,
"%d: got %ld\n",
i,
cf.yHeight );
9009 const char *numbers =
"{\\rtf1{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 Arial;}{\\f1\\fnil\\fcharset2 Symbol;}}"
9010 "\\pard{\\pntext\\f0 3.\\tab}{\\*\\pn\\pnlvlbody\\pnfs32\\pnf0\\pnindent1000\\pnstart2\\pndec{\\pntxta.}}"
9011 "\\fs20\\fi200\\li360\\f0 First\\par"
9012 "{\\pntext\\f0 4.\\tab}\\f0 Second\\par"
9013 "{\\pntext\\f0 6.\\tab}\\f0 Third\\par}";
9014 const WCHAR expect_numbers_txt[] = {
'F',
'i',
'r',
's',
't',
'\r',
'S',
'e',
'c',
'o',
'n',
'd',
'\r',
'T',
'h',
'i',
'r',
'd',0};
9040 fmt.cbSize =
sizeof(
fmt);
9044 ok(
fmt.wNumberingStart == 2,
"got %d\n",
fmt.wNumberingStart );
9046 ok(
fmt.wNumberingTab == 1000,
"got %d\n",
fmt.wNumberingTab );
9047 ok(
fmt.dxStartIndent == 560,
"got %ld\n",
fmt.dxStartIndent );
9048 ok(
fmt.dxOffset == -200,
"got %ld\n",
fmt.dxOffset );
9052 memset( &fmt2, 0,
sizeof(fmt2) );
9053 fmt2.
cbSize =
sizeof(fmt2);
9060 cf.cbSize =
sizeof(
cf);
9063 ok(
cf.yHeight == 200,
"got %ld\n",
cf.yHeight );
9066 cf.cbSize =
sizeof(
cf);
9069 ok(
cf.yHeight == 200,
"got %ld\n",
cf.yHeight );
9124 ok(
parent != 0,
"Failed to create parent window\n");
9136 static const char text1[] =
"abcdefg\n";
9158 hr = IRichEditOle_GetClientSite(reole, &clientsite);
9159 ok(
hr ==
S_OK,
"IRichEditOle_GetClientSite failed: 0x%08lx\n",
hr);
9161 DVASPECT_CONTENT, 0, 1);
9162 hr = IRichEditOle_InsertObject(reole, &reo1);
9163 ok(
hr ==
S_OK,
"IRichEditOle_InsertObject failed: 0x%08lx\n",
hr);
9164 IOleClientSite_Release(clientsite);
9179 hr = IRichEditOle_GetClientSite(reole, &clientsite);
9180 ok(
hr ==
S_OK,
"IRichEditOle_GetClientSite failed: 0x%08lx\n",
hr);
9182 DVASPECT_CONTENT, 0, 2);
9183 hr = IRichEditOle_InsertObject(reole, &reo2);
9184 ok(
hr ==
S_OK,
"IRichEditOle_InsertObject failed: 0x%08lx\n",
hr);
9185 IOleClientSite_Release(clientsite);
9199 IRichEditOle_Release(reole);
9211 {
"RichEdit",
FALSE },
9212 {
"RichEdit20A",
TRUE },
9213 {
"RichEdit20W",
TRUE },
9214 {
"RichEdit50A",
FALSE },
9215 {
"RichEdit50W",
FALSE }
9223 hwnd =
CreateWindowExA(0,
test[
i].
class,
NULL,
WS_POPUP, 0, 0, 0, 0, 0, 0, 0,
NULL);
9317 if (
getenv(
"WINETEST_RICHED20" )) {
static struct _test_info results[8]
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strchr(const char *String, int ch)
static unsigned char bytes[4]
static const char * wine_dbgstr_rect(const RECT *prc)
void user(int argc, const char *argv[])
void get(int argc, const char *argv[])
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
static LPSTR * split(LPSTR s, LPINT args)
static WCHAR no[MAX_STRING_RESOURCE_LEN]
static const WCHAR empty[]
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
LANGID WINAPI GetSystemDefaultLangID(void)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
LCID WINAPI GetSystemDefaultLCID(void)
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
HRESULT WINAPI OleFlushClipboard(void)
static WCHAR * get_text(const ME_Run *run, int offset)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLsizei const GLchar *const * strings
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
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
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 * u
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 GLint GLint j
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
static const WCHAR titleW[]
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
#define trace_(file, line,...)
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
static struct test_info tests[]
#define sprintf(buf, format,...)
UCHAR ab[sizeof("Hello World!") -1]
static const WCHAR textW[]
static const WCHAR desc[]
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HMODULE MODULEINFO DWORD cb
#define todo_wine_if(is_todo)
static const struct access_res create[16]
static unsigned int recursionLevel
static struct dialog_mode_messages dm_messages
static void test_EM_SELECTIONTYPE(void)
static void test_EM_FORMATRANGE(void)
static CHAR string2[MAX_PATH]
static LRESULT WINAPI WM_NOTIFY_ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static void test_SETPARAFORMAT(void)
static void simulate_typing_characters(HWND hwnd, const char *szChars)
static LRESULT WINAPI EN_LINK_ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK dialog_mode_wnd_proc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
static void test_WM_PASTE(void)
static void test_EM_EXSETSEL(void)
static void test_EM_GETSELTEXT(void)
static void check_CFE_LINK_rcvd(HWND hwnd, BOOL is_url, const char *url)
static void test_word_movement_multiline(void)
static void test_WM_GETTEXT(void)
static void fill_reobject_struct(REOBJECT *reobj, LONG cp, LPOLEOBJECT poleobj, LPSTORAGE pstg, LPOLECLIENTSITE polesite, LONG sizel_cx, LONG sizel_cy, DWORD aspect, DWORD flags, DWORD user)
static void test_EM_StreamIn_Undo(void)
#define test_dm_messages(wmclose, wmgetdefid, wmnextdlgctl)
static void test_EM_SETOPTIONS(void)
static HWND new_richeditW(HWND parent)
static LRESULT WINAPI ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static void test_EM_FINDWORDBREAK_W(void)
static void test_WM_SETFONT(void)
static void check_EM_SETSEL(HWND hwnd, const struct exsetsel_s *setsel, int id)
static HMODULE hmoduleRichEdit
#define ID_RICHEDITTESTDBUTTON
static void test_undo_coalescing(void)
#define TEST_SETTEXTW(a, b)
static void test_EM_GETTEXTLENGTHEX(void)
static void format_test_result(char *target, const char *src)
static HWND new_richedit(HWND parent)
static LRESULT WINAPI ChangeWatcherWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static BOOL change_received
static void test_EM_STREAMOUT_FONTTBL(void)
static void test_EM_GETLINE(void)
#define DISABLE_WS_VSCROLL(hwnd)
static void test_WM_GETTEXTLENGTH(void)
static void test_EM_SCROLL(void)
static HWND new_windowW(LPCWSTR lpClassName, DWORD dwStyle, HWND parent)
static unsigned int WM_SIZE_recursionLevel
static DWORD CALLBACK test_EM_STREAMIN_esCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
static void run_tests_EM_FINDTEXT(HWND hwnd, const char *name, struct find_s *find, int num_tests, BOOL unicode)
static void move_cursor(HWND hwnd, LONG charindex)
static WCHAR * atowstr(const char *str)
static void test_EM_GETLIMITTEXT(void)
static const struct exsetsel_s exsetsel_tests[]
static void test_EN_LINK(void)
static void test_unicode_conversions(void)
static void test_EM_STREAMIN(void)
static void check_EM_EXSETSEL(HWND hwnd, const struct exsetsel_s *setsel, int id)
static BOOL check_CFE_LINK_selection(HWND hwnd, int sel_start, int sel_end)
static void test_EM_STREAMOUT(void)
static BOOL hold_key(int vk)
static void test_EM_AUTOURLDETECT(void)
static void test_EM_REPLACESEL(int redraw)
static LRESULT send_ctrl_key(HWND hwnd, UINT key)
static int received_WM_NOTIFY
#define ok_w3(format, szString1, szString2, szString3)
static WNDCLASSA make_simple_class(WNDPROC wndproc, LPCSTR lpClassName)
static HWND new_richedit_with_style(HWND parent, DWORD style)
static DWORD CALLBACK test_esCallback_written_1(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
static void test_WM_CREATE(void)
static void test_WM_SETTEXT(void)
static void test_EM_SETCHARFORMAT(void)
static int queriedEventMask
static void test_background(void)
static BOOL is_lang_japanese
static void _send_paste(unsigned int line, HWND wnd)
static void test_dialogmode(void)
static BOOL filter_on_WM_NOTIFY
static struct find_s find_tests2[]
static void test_EM_SETTEXTMODE(void)
static void test_format_rect(void)
static HWND hwndRichedit_WM_NOTIFY
static LRESULT WINAPI RicheditStupidOverrideProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static void test_init_messages(void)
static void test_eventMask(void)
static BOOL open_clipboard_(int line, HWND hwnd)
static void test_EM_LINELENGTH(void)
static struct find_s find_tests[]
static void test_scrollbar_visibility(void)
static CHAR string1[MAX_PATH]
static void keep_responsive(time_t delay_time)
static void test_EM_CHARFROMPOS(void)
static HWND eventMaskEditHwnd
static BOOL release_key(int vk)
static void test_EM_SETFONTSIZE(void)
static DWORD CALLBACK test_EM_GETMODIFY_esCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
static void test_EM_SETSEL(void)
static void line_scroll(HWND hwnd, int amount)
static int modify_at_WM_NOTIFY
static void test_rtf(void)
static void check_EM_SETSEL_multiline(HWND hwnd)
static void check_EM_FINDTEXT(HWND hwnd, const char *name, struct find_s *f, int id, BOOL unicode)
static void test_WM_GETDLGCODE(void)
static void test_EM_SCROLLCARET(void)
static int get_scroll_pos_y(HWND hwnd)
static void test_EM_SETUNDOLIMIT(void)
static CHAR string3[MAX_PATH]
static void test_EM_STREAMOUT_empty_para(void)
static void test_EM_LIMITTEXT(void)
static void test_autoscroll(void)
static void check_EM_FINDTEXTEX(HWND hwnd, const char *name, struct find_s *f, int id, BOOL unicode)
#define open_clipboard(hwnd)
static void test_word_wrap(void)
static void test_enter(void)
#define TEST_SETTEXT(a, b)
static void test_EM_FINDWORDBREAK_A(void)
static LONG CALLBACK customWordBreakProc(WCHAR *text, int pos, int bytes, int code)
static void test_reset_default_para_fmt(void)
static void test_window_classes(void)
static LRESULT WINAPI RichEditWithEventsWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static DWORD CALLBACK test_WM_SETTEXT_esCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
static LONG twips2points(LONG value)
#define ENABLE_WS_VSCROLL(hwnd)
#define ITextServices_OnTxPropertyBitsChange(This, a, b)
static int count_pars(const char *buf)
static void test_EM_POSFROMCHAR(void)
static void test_zoom(void)
static int watchForEventMask
static HWND new_static_wnd(HWND parent)
static HWND new_window(LPCSTR lpClassName, DWORD dwStyle, HWND parent)
static void test_ES_PASSWORD(void)
static const struct getline_s gl[]
static void test_EM_EXLIMITTEXT(void)
static void _test_font_size(unsigned line, HWND hwnd, LONG size, LONG expected_size, LRESULT expected_res, BOOL expected_undo)
static void link_notify_test(const char *desc, int i, HWND hwnd, HWND parent, UINT msg, WPARAM wParam, LPARAM lParam, BOOL notifies)
static BOOL bailedOutOfRecursion
static void test_WM_CHAR(void)
static void test_eop_char_fmt(void)
static void test_word_movement(void)
#define TEST_EM_SETFONTSIZE(hwnd, size, expected_size, expected_res, expected_undo)
static const char haystack[]
static void test_para_numbering(void)
static void test_EM_GETTEXTRANGE(void)
static void test_alignment_style(void)
static void test_EM_SETTEXTEX(void)
static void disable_beep(HWND hwnd)
static void test_WM_NOTIFY(void)
static void test_EM_SETREADONLY(void)
static void test_TM_PLAINTEXT(void)
static void test_EM_GETMODIFY(void)
static IID * pIID_ITextServices
static void test_EM_FINDTEXT(void)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
#define LOCALE_SYSTEM_DEFAULT
interface IStorage * LPSTORAGE
#define WS_OVERLAPPEDWINDOW
void redraw(int x, int y, int cx, int cy)
#define CFU_UNDERLINEDOUBLE
struct _charformat CHARFORMATA
static const WCHAR RICHEDIT_CLASS20W[]
struct _charformatw CHARFORMATW
#define RICHEDIT_CLASS20A
#define ES_DISABLENOSCROLL
struct _paraformat2 PARAFORMAT2
struct _charformat2a CHARFORMAT2A
#define CFE_AUTOBACKCOLOR
#define EM_STOPGROUPTYPING
#define EM_GETTEXTLENGTHEX
#define EM_SETTARGETDEVICE
#define CFM_UNDERLINETYPE
#define CFU_UNDERLINENONE
#define EM_GETOLEINTERFACE
STDMETHOD() Skip(THIS_ ULONG celt) PURE
CHAR lfFaceName[LF_FACESIZE]
int expected_getsel_start
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
static UINT WPARAM LPARAM BOOL ansi
#define success(from, fromstr, to, tostr)
DWORD WINAPI GetLastError(void)
#define ERROR_CANNOT_FIND_WND_CLASS
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define OUT_DEFAULT_PRECIS
#define CLIP_DEFAULT_PRECIS
HFONT WINAPI CreateFontA(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR)
#define LOCALE_FONTSIGNATURE
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define SetWindowLongPtrA
UINT WINAPI MapVirtualKeyA(_In_ UINT, _In_ UINT)
BOOL WINAPI SetKeyboardState(_In_reads_(256) LPBYTE)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
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_GETPASSWORDCHAR
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define EM_SETPASSWORDCHAR
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
int WINAPI GetClassNameA(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPSTR lpClassName, _In_ int nMaxCount)
#define EM_EMPTYUNDOBUFFER
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
HWND WINAPI GetOpenClipboardWindow(void)
BOOL WINAPI CloseClipboard(void)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
HANDLE WINAPI GetClipboardData(_In_ UINT)
#define EM_GETFIRSTVISIBLELINE
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
BOOL WINAPI IsWindowUnicode(_In_ HWND)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define EM_SETWORDBREAKPROC
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI GetClassInfoA(_In_opt_ HINSTANCE, _In_ LPCSTR, _Out_ LPWNDCLASSA)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList