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