Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem making Hook keyboard

Status
Not open for further replies.

McRight2k

Programmer
Mar 17, 2003
3
0
0
ES
Hi, first, my english isn't good, sorry. I'm spanish.

I have developing an Access application, and I found a code for create a hook of the keyboard for look the Alt+Tab, Alt+Esc and Ctrl+Esc keys in WinNT/2000/XP. It call to a SetWindowsHookEx API function.
This works OK in Visual Basic 6, but in Access XP not works. The "App.hInstance" isn't good for Access. I try replace "App.hInstance" with "Screen.Application.hWnd"
and with "Application.hWndAccessApp", but not work, mHook always return 0, while in VB6, mHook return any long value and look the keys.

Here, the code for Hook the Keyword for VB6:

Dim mHook as Long
mHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LLKeyBoardProc, App.hInstance, 0&)

Please any alternative for Access with "App.hInstance" in VB????

Thanks
 
Hi McRight2k,

I have a similar requirement. Have you had any luck with SetWindowsHookEx?

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top