Sync to Wine-20050830:
[reactos.git] / reactos / lib / richedit / richedit.c
index e0d5616..155d4d8 100644 (file)
-/*\r
- * RichEdit32  functions\r
- *\r
- * This module is a simple wrapper for the RichEdit 2.0 control\r
- *\r
- * Copyright 2000 by Jean-Claude Batista\r
- * Copyright 2005 Mike McCormack\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- */\r
-\r
-#include <stdarg.h>\r
-#include <string.h>\r
-#include "windef.h"\r
-#include "winbase.h"\r
-#include "wingdi.h"\r
-#include "winreg.h"\r
-#include "winerror.h"\r
-#include "winuser.h"\r
-#include "richedit.h"\r
-#include "shlwapi.h"\r
-\r
-#include "wine/debug.h"\r
-\r
-WINE_DEFAULT_DEBUG_CHANNEL(richedit);\r
-\r
-/* Window procedure of the RichEdit 1.0 control in riched20.dll */\r
-extern LRESULT WINAPI RichEdit10ANSIWndProc(HWND, UINT, WPARAM, LPARAM);\r
-\r
-\r
-/***********************************************************************\r
- * DllGetVersion [RICHED32.2]\r
- *\r
- * Retrieves version information\r
- */\r
-HRESULT WINAPI RICHED32_DllGetVersion (DLLVERSIONINFO *pdvi)\r
-{\r
-    TRACE("\n");\r
-\r
-    if (pdvi->cbSize != sizeof(DLLVERSIONINFO))\r
-       return E_INVALIDARG;\r
-\r
-    pdvi->dwMajorVersion = 4;\r
-    pdvi->dwMinorVersion = 0;\r
-    pdvi->dwBuildNumber = 0;\r
-    pdvi->dwPlatformID = 0;\r
-\r
-    return S_OK;\r
-}\r
-\r
-/* Unregisters the window class. */\r
-static BOOL RICHED32_Unregister(void)\r
-{\r
-    TRACE("\n");\r
-\r
-    UnregisterClassA(RICHEDIT_CLASS10A, NULL);\r
-    return TRUE;\r
-}\r
-\r
-\r
-/* Registers the window class. */\r
-static BOOL RICHED32_Register(void)\r
-{\r
-    WNDCLASSA wndClass;\r
-\r
-    ZeroMemory(&wndClass, sizeof(WNDCLASSA));\r
-    wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;\r
-    wndClass.lpfnWndProc = RichEdit10ANSIWndProc;\r
-    wndClass.cbClsExtra = 0;\r
-    wndClass.cbWndExtra = 4;\r
-    wndClass.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);\r
-    wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);\r
-    wndClass.lpszClassName = RICHEDIT_CLASS10A; /* WC_RICHED32A; */\r
-\r
-    RegisterClassA(&wndClass);\r
-\r
-    return TRUE;\r
-}\r
-\r
-/* Initialization function */\r
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)\r
-{\r
-    TRACE("\n");\r
-    switch (fdwReason)\r
-    {\r
-    case DLL_PROCESS_ATTACH:\r
-        DisableThreadLibraryCalls(hinstDLL);\r
-        return RICHED32_Register();\r
-\r
-    case DLL_PROCESS_DETACH:\r
-        return RICHED32_Unregister();\r
-    }\r
-    return TRUE;\r
-}\r
+/*
+ * RichEdit32  functions
+ *
+ * This module is a simple wrapper for the RichEdit 2.0 control
+ *
+ * Copyright 2000 by Jean-Claude Batista
+ * Copyright 2005 Mike McCormack
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <stdarg.h>
+#include <string.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winreg.h"
+#include "winerror.h"
+#include "winuser.h"
+#include "richedit.h"
+#include "shlwapi.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
+
+/* Window procedure of the RichEdit 1.0 control in riched20.dll */
+extern LRESULT WINAPI RichEdit10ANSIWndProc(HWND, UINT, WPARAM, LPARAM);
+
+
+/* Unregisters the window class. */
+static BOOL RICHED32_Unregister(void)
+{
+    TRACE("\n");
+
+    UnregisterClassA(RICHEDIT_CLASS10A, NULL);
+    return TRUE;
+}
+
+
+/* Registers the window class. */
+static BOOL RICHED32_Register(void)
+{
+    WNDCLASSA wndClass;
+
+    ZeroMemory(&wndClass, sizeof(WNDCLASSA));
+    wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;
+    wndClass.lpfnWndProc = RichEdit10ANSIWndProc;
+    wndClass.cbClsExtra = 0;
+    wndClass.cbWndExtra = 4;
+    wndClass.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
+    wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
+    wndClass.lpszClassName = RICHEDIT_CLASS10A; /* WC_RICHED32A; */
+
+    RegisterClassA(&wndClass);
+
+    return TRUE;
+}
+
+/* Initialization function */
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    TRACE("\n");
+    switch (fdwReason)
+    {
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(hinstDLL);
+        return RICHED32_Register();
+
+    case DLL_PROCESS_DETACH:
+        return RICHED32_Unregister();
+    }
+    return TRUE;
+}
+
+/***********************************************************************
+ * DllGetVersion [RICHED32.2]
+ *
+ * Retrieves version information
+ */
+HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
+{
+    TRACE("\n");
+
+    if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
+       return E_INVALIDARG;
+
+    pdvi->dwMajorVersion = 4;
+    pdvi->dwMinorVersion = 0;
+    pdvi->dwBuildNumber = 0;
+    pdvi->dwPlatformID = 0;
+
+    return S_OK;
+}