什么情况下GetModuleHandle才能得到应用程序的模块句柄?
我在调用GetModuleHandle("XXX.exe")时总是返回NULL啊!

解决方案 »

  1.   

    GetModuleHandle("XXX.exe")?,如果指定模块名,应该指定完整路径。
      

  2.   

    核心编程 在挂接API一章有一段代码是
    ......
    PROC pfnOrig = GetProcAddress(GetModuleHandle("kernel32"),"ExitProcess");
    HMODULE hmode = GetModuleHandle("DataBase.exe");void ReplaceIATEntryInOneMod(............)
    ......其中hmod总是返回NULL
      

  3.   

    Return Values
    If the function succeeds, the return value is a handle to the specified module.If the function fails, the return value is NULL. To get extended error information, call GetLastError.