2000-05-07 22:23:41 +02:00
|
|
|
/*
|
|
|
|
* RichEdit32 functions
|
|
|
|
*
|
2005-03-10 12:16:35 +01:00
|
|
|
* This module is a simple wrapper for the RichEdit 2.0 control
|
2000-05-07 22:23:41 +02:00
|
|
|
*
|
|
|
|
* Copyright 2000 by Jean-Claude Batista
|
2005-03-10 12:16:35 +01:00
|
|
|
* Copyright 2005 Mike McCormack
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-05-07 22:23:41 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2000-11-30 02:31:28 +01:00
|
|
|
#include "windef.h"
|
2000-05-07 22:23:41 +02:00
|
|
|
#include "winbase.h"
|
2001-11-16 19:11:15 +01:00
|
|
|
#include "wingdi.h"
|
2001-11-06 23:31:19 +01:00
|
|
|
#include "winreg.h"
|
2000-05-07 22:23:41 +02:00
|
|
|
#include "winerror.h"
|
2005-03-10 12:16:35 +01:00
|
|
|
#include "winuser.h"
|
2000-05-07 22:23:41 +02:00
|
|
|
#include "richedit.h"
|
2000-09-29 03:03:30 +02:00
|
|
|
#include "shlwapi.h"
|
2000-05-07 22:23:41 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2000-05-07 22:23:41 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
|
2000-05-07 22:23:41 +02:00
|
|
|
|
2005-03-10 12:16:35 +01:00
|
|
|
/* Window procedure of the RichEdit 1.0 control in riched20.dll */
|
|
|
|
extern LRESULT WINAPI RichEdit10ANSIWndProc(HWND, UINT, WPARAM, LPARAM);
|
2002-01-14 20:44:07 +01:00
|
|
|
|
2000-05-07 22:23:41 +02:00
|
|
|
|
2005-03-10 12:16:35 +01:00
|
|
|
/* Unregisters the window class. */
|
|
|
|
static BOOL RICHED32_Unregister(void)
|
2000-05-07 22:23:41 +02:00
|
|
|
{
|
2002-01-14 20:44:07 +01:00
|
|
|
TRACE("\n");
|
|
|
|
|
2005-03-10 12:16:35 +01:00
|
|
|
UnregisterClassA(RICHEDIT_CLASS10A, NULL);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Registers the window class. */
|
|
|
|
static BOOL RICHED32_Register(void)
|
|
|
|
{
|
|
|
|
WNDCLASSA wndClass;
|
|
|
|
|
2000-05-07 22:23:41 +02:00
|
|
|
ZeroMemory(&wndClass, sizeof(WNDCLASSA));
|
2008-06-26 22:17:38 +02:00
|
|
|
wndClass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;
|
2005-03-10 12:16:35 +01:00
|
|
|
wndClass.lpfnWndProc = RichEdit10ANSIWndProc;
|
2000-05-07 22:23:41 +02:00
|
|
|
wndClass.cbClsExtra = 0;
|
2005-03-10 12:16:35 +01:00
|
|
|
wndClass.cbWndExtra = 4;
|
2003-09-10 05:56:47 +02:00
|
|
|
wndClass.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
|
2000-05-07 22:23:41 +02:00
|
|
|
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
2002-04-29 20:48:56 +02:00
|
|
|
wndClass.lpszClassName = RICHEDIT_CLASS10A; /* WC_RICHED32A; */
|
2000-05-07 22:23:41 +02:00
|
|
|
|
2005-03-10 12:16:35 +01:00
|
|
|
RegisterClassA(&wndClass);
|
2000-05-07 22:23:41 +02:00
|
|
|
|
2005-03-10 12:16:35 +01:00
|
|
|
return TRUE;
|
2000-05-07 22:23:41 +02:00
|
|
|
}
|
2002-04-23 01:08:19 +02:00
|
|
|
|
2005-03-10 12:16:35 +01:00
|
|
|
/* Initialization function */
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
2004-05-04 04:54:30 +02:00
|
|
|
{
|
2005-03-10 12:16:35 +01:00
|
|
|
TRACE("\n");
|
|
|
|
switch (fdwReason)
|
2004-05-04 04:54:30 +02:00
|
|
|
{
|
2005-03-10 12:16:35 +01:00
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
|
|
return RICHED32_Register();
|
2002-04-23 01:08:19 +02:00
|
|
|
|
2005-03-10 12:16:35 +01:00
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
return RICHED32_Unregister();
|
2002-04-23 01:08:19 +02:00
|
|
|
}
|
2005-03-10 12:16:35 +01:00
|
|
|
return TRUE;
|
2002-04-23 01:08:19 +02:00
|
|
|
}
|
2005-05-16 10:51:19 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllGetVersion [RICHED32.2]
|
|
|
|
*
|
|
|
|
* Retrieves version information
|
|
|
|
*/
|
2005-08-08 19:43:51 +02:00
|
|
|
HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
|
2005-05-16 10:51:19 +02:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|