Leaked source code of windows server 2003
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

  1. #include "wrapper.h"
  2. HINSTANCE hinstRE32 = 0;
  3. static const char szClassRE10A[] = RICHEDIT_CLASS10A;
  4. class CTxtEdit;
  5. extern "C"
  6. {
  7. __declspec(dllimport) LRESULT CALLBACK RichEdit10ANSIWndProc(HWND, UINT, WPARAM, LPARAM);
  8. BOOL WINAPI DllMain(HMODULE hmod, DWORD dwReason, LPVOID lpvReserved)
  9. {
  10. if(dwReason == DLL_PROCESS_DETACH)
  11. {
  12. UnregisterClassA(szClassRE10A, hinstRE32);
  13. }
  14. else if(dwReason == DLL_PROCESS_ATTACH) // We have just loaded
  15. {
  16. WNDCLASSA wca;
  17. hinstRE32 = hmod;
  18. wca.style = CS_DBLCLKS | CS_GLOBALCLASS | CS_PARENTDC;
  19. wca.lpfnWndProc = RichEdit10ANSIWndProc;
  20. wca.cbClsExtra = 0;
  21. wca.cbWndExtra = sizeof(CTxtEdit FAR *);
  22. wca.hInstance = hinstRE32;
  23. wca.hIcon = 0;
  24. wca.hCursor = 0;
  25. wca.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
  26. wca.lpszMenuName = NULL;
  27. wca.lpszClassName = szClassRE10A;
  28. //
  29. // Register the RICHEDIT 10 class.
  30. //
  31. if( !RegisterClassA(&wca) )
  32. {
  33. return FALSE;
  34. }
  35. }
  36. return TRUE;
  37. }
  38. } // extern "C"