d2d1: Create feature level 10.0 device context state objects.
[wine.git] / dlls / riched32 / richedit.c
blob44ce8434e38536bede4b289dea270ab7f7719a3c
1 /*
2 * RichEdit32 functions
4 * This module is a simple wrapper for the RichEdit 2.0 control
6 * Copyright 2000 by Jean-Claude Batista
7 * Copyright 2005 Mike McCormack
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.
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.
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
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"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(richedit);
39 /* Window procedure of the RichEdit 1.0 control in riched20.dll */
40 extern LRESULT WINAPI RichEdit10ANSIWndProc(HWND, UINT, WPARAM, LPARAM);
43 /* Registers the window class. */
44 static BOOL RICHED32_Register(void)
46 WNDCLASSA wndClass;
48 ZeroMemory(&wndClass, sizeof(WNDCLASSA));
49 wndClass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;
50 wndClass.lpfnWndProc = RichEdit10ANSIWndProc;
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; */
57 RegisterClassA(&wndClass);
59 return TRUE;
62 /* Initialization function */
63 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
65 TRACE("\n");
66 switch (fdwReason)
68 case DLL_PROCESS_ATTACH:
69 DisableThreadLibraryCalls(hinstDLL);
70 return RICHED32_Register();
72 case DLL_PROCESS_DETACH:
73 if (lpvReserved) break;
74 UnregisterClassA(RICHEDIT_CLASS10A, NULL);
75 break;
77 return TRUE;
80 /***********************************************************************
81 * DllGetVersion [RICHED32.2]
83 * Retrieves version information
85 HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
87 TRACE("\n");
89 if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
90 return E_INVALIDARG;
92 pdvi->dwMajorVersion = 4;
93 pdvi->dwMinorVersion = 0;
94 pdvi->dwBuildNumber = 0;
95 pdvi->dwPlatformID = 0;
97 return S_OK;