Jim Hubbard said:
Thanks for the confirmation.
BTW, it seems to me that Windows can never be fully .NEt....that some
unmanaged code will always be required to do things that managed code just
can't.
To an extent, thats true, however the number of things that are actually
only possible in unmanaged code are *extremely* small. Many things, like
hooks, etc, require pinvoke simply because windows hasn't exposed managed
interfaces to the functionality. It will be a while.
Most of what can't be done with managed code is stuff that any normal user
will never do. I don't think I will be writing a driver for anything in the
near future, nor do I need kernel mode access to anything(and though it may
be possible for .NET to operate at kernel mode, I wouldn't be surprised if
it never does). As it is I never write down to that level in C++, so why
should I be upset if C# doesn't let me?
And more to the point of your question, system hooks are pretty limited from
a managed language like C#. You can implement a certain subset, but I think
all you can do *globally* is keyboard and mouse hooks. Everything else
requires a dll that can be loaded by the OS seperatly, so you have to be
able to write atleast those entry points in unmanaged code. You can probably
do it with mixed C++, but I do not think it is possible from C# or VB.NET.