dllmain.cpp 564 B

12345678910111213141516171819202122232425262728293031323334
  1. // dllmain.cpp : 定义 DLL 应用程序的入口点。
  2. #include "stdafx.h"
  3. #include "Hook.h"
  4. HINSTANCE g_Inst = NULL; //DLL模块句柄
  5. BOOL APIENTRY DllMain(HMODULE hModule,
  6. DWORD ul_reason_for_call,
  7. LPVOID lpReserved
  8. )
  9. {
  10. g_Inst = (HINSTANCE)hModule;
  11. switch(ul_reason_for_call)
  12. {
  13. case DLL_PROCESS_ATTACH:
  14. {
  15. //Hook();
  16. break;
  17. }
  18. case DLL_THREAD_ATTACH:
  19. case DLL_THREAD_DETACH:
  20. case DLL_PROCESS_DETACH:
  21. {
  22. //UnHook();
  23. break;
  24. }
  25. }
  26. return TRUE;
  27. }