Changeset 3922 for trunk/src/riched32/richedit.c
- Timestamp:
- Aug 2, 2000, 4:58:40 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/riched32/richedit.c
r3787 r3922 1 /* $Id: richedit.c,v 1.3 2000-08-02 14:58:40 bird Exp $ */ 1 2 /* 2 3 * RichEdit32 functions 3 4 * 4 5 * This module is a simple wrap-arround the edit controls. 5 * At the point, it is good only for application who use the RICHEDIT control to 6 * At the point, it is good only for application who use the RICHEDIT control to 6 7 * display RTF text. 7 8 * 8 9 * Copyright 2000 by Jean-Claude Batista 9 * 10 */ 11 10 * 11 */ 12 12 13 #include "windows.h" 13 14 #include "winbase.h" … … 47 48 RICHED32_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) 48 49 { 49 50 50 51 switch (fdwReason) { 51 52 case DLL_PROCESS_ATTACH: … … 60 61 61 62 } 62 63 63 64 /* register the Rich Edit class */ 64 65 RICHED32_Register (); … … 70 71 RICHED32_dwProcessesAttached--; 71 72 72 /* unregister all common control classes */ 73 /* unregister all common control classes */ 73 74 RICHED32_Unregister (); 74 75 … … 77 78 RICHED32_hHeap = (HANDLE)NULL; 78 79 } 79 break; 80 break; 80 81 } 81 82 … … 94 95 int RTFToBuffer(char* pBuffer, int nBufferSize); 95 96 LONG newstyle = 0; 96 LONG style = 0; 97 LONG style = 0; 97 98 98 99 static HWND hwndEdit; 99 100 static char* rtfBuffer; 100 101 int rtfBufferSize; 101 102 102 103 switch (uMsg) 103 104 { 104 105 case WM_CREATE : 106 105 106 case WM_CREATE : 107 107 108 /* remove SCROLLBARS from the current window style */ 108 109 newstyle = style = ((LPCREATESTRUCTA) lParam)->style; … … 113 114 114 115 #ifdef __WIN32OS2__ 115 style |= WS_CHILD; 116 style |= WS_CHILD; 116 117 #endif 117 118 hwndEdit = CreateWindowA ("edit", ((LPCREATESTRUCTA) lParam)->lpszName, … … 119 120 hwnd, (HMENU) ID_EDIT, 120 121 ((LPCREATESTRUCTA) lParam)->hInstance, NULL) ; 121 122 SetWindowLongA(hwnd,GWL_STYLE, newstyle); 123 return 0 ; 124 125 case WM_SETFOCUS : 122 123 SetWindowLongA(hwnd,GWL_STYLE, newstyle); 124 return 0 ; 125 126 case WM_SETFOCUS : 126 127 SetFocus (hwndEdit) ; 127 128 return 0 ; 128 129 case WM_SIZE : 129 130 case WM_SIZE : 130 131 MoveWindow (hwndEdit, 0, 0, LOWORD (lParam), HIWORD (lParam), TRUE) ; 131 132 return 0 ; 132 133 133 134 case WM_COMMAND : 134 135 if (LOWORD (wParam) == ID_EDIT) 135 if (HIWORD (wParam) == EN_ERRSPACE || 136 if (HIWORD (wParam) == EN_ERRSPACE || 136 137 HIWORD (wParam) == EN_MAXTEXT) 137 138 … … 139 140 "ERROR", MB_OK | MB_ICONSTOP) ; 140 141 return 0 ; 141 142 case EM_STREAMIN: 143 142 143 case EM_STREAMIN: 144 144 145 /* setup the RTF parser */ 145 146 RTFSetEditStream(( EDITSTREAM*)lParam); 146 147 WriterInit(); 147 148 RTFInit (); 148 BeginFile(); 149 BeginFile(); 149 150 150 151 /* do the parsing */ 151 152 RTFRead (); 152 153 153 154 rtfBufferSize = RTFToBuffer(NULL, 0); 154 155 rtfBuffer = HeapAlloc(RICHED32_hHeap, 0,rtfBufferSize*sizeof(char)); … … 161 162 else 162 163 WARN("Not enough memory for a allocating rtfBuffer\n"); 163 164 return 0; 164 165 return 0; 165 166 } 166 167 /*return SendMessageA( hwndEdit,uMsg,wParam,lParam);*/ … … 188 189 { 189 190 if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) { 190 191 191 192 return E_INVALIDARG; 192 193 } … … 203 204 * DESCRIPTION: 204 205 * Registers the window class. 205 * 206 * 206 207 * PARAMETER(S): 207 208 * None … … 212 213 VOID RICHED32_Register(void) 213 214 { 214 WNDCLASSA wndClass; 215 WNDCLASSA wndClass; 215 216 216 217 ZeroMemory(&wndClass, sizeof(WNDCLASSA)); … … 229 230 * DESCRIPTION: 230 231 * Unregisters the window class. 231 * 232 * 232 233 * PARAMETER(S): 233 234 * None
Note:
See TracChangeset
for help on using the changeset viewer.