Sweden-Number/dlls/richedit/richedit.c

107 lines
2.8 KiB
C
Raw Normal View History

/*
* 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
*/
2002-06-01 01:06:46 +02:00
#include <stdarg.h>
#include <string.h>
2000-11-30 02:31:28 +01:00
#include "windef.h"
#include "winbase.h"
2001-11-16 19:11:15 +01:00
#include "wingdi.h"
#include "winreg.h"
#include "winerror.h"
#include "winuser.h"
#include "richedit.h"
2000-09-29 03:03:30 +02:00
#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);
2000-05-11 23:46:51 +02:00
/***********************************************************************
2001-07-11 20:56:41 +02:00
* DllGetVersion [RICHED32.2]
*
* Retrieves version information
*/
HRESULT WINAPI RICHED32_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;
}
/* 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;
}