Fruitbox

Oct 8, 2007

System-wide hooks in the .NET Framework — can it be done?

Filed under: Technology, ENGLISH

Yes and no.
Recently I found the need to make a global mouse hook. This is no big deal down at the Win32 API level, where you would just write a dynamic library and then use the SetWindowsHookEx API function. But how to solve this in a managed environment, I thought to myself. The way Windows works doesn’t make this easy.
After searching around a bit I found this at Microsoft’s site:

Global hooks are not supported in the .NET Framework
Except for the WH_KEYBOARD_LL low-level hook and the WH_MOUSE_LL low-level hook, you cannot implement global hooks in the Microsoft .NET Framework. To install a global hook, a hook must have a native DLL export to inject itself in another process that requires a valid, consistent function to call into. This behavior requires a DLL export. The .NET Framework does not support DLL exports. Managed code has no concept of a consistent value for a function pointer because these function pointers are proxies that are built dynamically.

Low-level hook procedures are called on the thread that installed the hook. Low-level hooks do not require that the hook procedure be implemented in a DLL.

Makes sense, I thought. So how can we get this working?
After yet more searching I found this article:
Global System Hooks in .NET. It explains how to create an unmanaged C++ DLL and use it from C#!
An interesting possibility would indeed be to have a managed hook (I’ve seen many bad hooks througout the years).

Oct 7, 2007

ZoomText scripting!

A quick note on my previous quick note on news from the AT world.
The same day I wrote that post I stumbled upon a blog called — what a coincidence — ZoomText Scripting!
Apparently, AI Squared is working on adding scripting capability to ZoomText. This is precisely the one thing I hoped they would get into implementing.
Check out the website at: http://zoomtextscripting.com/

Oct 5, 2007

News from the AT world

Just a quick post to share what I consider the most important news in the AT world. As you know by now this has to do with magnifiers and screen readers.
So first off — ZoomText — what has happened? Not much, really. I am disappointed.
Off we go to JAWS then. JAWS 9 public beta is out, and the most significant change for me in this release is the support for the standard GMail interface, yay!
Next up we have Issist, the creators of iZoom, who now has released “the world’s first web-based screen magnifier”, which is pretty neat!
NVDA is progressing steadily. I should get to updating the Swedish translation (which I haven’t done since the 0.5 release).
When it comes to Linux, Orca is still going strong on the screen reader side, while we have a new program on the magnifiers’ side, namely the zoom plug-in for compiz-fusion. I haven’t tested this yet, but it’s supposed to be the greatest so far.






















Fruitbox One Million Blogs . org Blog Directory & Search engine
Chat with me by Live Messenger:

Daniel Innala Ahlmark

Get free blog up and running in minutes with Blogsome
Theme designed by Riosoft