> In experts exchange, as well as a few other sites, people mentioned that
> with that hook, you didn't have to have your code in a separate DLL.
Hmm. To hook a process other than the one in which the SetWindowsHookEx()
call is made. Sounds hokey to me.
> So, the main code to be managed, and I guess the DLL code needs to be
> unmanaged?? What type of a project is the DLL?
The DLL would be native. If you are using VS.Net 2003 you first select C++
projects and then click on the Win32 icon. Then click Application Settings
and choose the DLL option. A
> Is there no code that is designed for VC++ .NET?
As far as I know, no. Realize that I don't claim to be a .Net expert.
Regards,
Will
Stephen Corey - 28 Jun 2005 19:40 GMT
>>In experts exchange, as well as a few other sites, people mentioned that
>>with that hook, you didn't have to have your code in a separate DLL.
[quoted text clipped - 15 lines]
> Regards,
> Will
Ok, well with the callback code in a separate DLL, how will I get the
"ENTER count" back into my managed code?
William DePalo [MVP VC++] - 28 Jun 2005 20:24 GMT
> Ok, well with the callback code in a separate DLL, how will I get the
> "ENTER count" back into my managed code?
You adopt some interprocess communication mechanism between the DLL (which
runs in the applications being hooked) and your application which planted
the hook (presumably via some form of interop). The sample to which I
pointed posts a WM_COMMAND message. You code do that.
Of course, that begs the question as to how you retrieve the message on the
managed side. It's not something that I've done so I can't offer any advice.
IMO, what you are trying to do is best done natively, anyway.
Regards,
Will