CustomCaption.cpp
上传用户:zhoushen
上传日期:2022-06-15
资源大小:84k
文件大小:2k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // CustomCaption.cpp : Defines the initialization routines for the DLL.
  2. //
  3. //
  4. #include "stdafx.h"
  5. #include <afxdllx.h>
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. static AFX_EXTENSION_MODULE CustomCaptionDLL = { NULL, NULL };
  12. extern "C" int APIENTRY
  13. DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  14. {
  15. // Remove this if you use lpReserved
  16. UNREFERENCED_PARAMETER(lpReserved);
  17. if (dwReason == DLL_PROCESS_ATTACH)
  18. {
  19. TRACE0("CUSTOMCAPTION.DLL Initializing!n");
  20. // Extension DLL one-time initialization
  21. if (!AfxInitExtensionModule(CustomCaptionDLL, hInstance))
  22. return 0;
  23. // Insert this DLL into the resource chain
  24. // NOTE: If this Extension DLL is being implicitly linked to by
  25. //  an MFC Regular DLL (such as an ActiveX Control)
  26. //  instead of an MFC application, then you will want to
  27. //  remove this line from DllMain and put it in a separate
  28. //  function exported from this Extension DLL.  The Regular DLL
  29. //  that uses this Extension DLL should then explicitly call that
  30. //  function to initialize this Extension DLL.  Otherwise,
  31. //  the CDynLinkLibrary object will not be attached to the
  32. //  Regular DLL's resource chain, and serious problems will
  33. //  result.
  34. new CDynLinkLibrary(CustomCaptionDLL);
  35. }
  36. else if (dwReason == DLL_PROCESS_DETACH)
  37. {
  38. TRACE0("CUSTOMCAPTION.DLL Terminating!n");
  39. // Terminate the library before destructors are called
  40. AfxTermExtensionModule(CustomCaptionDLL);
  41. }
  42. return 1;   // ok
  43. }