ReactOS  0.4.15-dev-1386-g5cb9f87
richedit.c
Go to the documentation of this file.
1 /*
2  * RichEdit32 functions
3  *
4  * This module is a simple wrapper for the RichEdit 2.0 control
5  *
6  * Copyright 2000 by Jean-Claude Batista
7  * Copyright 2005 Mike McCormack
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <stdarg.h>
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 "winuser.h"
32 #include "richedit.h"
33 #include "shlwapi.h"
34 
35 #include "wine/debug.h"
36 
38 
39 /* Window procedure of the RichEdit 1.0 control in riched20.dll */
41 
42 
43 /* Registers the window class. */
44 static BOOL RICHED32_Register(void)
45 {
46  WNDCLASSA wndClass;
47 
48  ZeroMemory(&wndClass, sizeof(WNDCLASSA));
51  wndClass.cbClsExtra = 0;
52  wndClass.cbWndExtra = sizeof(void *);
53  wndClass.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
54  wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
55  wndClass.lpszClassName = RICHEDIT_CLASS10A; /* WC_RICHED32A; */
56 
57  RegisterClassA(&wndClass);
58 
59  return TRUE;
60 }
61 
62 /* Initialization function */
64 {
65  TRACE("\n");
66  switch (fdwReason)
67  {
68  case DLL_PROCESS_ATTACH:
69  DisableThreadLibraryCalls(hinstDLL);
70  return RICHED32_Register();
71 
72  case DLL_PROCESS_DETACH:
73  if (lpvReserved) break;
75  break;
76  }
77  return TRUE;
78 }
79 
80 /***********************************************************************
81  * DllGetVersion [RICHED32.2]
82  *
83  * Retrieves version information
84  */
86 {
87  TRACE("\n");
88 
89  if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
90  return E_INVALIDARG;
91 
92  pdvi->dwMajorVersion = 4;
93  pdvi->dwMinorVersion = 0;
94  pdvi->dwBuildNumber = 0;
95  pdvi->dwPlatformID = 0;
96 
97  return S_OK;
98 }
DWORD dwMinorVersion
Definition: shlwapi.h:1956
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
int cbClsExtra
Definition: winuser.h:3140
#define ZeroMemory
Definition: winbase.h:1648
#define CS_HREDRAW
Definition: winuser.h:648
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
UINT_PTR WPARAM
Definition: windef.h:207
HBRUSH hbrBackground
Definition: winuser.h:3145
char * LPSTR
Definition: xmlstorage.h:182
#define COLOR_WINDOW
Definition: winuser.h:908
static IN DWORD IN LPVOID lpvReserved
int cbWndExtra
Definition: winuser.h:3141
DWORD dwBuildNumber
Definition: shlwapi.h:1957
unsigned int BOOL
Definition: ntddk_ex.h:94
HCURSOR hCursor
Definition: winuser.h:3144
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD dwMajorVersion
Definition: shlwapi.h:1955
LONG_PTR LPARAM
Definition: windef.h:208
#define DLL_PROCESS_DETACH
Definition: compat.h:130
LRESULT WINAPI RichEdit10ANSIWndProc(HWND, UINT, WPARAM, LPARAM)
Definition: editor.c:5105
#define CS_VREDRAW
Definition: winuser.h:653
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define CS_GLOBALCLASS
Definition: winuser.h:647
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CS_DBLCLKS
Definition: winuser.h:646
DWORD dwPlatformID
Definition: shlwapi.h:1958
LPCSTR lpszClassName
Definition: winuser.h:3147
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3138
#define S_OK
Definition: intsafe.h:51
#define RICHEDIT_CLASS10A
Definition: richedit.h:52
WINE_DEFAULT_DEBUG_CHANNEL(richedit)
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: richedit.c:63
WNDPROC lpfnWndProc
Definition: winuser.h:3139
#define IDC_ARROW
Definition: winuser.h:682
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
LONG_PTR LRESULT
Definition: windef.h:209
static BOOL RICHED32_Register(void)
Definition: richedit.c:44
HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *pdvi)
Definition: richedit.c:85
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)