I like to know if its possible to use win32 keyboard hook function (SetWindowsHookEx , SetWindowsHookEx ) in a Qt application.
If possible pls provide a sample code on using SetWindowsHookEx , SetWindowsHookEx functions in Qt.
//Update as of 18 Feb 2010 //
I havent figured out how to do that in QT yet.
But as a workaround I have created a win32 dll using vc++ express edition and placed my hook commands inside the dll functions. And I call that dll functions from Qt using QLibrary class
/* hearder file code*/ QLibrary *myLib; typedef HHOOK (*MyPrototype)(HINSTANCE);
/* source file code */ myLib = new QLibrary( "ekhook.dll" ); MyPrototype myFunction; myFunction = (MyPrototype) myLib->resolve( "Init" );
init() is the function in ekhook.dll thats being called