문제

I'm using SetWindowHookEx to load a DLL into another process, but I need to be able to hook into both 32 and 64 bit processes. I guess I need two separate DLLs for that, but can I do it without creating two versions of the "launcher" app? I need to pass a DLL handle to SetWindowsHookEx, but I can't use LoadLibrary to get it.

도움이 되었습니까?

해결책

Use an out of process COM+ object to host the DLL. You can call 64 bit code from 32 bit using this method, so that way most of the launcher code stays the same except for an if statement where you decide to load either a 32 or 64 bit COM+ object. The object can be coded to load the appropriate version of the DLL into the process, one for 64 bit processes and one for 32 bit.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top