Hi all,
Am trying to build a small C# app that will allow me to hook on other processes so I can peek on any controls' properties of an open window via reflection (obviously, targeted processes must be managed apps only).
I have build almost everything I need -- managed process filters & managed wrappers for memory mapped files. Just one left: the component that will install a global hook so I can insert my spy DLL to that other process's memory space. I'm planning to use SetWindowsEx but there is a limitation.
If dwThreadId belongs to another process, hMod must be a handle of a *native* DLL that will be inserted into the memory space of dwThreadId. (But, I'm trying to keep everything 100% managed).
I'm aware I can use C++ to build an unsafe DLL to handle the global hooks for me, but I'm hoping to use pure C# for maintenance reasons.
I'd appreciate any help or tips on how I can achieve a pure C# solution, if possible.
TIA![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)
Am trying to build a small C# app that will allow me to hook on other processes so I can peek on any controls' properties of an open window via reflection (obviously, targeted processes must be managed apps only).
I have build almost everything I need -- managed process filters & managed wrappers for memory mapped files. Just one left: the component that will install a global hook so I can insert my spy DLL to that other process's memory space. I'm planning to use SetWindowsEx but there is a limitation.
Code:
HHOOK SetWindowsHookEx(
int idHook,
HOOKPROC lpfn,
HINSTANCE hMod,
DWORD dwThreadId
);
I'm aware I can use C++ to build an unsafe DLL to handle the global hooks for me, but I'm hoping to use pure C# for maintenance reasons.
I'd appreciate any help or tips on how I can achieve a pure C# solution, if possible.
TIA
![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)