mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
49 lines
1.1 KiB
#include "wrapper.h"
|
|
|
|
HINSTANCE hinstRE32 = 0;
|
|
static const char szClassRE10A[] = RICHEDIT_CLASS10A;
|
|
|
|
class CTxtEdit;
|
|
|
|
extern "C"
|
|
{
|
|
|
|
__declspec(dllimport) LRESULT CALLBACK RichEdit10ANSIWndProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
BOOL WINAPI DllMain(HMODULE hmod, DWORD dwReason, LPVOID lpvReserved)
|
|
{
|
|
if(dwReason == DLL_PROCESS_DETACH)
|
|
{
|
|
UnregisterClassA(szClassRE10A, hinstRE32);
|
|
}
|
|
else if(dwReason == DLL_PROCESS_ATTACH) // We have just loaded
|
|
{
|
|
WNDCLASSA wca;
|
|
|
|
hinstRE32 = hmod;
|
|
|
|
wca.style = CS_DBLCLKS | CS_GLOBALCLASS | CS_PARENTDC;
|
|
wca.lpfnWndProc = RichEdit10ANSIWndProc;
|
|
wca.cbClsExtra = 0;
|
|
wca.cbWndExtra = sizeof(CTxtEdit FAR *);
|
|
wca.hInstance = hinstRE32;
|
|
wca.hIcon = 0;
|
|
wca.hCursor = 0;
|
|
wca.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
|
|
wca.lpszMenuName = NULL;
|
|
wca.lpszClassName = szClassRE10A;
|
|
|
|
//
|
|
// Register the RICHEDIT 10 class.
|
|
//
|
|
|
|
if( !RegisterClassA(&wca) )
|
|
{
|
|
return FALSE;
|
|
}
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
} // extern "C"
|