| 1 | /*
|
|---|
| 2 | * RichEdit32 functions
|
|---|
| 3 | *
|
|---|
| 4 | * This module is a simple wrapper for the edit controls.
|
|---|
| 5 | * At the point, it is good only for application who use the RICHEDIT
|
|---|
| 6 | * control to display RTF text.
|
|---|
| 7 | *
|
|---|
| 8 | * Copyright 2000 by Jean-Claude Batista
|
|---|
| 9 | *
|
|---|
| 10 | * This library is free software; you can redistribute it and/or
|
|---|
| 11 | * modify it under the terms of the GNU Lesser General Public
|
|---|
| 12 | * License as published by the Free Software Foundation; either
|
|---|
| 13 | * version 2.1 of the License, or (at your option) any later version.
|
|---|
| 14 | *
|
|---|
| 15 | * This library is distributed in the hope that it will be useful,
|
|---|
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 18 | * Lesser General Public License for more details.
|
|---|
| 19 | *
|
|---|
| 20 | * You should have received a copy of the GNU Lesser General Public
|
|---|
| 21 | * License along with this library; if not, write to the Free Software
|
|---|
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | #include <string.h>
|
|---|
| 26 | #include "windef.h"
|
|---|
| 27 | #include "winbase.h"
|
|---|
| 28 | #include "wingdi.h"
|
|---|
| 29 | #include "winreg.h"
|
|---|
| 30 | #include "winerror.h"
|
|---|
| 31 | #include "riched32.h"
|
|---|
| 32 | #include "richedit.h"
|
|---|
| 33 | #include "charlist.h"
|
|---|
| 34 | #define NO_SHLWAPI_STREAM
|
|---|
| 35 | #include "shlwapi.h"
|
|---|
| 36 |
|
|---|
| 37 | #include "rtf.h"
|
|---|
| 38 | #include "rtf2text.h"
|
|---|
| 39 | #include "wine/debug.h"
|
|---|
| 40 |
|
|---|
| 41 | #define ID_EDIT 1
|
|---|
| 42 |
|
|---|
| 43 | WINE_DEFAULT_DEBUG_CHANNEL(richedit);
|
|---|
| 44 |
|
|---|
| 45 | HANDLE RICHED32_hHeap = (HANDLE)NULL;
|
|---|
| 46 | /* LPSTR RICHED32_aSubclass = (LPSTR)NULL; */
|
|---|
| 47 |
|
|---|
| 48 | #define DPRINTF_EDIT_MSG32(str) \
|
|---|
| 49 | TRACE(\
|
|---|
| 50 | "32 bit : " str ": hwnd=%p, wParam=%08x, lParam=%08x\n"\
|
|---|
| 51 | , \
|
|---|
| 52 | hwnd, (UINT)wParam, (UINT)lParam)
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | /***********************************************************************
|
|---|
| 56 | * DllMain [Internal] Initializes the internal 'RICHED32.DLL'.
|
|---|
| 57 | *
|
|---|
| 58 | * PARAMS
|
|---|
| 59 | * hinstDLL [I] handle to the DLL's instance
|
|---|
| 60 | * fdwReason [I]
|
|---|
| 61 | * lpvReserved [I] reserved, must be NULL
|
|---|
| 62 | *
|
|---|
| 63 | * RETURNS
|
|---|
| 64 | * Success: TRUE
|
|---|
| 65 | * Failure: FALSE
|
|---|
| 66 | */
|
|---|
| 67 |
|
|---|
| 68 | #ifdef __WIN32OS2__
|
|---|
| 69 | BOOL WINAPI RICHED32_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|---|
| 70 | #else
|
|---|
| 71 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|---|
| 72 | #endif
|
|---|
| 73 | {
|
|---|
| 74 | TRACE("\n");
|
|---|
| 75 | switch (fdwReason)
|
|---|
| 76 | {
|
|---|
| 77 | case DLL_PROCESS_ATTACH:
|
|---|
| 78 | /* create private heap */
|
|---|
| 79 | RICHED32_hHeap = HeapCreate (0, 0x10000, 0);
|
|---|
| 80 | /* register the Rich Edit class */
|
|---|
| 81 | RICHED32_Register ();
|
|---|
| 82 | break;
|
|---|
| 83 |
|
|---|
| 84 | case DLL_PROCESS_DETACH:
|
|---|
| 85 | /* unregister all common control classes */
|
|---|
| 86 | RICHED32_Unregister ();
|
|---|
| 87 | HeapDestroy (RICHED32_hHeap);
|
|---|
| 88 | RICHED32_hHeap = (HANDLE)NULL;
|
|---|
| 89 | break;
|
|---|
| 90 | }
|
|---|
| 91 | return TRUE;
|
|---|
| 92 | }
|
|---|
| 93 |
|
|---|
| 94 | /* Support routines for window procedure */
|
|---|
| 95 | INT RICHEDIT_GetTextRange(HWND hwnd,TEXTRANGEA *tr);
|
|---|
| 96 | INT RICHEDIT_GetSelText(HWND hwnd,LPSTR lpstrBuffer);
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 | /*
|
|---|
| 100 | *
|
|---|
| 101 | * DESCRIPTION:
|
|---|
| 102 | * Window procedure of the RichEdit control.
|
|---|
| 103 | *
|
|---|
| 104 | */
|
|---|
| 105 | static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
|
|---|
| 106 | LPARAM lParam)
|
|---|
| 107 | {
|
|---|
| 108 | int RTFToBuffer(char* pBuffer, int nBufferSize);
|
|---|
| 109 | LONG newstyle = 0;
|
|---|
| 110 | LONG style = 0;
|
|---|
| 111 |
|
|---|
| 112 | static HWND hwndEdit;
|
|---|
| 113 | static HWND hwndParent;
|
|---|
| 114 | static char* rtfBuffer;
|
|---|
| 115 | int rtfBufferSize;
|
|---|
| 116 |
|
|---|
| 117 | CHARRANGE *cr;
|
|---|
| 118 | TRACE("previous hwndEdit: %p hwndParent %p\n",hwndEdit,hwndParent);
|
|---|
| 119 | hwndEdit = GetWindow(hwnd,GW_CHILD);
|
|---|
| 120 | TRACE("uMsg: 0x%x hwnd: %p hwndEdit: %p\n",uMsg,hwnd,hwndEdit);
|
|---|
| 121 |
|
|---|
| 122 | switch (uMsg)
|
|---|
| 123 | {
|
|---|
| 124 |
|
|---|
| 125 | case WM_CREATE :
|
|---|
| 126 | DPRINTF_EDIT_MSG32("WM_CREATE");
|
|---|
| 127 |
|
|---|
| 128 | /* remove SCROLLBARS from the current window style */
|
|---|
| 129 | hwndParent = ((LPCREATESTRUCTA) lParam)->hwndParent;
|
|---|
| 130 |
|
|---|
| 131 | newstyle = style = ((LPCREATESTRUCTA) lParam)->style;
|
|---|
| 132 | newstyle &= ~WS_HSCROLL;
|
|---|
| 133 | newstyle &= ~WS_VSCROLL;
|
|---|
| 134 | newstyle &= ~ES_AUTOHSCROLL;
|
|---|
| 135 | newstyle &= ~ES_AUTOVSCROLL;
|
|---|
| 136 |
|
|---|
| 137 | TRACE("previous hwndEdit: %p\n",hwndEdit);
|
|---|
| 138 | hwndEdit = CreateWindowA ("edit", ((LPCREATESTRUCTA) lParam)->lpszName,
|
|---|
| 139 | style, 0, 0, 0, 0,
|
|---|
| 140 | hwnd, (HMENU) ID_EDIT,
|
|---|
| 141 | ((LPCREATESTRUCTA) lParam)->hInstance, NULL) ;
|
|---|
| 142 | TRACE("hwndEdit: %p hwnd: %p\n",hwndEdit,hwnd);
|
|---|
| 143 |
|
|---|
| 144 | SetWindowLongA(hwnd,GWL_STYLE, newstyle);
|
|---|
| 145 | return 0 ;
|
|---|
| 146 |
|
|---|
| 147 | case WM_SETFOCUS :
|
|---|
| 148 | DPRINTF_EDIT_MSG32("WM_SETFOCUS");
|
|---|
| 149 | SetFocus (hwndEdit) ;
|
|---|
| 150 | return 0 ;
|
|---|
| 151 |
|
|---|
| 152 | case WM_SIZE :
|
|---|
| 153 | DPRINTF_EDIT_MSG32("WM_SIZE");
|
|---|
| 154 | MoveWindow (hwndEdit, 0, 0, LOWORD (lParam), HIWORD (lParam), TRUE) ;
|
|---|
| 155 | return 0 ;
|
|---|
| 156 |
|
|---|
| 157 | case WM_COMMAND :
|
|---|
| 158 | DPRINTF_EDIT_MSG32("WM_COMMAND");
|
|---|
| 159 | switch(HIWORD(wParam)) {
|
|---|
| 160 | case EN_CHANGE:
|
|---|
| 161 | case EN_HSCROLL:
|
|---|
| 162 | case EN_KILLFOCUS:
|
|---|
| 163 | case EN_SETFOCUS:
|
|---|
| 164 | case EN_UPDATE:
|
|---|
| 165 | case EN_VSCROLL:
|
|---|
| 166 | return SendMessageA(hwndParent, WM_COMMAND,
|
|---|
| 167 | wParam, (LPARAM)(hwnd));
|
|---|
| 168 |
|
|---|
| 169 | case EN_ERRSPACE:
|
|---|
| 170 | case EN_MAXTEXT:
|
|---|
| 171 | MessageBoxA (hwnd, "RichEdit control out of space.",
|
|---|
| 172 | "ERROR", MB_OK | MB_ICONSTOP) ;
|
|---|
| 173 | return 0 ;
|
|---|
| 174 | }
|
|---|
| 175 |
|
|---|
| 176 | case EM_STREAMIN:
|
|---|
| 177 | DPRINTF_EDIT_MSG32("EM_STREAMIN");
|
|---|
| 178 |
|
|---|
| 179 | /* setup the RTF parser */
|
|---|
| 180 | RTFSetEditStream(( EDITSTREAM*)lParam);
|
|---|
| 181 | rtfFormat = wParam&(SF_TEXT|SF_RTF);
|
|---|
| 182 | WriterInit();
|
|---|
| 183 | RTFInit ();
|
|---|
| 184 | BeginFile();
|
|---|
| 185 |
|
|---|
| 186 | /* do the parsing */
|
|---|
| 187 | RTFRead ();
|
|---|
| 188 |
|
|---|
| 189 | rtfBufferSize = RTFToBuffer(NULL, 0);
|
|---|
| 190 | rtfBuffer = HeapAlloc(RICHED32_hHeap, 0,rtfBufferSize*sizeof(char));
|
|---|
| 191 | if(rtfBuffer)
|
|---|
| 192 | {
|
|---|
| 193 | RTFToBuffer(rtfBuffer, rtfBufferSize);
|
|---|
| 194 | SetWindowTextA(hwndEdit,rtfBuffer);
|
|---|
| 195 | HeapFree(RICHED32_hHeap, 0,rtfBuffer);
|
|---|
| 196 | }
|
|---|
| 197 | else
|
|---|
| 198 | WARN("Not enough memory for a allocating rtfBuffer\n");
|
|---|
| 199 |
|
|---|
| 200 | return 0;
|
|---|
| 201 |
|
|---|
| 202 | /* Messages specific to Richedit controls */
|
|---|
| 203 |
|
|---|
| 204 | case EM_AUTOURLDETECT:
|
|---|
| 205 | DPRINTF_EDIT_MSG32("EM_AUTOURLDETECT Ignored");
|
|---|
| 206 | return 0;
|
|---|
| 207 |
|
|---|
| 208 | case EM_CANPASTE:
|
|---|
| 209 | DPRINTF_EDIT_MSG32("EM_CANPASTE Ignored");
|
|---|
| 210 | return 0;
|
|---|
| 211 |
|
|---|
| 212 | case EM_CANREDO:
|
|---|
| 213 | DPRINTF_EDIT_MSG32("EM_CANREDO Ignored");
|
|---|
| 214 | return 0;
|
|---|
| 215 |
|
|---|
| 216 | case EM_DISPLAYBAND:
|
|---|
| 217 | DPRINTF_EDIT_MSG32("EM_DISPLAYBAND Ignored");
|
|---|
| 218 | return 0;
|
|---|
| 219 |
|
|---|
| 220 | case EM_EXGETSEL:
|
|---|
| 221 | DPRINTF_EDIT_MSG32("EM_EXGETSEL -> EM_GETSEL");
|
|---|
| 222 | cr = (VOID *) lParam;
|
|---|
| 223 | if (hwndEdit) SendMessageA( hwndEdit, EM_GETSEL, (INT)&cr->cpMin, (INT)&cr->cpMax);
|
|---|
| 224 | TRACE("cpMin: 0x%x cpMax: 0x%x\n",(INT)cr->cpMin,(INT)cr->cpMax);
|
|---|
| 225 | return 0;
|
|---|
| 226 |
|
|---|
| 227 | case EM_EXLIMITTEXT:
|
|---|
| 228 | {
|
|---|
| 229 | DWORD limit = lParam;
|
|---|
| 230 | DPRINTF_EDIT_MSG32("EM_EXLIMITTEXT");
|
|---|
| 231 | if (limit > 65534)
|
|---|
| 232 | {
|
|---|
| 233 | limit = 0xFFFFFFFF;
|
|---|
| 234 | }
|
|---|
| 235 | return SendMessageA(hwndEdit,EM_SETLIMITTEXT,limit,0);
|
|---|
| 236 | }
|
|---|
| 237 |
|
|---|
| 238 | case EM_EXLINEFROMCHAR:
|
|---|
| 239 | DPRINTF_EDIT_MSG32("EM_EXLINEFROMCHAR -> LINEFROMCHAR");
|
|---|
| 240 | if (hwndEdit) return SendMessageA( hwndEdit, EM_LINEFROMCHAR, lParam, wParam);
|
|---|
| 241 | return 0;
|
|---|
| 242 |
|
|---|
| 243 | case EM_EXSETSEL:
|
|---|
| 244 | DPRINTF_EDIT_MSG32("EM_EXSETSEL -> EM_SETSEL");
|
|---|
| 245 | cr = (VOID *) lParam;
|
|---|
| 246 | if (hwndEdit) SendMessageA( hwndEdit, EM_SETSEL, cr->cpMin, cr->cpMax);
|
|---|
| 247 | return 0;
|
|---|
| 248 |
|
|---|
| 249 | case EM_FINDTEXT:
|
|---|
| 250 | DPRINTF_EDIT_MSG32("EM_FINDTEXT Ignored");
|
|---|
| 251 | return 0;
|
|---|
| 252 |
|
|---|
| 253 | case EM_FINDTEXTEX:
|
|---|
| 254 | DPRINTF_EDIT_MSG32("EM_FINDTEXTEX Ignored");
|
|---|
| 255 | return 0;
|
|---|
| 256 |
|
|---|
| 257 | case EM_FINDTEXTEXW:
|
|---|
| 258 | DPRINTF_EDIT_MSG32("EM_FINDTEXTEXW Ignored");
|
|---|
| 259 | return 0;
|
|---|
| 260 |
|
|---|
| 261 | case EM_FINDTEXTW:
|
|---|
| 262 | DPRINTF_EDIT_MSG32("EM_FINDTEXTW Ignored");
|
|---|
| 263 | return 0;
|
|---|
| 264 |
|
|---|
| 265 | case EM_FINDWORDBREAK:
|
|---|
| 266 | DPRINTF_EDIT_MSG32("EM_FINDWORDBREAK Ignored");
|
|---|
| 267 | return 0;
|
|---|
| 268 |
|
|---|
| 269 | case EM_FORMATRANGE:
|
|---|
| 270 | DPRINTF_EDIT_MSG32("EM_FORMATRANGE Ignored");
|
|---|
| 271 | return 0;
|
|---|
| 272 |
|
|---|
| 273 | case EM_GETAUTOURLDETECT:
|
|---|
| 274 | DPRINTF_EDIT_MSG32("EM_GETAUTOURLDETECT Ignored");
|
|---|
| 275 | return 0;
|
|---|
| 276 |
|
|---|
| 277 | case EM_GETBIDIOPTIONS:
|
|---|
| 278 | DPRINTF_EDIT_MSG32("EM_GETBIDIOPTIONS Ignored");
|
|---|
| 279 | return 0;
|
|---|
| 280 |
|
|---|
| 281 | case EM_GETCHARFORMAT:
|
|---|
| 282 | DPRINTF_EDIT_MSG32("EM_GETCHARFORMAT Ignored");
|
|---|
| 283 | return 0;
|
|---|
| 284 |
|
|---|
| 285 | case EM_GETEDITSTYLE:
|
|---|
| 286 | DPRINTF_EDIT_MSG32("EM_GETEDITSTYLE Ignored");
|
|---|
| 287 | return 0;
|
|---|
| 288 |
|
|---|
| 289 | case EM_GETEVENTMASK:
|
|---|
| 290 | DPRINTF_EDIT_MSG32("EM_GETEVENTMASK Ignored");
|
|---|
| 291 | return 0;
|
|---|
| 292 |
|
|---|
| 293 | case EM_GETIMECOLOR:
|
|---|
| 294 | DPRINTF_EDIT_MSG32("EM_GETIMECOLOR Ignored");
|
|---|
| 295 | return 0;
|
|---|
| 296 |
|
|---|
| 297 | case EM_GETIMECOMPMODE:
|
|---|
| 298 | DPRINTF_EDIT_MSG32("EM_GETIMECOMPMODE Ignored");
|
|---|
| 299 | return 0;
|
|---|
| 300 |
|
|---|
| 301 | case EM_GETIMEOPTIONS:
|
|---|
| 302 | DPRINTF_EDIT_MSG32("EM_GETIMEOPTIONS Ignored");
|
|---|
| 303 | return 0;
|
|---|
| 304 |
|
|---|
| 305 | case EM_GETLANGOPTIONS:
|
|---|
| 306 | DPRINTF_EDIT_MSG32("STUB: EM_GETLANGOPTIONS");
|
|---|
| 307 | return 0;
|
|---|
| 308 |
|
|---|
| 309 | case EM_GETOLEINTERFACE:
|
|---|
| 310 | DPRINTF_EDIT_MSG32("EM_GETOLEINTERFACE Ignored");
|
|---|
| 311 | return 0;
|
|---|
| 312 |
|
|---|
| 313 | case EM_GETOPTIONS:
|
|---|
| 314 | DPRINTF_EDIT_MSG32("EM_GETOPTIONS Ignored");
|
|---|
| 315 | return 0;
|
|---|
| 316 |
|
|---|
| 317 | case EM_GETPARAFORMAT:
|
|---|
| 318 | DPRINTF_EDIT_MSG32("EM_GETPARAFORMAT Ignored");
|
|---|
| 319 | return 0;
|
|---|
| 320 |
|
|---|
| 321 | case EM_GETPUNCTUATION:
|
|---|
| 322 | DPRINTF_EDIT_MSG32("EM_GETPUNCTUATION Ignored");
|
|---|
| 323 | return 0;
|
|---|
| 324 |
|
|---|
| 325 | case EM_GETREDONAME:
|
|---|
| 326 | DPRINTF_EDIT_MSG32("EM_GETREDONAME Ignored");
|
|---|
| 327 | return 0;
|
|---|
| 328 |
|
|---|
| 329 | case EM_GETSCROLLPOS:
|
|---|
| 330 | DPRINTF_EDIT_MSG32("EM_GETSCROLLPOS Ignored");
|
|---|
| 331 | return 0;
|
|---|
| 332 |
|
|---|
| 333 | case EM_GETSELTEXT:
|
|---|
| 334 | DPRINTF_EDIT_MSG32("EM_GETSELTEXT");
|
|---|
| 335 | return RICHEDIT_GetSelText(hwndEdit,(void *)lParam);
|
|---|
| 336 |
|
|---|
| 337 | case EM_GETTEXTEX:
|
|---|
| 338 | DPRINTF_EDIT_MSG32("EM_GETTEXTEX Ignored");
|
|---|
| 339 | return 0;
|
|---|
| 340 |
|
|---|
| 341 | case EM_GETTEXTLENGTHEX:
|
|---|
| 342 | DPRINTF_EDIT_MSG32("EM_GETTEXTLENGTHEX Ignored");
|
|---|
| 343 | return 0;
|
|---|
| 344 |
|
|---|
| 345 | case EM_GETTEXTMODE:
|
|---|
| 346 | DPRINTF_EDIT_MSG32("EM_GETTEXTMODE Ignored");
|
|---|
| 347 | return 0;
|
|---|
| 348 |
|
|---|
| 349 | case EM_GETTEXTRANGE:
|
|---|
| 350 | DPRINTF_EDIT_MSG32("EM_GETTEXTRANGE");
|
|---|
| 351 | return RICHEDIT_GetTextRange(hwndEdit,(TEXTRANGEA *)lParam);
|
|---|
| 352 |
|
|---|
| 353 | case EM_GETTYPOGRAPHYOPTIONS:
|
|---|
| 354 | DPRINTF_EDIT_MSG32("EM_GETTYPOGRAPHYOPTIONS Ignored");
|
|---|
| 355 | return 0;
|
|---|
| 356 |
|
|---|
| 357 | case EM_GETUNDONAME:
|
|---|
| 358 | DPRINTF_EDIT_MSG32("EM_GETUNDONAME Ignored");
|
|---|
| 359 | return 0;
|
|---|
| 360 |
|
|---|
| 361 | case EM_GETWORDBREAKPROCEX:
|
|---|
| 362 | DPRINTF_EDIT_MSG32("EM_GETWORDBREAKPROCEX Ignored");
|
|---|
| 363 | return 0;
|
|---|
| 364 |
|
|---|
| 365 | case EM_GETWORDWRAPMODE:
|
|---|
| 366 | DPRINTF_EDIT_MSG32("EM_GETWORDWRAPMODE Ignored");
|
|---|
| 367 | return 0;
|
|---|
| 368 |
|
|---|
| 369 | case EM_GETZOOM:
|
|---|
| 370 | DPRINTF_EDIT_MSG32("EM_GETZOOM Ignored");
|
|---|
| 371 | return 0;
|
|---|
| 372 |
|
|---|
| 373 | case EM_HIDESELECTION:
|
|---|
| 374 | DPRINTF_EDIT_MSG32("EM_HIDESELECTION Ignored");
|
|---|
| 375 | return 0;
|
|---|
| 376 |
|
|---|
| 377 | case EM_PASTESPECIAL:
|
|---|
| 378 | DPRINTF_EDIT_MSG32("EM_PASTESPECIAL Ignored");
|
|---|
| 379 | return 0;
|
|---|
| 380 |
|
|---|
| 381 | case EM_RECONVERSION:
|
|---|
| 382 | DPRINTF_EDIT_MSG32("EM_RECONVERSION Ignored");
|
|---|
| 383 | return 0;
|
|---|
| 384 |
|
|---|
| 385 | case EM_REDO:
|
|---|
| 386 | DPRINTF_EDIT_MSG32("EM_REDO Ignored");
|
|---|
| 387 | return 0;
|
|---|
| 388 |
|
|---|
| 389 | case EM_REQUESTRESIZE:
|
|---|
| 390 | DPRINTF_EDIT_MSG32("EM_REQUESTRESIZE Ignored");
|
|---|
| 391 | return 0;
|
|---|
| 392 |
|
|---|
| 393 | case EM_SELECTIONTYPE:
|
|---|
| 394 | DPRINTF_EDIT_MSG32("EM_SELECTIONTYPE Ignored");
|
|---|
| 395 | return 0;
|
|---|
| 396 |
|
|---|
| 397 | case EM_SETBIDIOPTIONS:
|
|---|
| 398 | DPRINTF_EDIT_MSG32("EM_SETBIDIOPTIONS Ignored");
|
|---|
| 399 | return 0;
|
|---|
| 400 |
|
|---|
| 401 | case EM_SETBKGNDCOLOR:
|
|---|
| 402 | DPRINTF_EDIT_MSG32("EM_SETBKGNDCOLOR Ignored");
|
|---|
| 403 | return 0;
|
|---|
| 404 |
|
|---|
| 405 | case EM_SETCHARFORMAT:
|
|---|
| 406 | DPRINTF_EDIT_MSG32("EM_SETCHARFORMAT Ignored");
|
|---|
| 407 | return 0;
|
|---|
| 408 |
|
|---|
| 409 | case EM_SETEDITSTYLE:
|
|---|
| 410 | DPRINTF_EDIT_MSG32("EM_SETEDITSTYLE Ignored");
|
|---|
| 411 | return 0;
|
|---|
| 412 |
|
|---|
| 413 | case EM_SETEVENTMASK:
|
|---|
| 414 | DPRINTF_EDIT_MSG32("EM_SETEVENTMASK Ignored");
|
|---|
| 415 | return 0;
|
|---|
| 416 |
|
|---|
| 417 | case EM_SETFONTSIZE:
|
|---|
| 418 | DPRINTF_EDIT_MSG32("EM_SETFONTSIZE Ignored");
|
|---|
| 419 | return 0;
|
|---|
| 420 |
|
|---|
| 421 | case EM_SETIMECOLOR:
|
|---|
| 422 | DPRINTF_EDIT_MSG32("EM_SETIMECOLO Ignored");
|
|---|
| 423 | return 0;
|
|---|
| 424 |
|
|---|
| 425 | case EM_SETIMEOPTIONS:
|
|---|
| 426 | DPRINTF_EDIT_MSG32("EM_SETIMEOPTIONS Ignored");
|
|---|
| 427 | return 0;
|
|---|
| 428 |
|
|---|
| 429 | case EM_SETLANGOPTIONS:
|
|---|
| 430 | DPRINTF_EDIT_MSG32("EM_SETLANGOPTIONS Ignored");
|
|---|
| 431 | return 0;
|
|---|
| 432 |
|
|---|
| 433 | case EM_SETOLECALLBACK:
|
|---|
| 434 | DPRINTF_EDIT_MSG32("EM_SETOLECALLBACK Ignored");
|
|---|
| 435 | return 0;
|
|---|
| 436 |
|
|---|
| 437 | case EM_SETOPTIONS:
|
|---|
| 438 | DPRINTF_EDIT_MSG32("EM_SETOPTIONS Ignored");
|
|---|
| 439 | return 0;
|
|---|
| 440 |
|
|---|
| 441 | case EM_SETPALETTE:
|
|---|
| 442 | DPRINTF_EDIT_MSG32("EM_SETPALETTE Ignored");
|
|---|
| 443 | return 0;
|
|---|
| 444 |
|
|---|
| 445 | case EM_SETPARAFORMAT:
|
|---|
| 446 | DPRINTF_EDIT_MSG32("EM_SETPARAFORMAT Ignored");
|
|---|
| 447 | return 0;
|
|---|
| 448 |
|
|---|
| 449 | case EM_SETPUNCTUATION:
|
|---|
| 450 | DPRINTF_EDIT_MSG32("EM_SETPUNCTUATION Ignored");
|
|---|
| 451 | return 0;
|
|---|
| 452 |
|
|---|
| 453 | case EM_SETSCROLLPOS:
|
|---|
| 454 | DPRINTF_EDIT_MSG32("EM_SETSCROLLPOS Ignored");
|
|---|
| 455 | return 0;
|
|---|
| 456 |
|
|---|
| 457 | case EM_SETTARGETDEVICE:
|
|---|
| 458 | DPRINTF_EDIT_MSG32("EM_SETTARGETDEVICE Ignored");
|
|---|
| 459 | return 0;
|
|---|
| 460 |
|
|---|
| 461 | case EM_SETTEXTEX:
|
|---|
| 462 | DPRINTF_EDIT_MSG32("EM_SETTEXTEX Ignored");
|
|---|
| 463 | return 0;
|
|---|
| 464 |
|
|---|
| 465 | case EM_SETTEXTMODE:
|
|---|
| 466 | DPRINTF_EDIT_MSG32("EM_SETTEXTMODE Ignored");
|
|---|
| 467 | return 0;
|
|---|
| 468 |
|
|---|
| 469 | case EM_SETTYPOGRAPHYOPTIONS:
|
|---|
| 470 | DPRINTF_EDIT_MSG32("EM_SETTYPOGRAPHYOPTIONS Ignored");
|
|---|
| 471 | return 0;
|
|---|
| 472 |
|
|---|
| 473 | case EM_SETUNDOLIMIT:
|
|---|
| 474 | DPRINTF_EDIT_MSG32("EM_SETUNDOLIMIT Ignored");
|
|---|
| 475 | return 0;
|
|---|
| 476 |
|
|---|
| 477 | case EM_SETWORDBREAKPROCEX:
|
|---|
| 478 | DPRINTF_EDIT_MSG32("EM_SETWORDBREAKPROCEX Ignored");
|
|---|
| 479 | return 0;
|
|---|
| 480 |
|
|---|
| 481 | case EM_SETWORDWRAPMODE:
|
|---|
| 482 | DPRINTF_EDIT_MSG32("EM_SETWORDWRAPMODE Ignored");
|
|---|
| 483 | return 0;
|
|---|
| 484 |
|
|---|
| 485 | case EM_SETZOOM:
|
|---|
| 486 | DPRINTF_EDIT_MSG32("EM_SETZOOM Ignored");
|
|---|
| 487 | return 0;
|
|---|
| 488 |
|
|---|
| 489 | case EM_SHOWSCROLLBAR:
|
|---|
| 490 | DPRINTF_EDIT_MSG32("EM_SHOWSCROLLBAR Ignored");
|
|---|
| 491 | return 0;
|
|---|
| 492 |
|
|---|
| 493 | case EM_STOPGROUPTYPING:
|
|---|
| 494 | DPRINTF_EDIT_MSG32("EM_STOPGROUPTYPING Ignored");
|
|---|
| 495 | return 0;
|
|---|
| 496 |
|
|---|
| 497 | case EM_STREAMOUT:
|
|---|
| 498 | DPRINTF_EDIT_MSG32("EM_STREAMOUT Ignored");
|
|---|
| 499 | return 0;
|
|---|
| 500 |
|
|---|
| 501 | /* Messages dispatched to the edit control */
|
|---|
| 502 | case EM_CANUNDO:
|
|---|
| 503 | DPRINTF_EDIT_MSG32("EM_CANUNDO Passed to edit control");
|
|---|
| 504 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 505 | case EM_CHARFROMPOS:
|
|---|
| 506 | DPRINTF_EDIT_MSG32("EM_CHARFROMPOS Passed to edit control");
|
|---|
| 507 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 508 | case EM_EMPTYUNDOBUFFER:
|
|---|
| 509 | DPRINTF_EDIT_MSG32("EM_EMPTYUNDOBUFFER Passed to edit control");
|
|---|
| 510 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 511 | case EM_FMTLINES:
|
|---|
| 512 | DPRINTF_EDIT_MSG32("EM_FMTLINES Passed to edit control");
|
|---|
| 513 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 514 | case EM_GETFIRSTVISIBLELINE:
|
|---|
| 515 | DPRINTF_EDIT_MSG32("EM_GETFIRSTVISIBLELINE Passed to edit control");
|
|---|
| 516 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 517 | case EM_GETHANDLE:
|
|---|
| 518 | DPRINTF_EDIT_MSG32("EM_GETHANDLE Passed to edit control");
|
|---|
| 519 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 520 | /* case EM_GETIMESTATUS:*/
|
|---|
| 521 | case EM_GETLIMITTEXT:
|
|---|
| 522 | DPRINTF_EDIT_MSG32("EM_GETLIMITTEXT Passed to edit control");
|
|---|
| 523 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 524 | case EM_GETLINE:
|
|---|
| 525 | DPRINTF_EDIT_MSG32("EM_GETLINE Passed to edit control");
|
|---|
| 526 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 527 | case EM_GETLINECOUNT:
|
|---|
| 528 | DPRINTF_EDIT_MSG32("EM_GETLINECOUNT Passed to edit control");
|
|---|
| 529 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 530 | case EM_GETMARGINS:
|
|---|
| 531 | DPRINTF_EDIT_MSG32("EM_GETMARGINS Passed to edit control");
|
|---|
| 532 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 533 | case EM_GETMODIFY:
|
|---|
| 534 | DPRINTF_EDIT_MSG32("EM_GETMODIFY Passed to edit control");
|
|---|
| 535 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 536 | case EM_GETPASSWORDCHAR:
|
|---|
| 537 | DPRINTF_EDIT_MSG32("EM_GETPASSWORDCHAR Passed to edit control");
|
|---|
| 538 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 539 | case EM_GETRECT:
|
|---|
| 540 | DPRINTF_EDIT_MSG32("EM_GETRECT Passed to edit control");
|
|---|
| 541 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 542 | case EM_GETSEL:
|
|---|
| 543 | DPRINTF_EDIT_MSG32("EM_GETSEL Passed to edit control");
|
|---|
| 544 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 545 | case EM_GETTHUMB:
|
|---|
| 546 | DPRINTF_EDIT_MSG32("EM_GETTHUMB Passed to edit control");
|
|---|
| 547 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 548 | case EM_GETWORDBREAKPROC:
|
|---|
| 549 | DPRINTF_EDIT_MSG32("EM_GETWORDBREAKPROC Passed to edit control");
|
|---|
| 550 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 551 | case EM_LINEFROMCHAR:
|
|---|
| 552 | DPRINTF_EDIT_MSG32("EM_LINEFROMCHAR Passed to edit control");
|
|---|
| 553 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 554 | case EM_LINEINDEX:
|
|---|
| 555 | DPRINTF_EDIT_MSG32("EM_LINEINDEX Passed to edit control");
|
|---|
| 556 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 557 | case EM_LINELENGTH:
|
|---|
| 558 | DPRINTF_EDIT_MSG32("EM_LINELENGTH Passed to edit control");
|
|---|
| 559 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 560 | case EM_LINESCROLL:
|
|---|
| 561 | DPRINTF_EDIT_MSG32("EM_LINESCROLL Passed to edit control");
|
|---|
| 562 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 563 | case EM_POSFROMCHAR:
|
|---|
| 564 | DPRINTF_EDIT_MSG32("EM_POSFROMCHAR Passed to edit control");
|
|---|
| 565 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 566 | case EM_REPLACESEL:
|
|---|
| 567 | DPRINTF_EDIT_MSG32("case EM_REPLACESEL Passed to edit control");
|
|---|
| 568 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 569 | case EM_SCROLL:
|
|---|
| 570 | DPRINTF_EDIT_MSG32("case EM_SCROLL Passed to edit control");
|
|---|
| 571 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 572 | case EM_SCROLLCARET:
|
|---|
| 573 | DPRINTF_EDIT_MSG32("EM_SCROLLCARET Passed to edit control");
|
|---|
| 574 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 575 | case EM_SETHANDLE:
|
|---|
| 576 | DPRINTF_EDIT_MSG32("EM_SETHANDLE Passed to edit control");
|
|---|
| 577 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 578 | /* case EM_SETIMESTATUS:*/
|
|---|
| 579 | case EM_SETLIMITTEXT:
|
|---|
| 580 | DPRINTF_EDIT_MSG32("EM_SETLIMITTEXT Passed to edit control");
|
|---|
| 581 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 582 | case EM_SETMARGINS:
|
|---|
| 583 | DPRINTF_EDIT_MSG32("case EM_SETMARGINS Passed to edit control");
|
|---|
| 584 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 585 | case EM_SETMODIFY:
|
|---|
| 586 | DPRINTF_EDIT_MSG32("EM_SETMODIFY Passed to edit control");
|
|---|
| 587 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 588 | case EM_SETPASSWORDCHAR:
|
|---|
| 589 | DPRINTF_EDIT_MSG32("EM_SETPASSWORDCHAR Passed to edit control");
|
|---|
| 590 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 591 | case EM_SETREADONLY:
|
|---|
| 592 | DPRINTF_EDIT_MSG32("EM_SETREADONLY Passed to edit control");
|
|---|
| 593 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 594 | case EM_SETRECT:
|
|---|
| 595 | DPRINTF_EDIT_MSG32("EM_SETRECT Passed to edit control");
|
|---|
| 596 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 597 | case EM_SETRECTNP:
|
|---|
| 598 | DPRINTF_EDIT_MSG32("EM_SETRECTNP Passed to edit control");
|
|---|
| 599 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 600 | case EM_SETSEL:
|
|---|
| 601 | DPRINTF_EDIT_MSG32("EM_SETSEL Passed to edit control");
|
|---|
| 602 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 603 | case EM_SETTABSTOPS:
|
|---|
| 604 | DPRINTF_EDIT_MSG32("EM_SETTABSTOPS Passed to edit control");
|
|---|
| 605 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 606 | case EM_SETWORDBREAKPROC:
|
|---|
| 607 | DPRINTF_EDIT_MSG32("EM_SETWORDBREAKPROC Passed to edit control");
|
|---|
| 608 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 609 | case EM_UNDO:
|
|---|
| 610 | DPRINTF_EDIT_MSG32("EM_UNDO Passed to edit control");
|
|---|
| 611 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 612 |
|
|---|
| 613 | case WM_STYLECHANGING:
|
|---|
| 614 | DPRINTF_EDIT_MSG32("WM_STYLECHANGING Passed to edit control");
|
|---|
| 615 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 616 | case WM_STYLECHANGED:
|
|---|
| 617 | DPRINTF_EDIT_MSG32("WM_STYLECHANGED Passed to edit control");
|
|---|
| 618 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 619 | case WM_NCCALCSIZE:
|
|---|
| 620 | DPRINTF_EDIT_MSG32("WM_NCCALCSIZE Passed to edit control");
|
|---|
| 621 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 622 | case WM_GETTEXT:
|
|---|
| 623 | DPRINTF_EDIT_MSG32("WM_GETTEXT Passed to edit control");
|
|---|
| 624 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 625 | case WM_GETTEXTLENGTH:
|
|---|
| 626 | DPRINTF_EDIT_MSG32("WM_GETTEXTLENGTH Passed to edit control");
|
|---|
| 627 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 628 | case WM_SETTEXT:
|
|---|
| 629 | DPRINTF_EDIT_MSG32("WM_SETTEXT Passed to edit control");
|
|---|
| 630 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 631 | case WM_CUT:
|
|---|
| 632 | DPRINTF_EDIT_MSG32("WM_CUT Passed to edit control");
|
|---|
| 633 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 634 | case WM_COPY:
|
|---|
| 635 | DPRINTF_EDIT_MSG32("WM_COPY Passed to edit control");
|
|---|
| 636 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 637 | case WM_PASTE:
|
|---|
| 638 | DPRINTF_EDIT_MSG32("WM_PASTE Passed to edit control");
|
|---|
| 639 | return SendMessageA( hwndEdit, uMsg, wParam, lParam);
|
|---|
| 640 |
|
|---|
| 641 | /* Messages passed to default handler. */
|
|---|
| 642 | case WM_NCPAINT:
|
|---|
| 643 | DPRINTF_EDIT_MSG32("WM_NCPAINT Passed to default");
|
|---|
| 644 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 645 | case WM_PAINT:
|
|---|
| 646 | DPRINTF_EDIT_MSG32("WM_PAINT Passed to default");
|
|---|
| 647 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 648 | case WM_ERASEBKGND:
|
|---|
| 649 | DPRINTF_EDIT_MSG32("WM_ERASEBKGND Passed to default");
|
|---|
| 650 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 651 | case WM_KILLFOCUS:
|
|---|
| 652 | DPRINTF_EDIT_MSG32("WM_KILLFOCUS Passed to default");
|
|---|
| 653 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 654 | case WM_DESTROY:
|
|---|
| 655 | DPRINTF_EDIT_MSG32("WM_DESTROY Passed to default");
|
|---|
| 656 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 657 | case WM_CHILDACTIVATE:
|
|---|
| 658 | DPRINTF_EDIT_MSG32("WM_CHILDACTIVATE Passed to default");
|
|---|
| 659 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 660 |
|
|---|
| 661 | case WM_WINDOWPOSCHANGING:
|
|---|
| 662 | DPRINTF_EDIT_MSG32("WM_WINDOWPOSCHANGING Passed to default");
|
|---|
| 663 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 664 | case WM_WINDOWPOSCHANGED:
|
|---|
| 665 | DPRINTF_EDIT_MSG32("WM_WINDOWPOSCHANGED Passed to default");
|
|---|
| 666 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 667 | /* case WM_INITIALUPDATE:
|
|---|
| 668 | DPRINTF_EDIT_MSG32("WM_INITIALUPDATE Passed to default");
|
|---|
| 669 | return DefWindowProcA( hwnd,uMsg,wParam,lParam); */
|
|---|
| 670 | case WM_CTLCOLOREDIT:
|
|---|
| 671 | DPRINTF_EDIT_MSG32("WM_CTLCOLOREDIT Passed to default");
|
|---|
| 672 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 673 | case WM_SETCURSOR:
|
|---|
| 674 | DPRINTF_EDIT_MSG32("WM_SETCURSOR Passed to default");
|
|---|
| 675 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 676 | case WM_MOVE:
|
|---|
| 677 | DPRINTF_EDIT_MSG32("WM_MOVE Passed to default");
|
|---|
| 678 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 679 | case WM_SHOWWINDOW:
|
|---|
| 680 | DPRINTF_EDIT_MSG32("WM_SHOWWINDOW Passed to default");
|
|---|
| 681 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 682 | case WM_NCCREATE:
|
|---|
| 683 | DPRINTF_EDIT_MSG32("WM_NCCREATE Passed to default");
|
|---|
| 684 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 685 | case WM_PARENTNOTIFY:
|
|---|
| 686 | DPRINTF_EDIT_MSG32("WM_PARENTNOTIFY Passed to default");
|
|---|
| 687 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 688 | case WM_SETREDRAW:
|
|---|
| 689 | DPRINTF_EDIT_MSG32("WM_SETREDRAW Passed to default");
|
|---|
| 690 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 691 | case WM_NCDESTROY:
|
|---|
| 692 | DPRINTF_EDIT_MSG32("WM_NCDESTROY Passed to default");
|
|---|
| 693 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 694 | case WM_NCHITTEST:
|
|---|
| 695 | DPRINTF_EDIT_MSG32("WM_NCHITTEST Passed to default");
|
|---|
| 696 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 697 | case WM_CTLCOLORSTATIC:
|
|---|
| 698 | DPRINTF_EDIT_MSG32("WM_CTLCOLORSTATIC Passed to default");
|
|---|
| 699 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 700 | case WM_NCMOUSEMOVE:
|
|---|
| 701 | DPRINTF_EDIT_MSG32("WM_NCMOUSEMOVE Passed to default");
|
|---|
| 702 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 703 | case WM_CLEAR:
|
|---|
| 704 | DPRINTF_EDIT_MSG32("WM_CLEAR Passed to default");
|
|---|
| 705 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 706 | /*
|
|---|
| 707 | * used by IE in the EULA box
|
|---|
| 708 | */
|
|---|
| 709 | case WM_ALTTABACTIVE:
|
|---|
| 710 | DPRINTF_EDIT_MSG32("WM_ALTTABACTIVE");
|
|---|
| 711 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 712 | case WM_GETDLGCODE:
|
|---|
| 713 | DPRINTF_EDIT_MSG32("WM_GETDLGCODE");
|
|---|
| 714 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 715 | case WM_SETFONT:
|
|---|
| 716 | DPRINTF_EDIT_MSG32("WM_SETFONT");
|
|---|
| 717 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 718 |
|
|---|
| 719 | }
|
|---|
| 720 |
|
|---|
| 721 | FIXME("Unknown message 0x%x Passed to default hwnd=%p, wParam=%08x, lParam=%08x\n",
|
|---|
| 722 | uMsg, hwnd, (UINT)wParam, (UINT)lParam);
|
|---|
| 723 |
|
|---|
| 724 | return DefWindowProcA( hwnd,uMsg,wParam,lParam);
|
|---|
| 725 | }
|
|---|
| 726 |
|
|---|
| 727 | /***********************************************************************
|
|---|
| 728 | * DllGetVersion [RICHED32.2]
|
|---|
| 729 | *
|
|---|
| 730 | * Retrieves version information of the 'RICHED32.DLL'
|
|---|
| 731 | *
|
|---|
| 732 | * PARAMS
|
|---|
| 733 | * pdvi [O] pointer to version information structure.
|
|---|
| 734 | *
|
|---|
| 735 | * RETURNS
|
|---|
| 736 | * Success: S_OK
|
|---|
| 737 | * Failure: E_INVALIDARG
|
|---|
| 738 | *
|
|---|
| 739 | * NOTES
|
|---|
| 740 | * Returns version of a comctl32.dll from IE4.01 SP1.
|
|---|
| 741 | */
|
|---|
| 742 |
|
|---|
| 743 | HRESULT WINAPI
|
|---|
| 744 | RICHED32_DllGetVersion (DLLVERSIONINFO *pdvi)
|
|---|
| 745 | {
|
|---|
| 746 | TRACE("\n");
|
|---|
| 747 |
|
|---|
| 748 | if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) {
|
|---|
| 749 |
|
|---|
| 750 | return E_INVALIDARG;
|
|---|
| 751 | }
|
|---|
| 752 |
|
|---|
| 753 | pdvi->dwMajorVersion = 4;
|
|---|
| 754 | pdvi->dwMinorVersion = 0;
|
|---|
| 755 | pdvi->dwBuildNumber = 0;
|
|---|
| 756 | pdvi->dwPlatformID = 0;
|
|---|
| 757 |
|
|---|
| 758 | return S_OK;
|
|---|
| 759 | }
|
|---|
| 760 |
|
|---|
| 761 | /***
|
|---|
| 762 | * DESCRIPTION:
|
|---|
| 763 | * Registers the window class.
|
|---|
| 764 | *
|
|---|
| 765 | * PARAMETER(S):
|
|---|
| 766 | * None
|
|---|
| 767 | *
|
|---|
| 768 | * RETURN:
|
|---|
| 769 | * None
|
|---|
| 770 | */
|
|---|
| 771 | VOID RICHED32_Register(void)
|
|---|
| 772 | {
|
|---|
| 773 | WNDCLASSA wndClass;
|
|---|
| 774 |
|
|---|
| 775 | TRACE("\n");
|
|---|
| 776 |
|
|---|
| 777 | ZeroMemory(&wndClass, sizeof(WNDCLASSA));
|
|---|
| 778 | wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;
|
|---|
| 779 | wndClass.lpfnWndProc = (WNDPROC)RICHED32_WindowProc;
|
|---|
| 780 | wndClass.cbClsExtra = 0;
|
|---|
| 781 | wndClass.cbWndExtra = 0; /*(sizeof(RICHED32_INFO *);*/
|
|---|
| 782 | wndClass.hCursor = LoadCursorA(0, IDC_ARROWA);
|
|---|
| 783 | wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
|---|
| 784 | wndClass.lpszClassName = RICHEDIT_CLASS10A; /* WC_RICHED32A; */
|
|---|
| 785 |
|
|---|
| 786 | RegisterClassA (&wndClass);
|
|---|
| 787 | }
|
|---|
| 788 |
|
|---|
| 789 | /***
|
|---|
| 790 | * DESCRIPTION:
|
|---|
| 791 | * Unregisters the window class.
|
|---|
| 792 | *
|
|---|
| 793 | * PARAMETER(S):
|
|---|
| 794 | * None
|
|---|
| 795 | *
|
|---|
| 796 | * RETURN:
|
|---|
| 797 | * None
|
|---|
| 798 | */
|
|---|
| 799 | VOID RICHED32_Unregister(void)
|
|---|
| 800 | {
|
|---|
| 801 | TRACE("\n");
|
|---|
| 802 |
|
|---|
| 803 | UnregisterClassA(RICHEDIT_CLASS10A, (HINSTANCE)NULL);
|
|---|
| 804 | }
|
|---|
| 805 |
|
|---|
| 806 | INT RICHEDIT_GetTextRange(HWND hwnd,TEXTRANGEA *tr)
|
|---|
| 807 | {
|
|---|
| 808 | UINT alloc_size, text_size, range_size;
|
|---|
| 809 | char *text;
|
|---|
| 810 |
|
|---|
| 811 | TRACE("start: 0x%x stop: 0x%x\n",(INT)tr->chrg.cpMin,(INT)tr->chrg.cpMax);
|
|---|
| 812 |
|
|---|
| 813 | if (!(alloc_size = SendMessageA(hwnd,WM_GETTEXTLENGTH,0,0))) return FALSE;
|
|---|
| 814 | if (!(text = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (alloc_size+1))))
|
|---|
| 815 | return FALSE;
|
|---|
| 816 | text_size = SendMessageA(hwnd,WM_GETTEXT,alloc_size,(INT)text);
|
|---|
| 817 |
|
|---|
| 818 | if (text_size > tr->chrg.cpMin)
|
|---|
| 819 | {
|
|---|
| 820 | range_size = (text_size> tr->chrg.cpMax) ? (tr->chrg.cpMax - tr->chrg.cpMin) : (text_size - tr->chrg.cpMin);
|
|---|
| 821 | TRACE("EditText: %.30s ...\n",text+tr->chrg.cpMin);
|
|---|
| 822 | memcpy(tr->lpstrText,text+tr->chrg.cpMin,range_size);
|
|---|
| 823 | }
|
|---|
| 824 | else range_size = 0;
|
|---|
| 825 | HeapFree(GetProcessHeap(), 0, text);
|
|---|
| 826 |
|
|---|
| 827 | return range_size;
|
|---|
| 828 | }
|
|---|
| 829 |
|
|---|
| 830 | INT RICHEDIT_GetSelText(HWND hwnd,LPSTR lpstrBuffer)
|
|---|
| 831 | {
|
|---|
| 832 | TEXTRANGEA textrange;
|
|---|
| 833 |
|
|---|
| 834 | textrange.lpstrText = lpstrBuffer;
|
|---|
| 835 | SendMessageA(hwnd,EM_GETSEL,(INT)&textrange.chrg.cpMin,(INT)&textrange.chrg.cpMax);
|
|---|
| 836 | return RICHEDIT_GetTextRange(hwnd,&textrange);
|
|---|
| 837 | }
|
|---|