Print Page | Close Window

Trouble with hooks

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6482
Printed Date: 16 September 2024 at 3:58pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Trouble with hooks
Posted By: ahora
Subject: Trouble with hooks
Date Posted: 22 February 2007 at 3:11am
Hi,

When I active the capture of windows hooks with SetWindowsHookEx(WH_KEYBOARD, AddressOf KeyboardHook, 0, aAppThreadID) and I cath them, the key shortcuts of the CommandBar or any key, that I have configured, don't work ok, like for example a ALT+S of a "save button".

The CommandBars don't capture any key like "return" or cursor keys when it have the focus.

Regards.

P.D.: Sorry my bad english



Replies:
Posted By: ahora
Date Posted: 05 March 2007 at 7:30am
Hi,

Anybody knows the solution???!!?

Regars.


Posted By: Fabian
Date Posted: 05 March 2007 at 11:20am
Hello ahora
 
this works for me in VB6:
 
hHook=SetWindowHooksEx(WH_KEYBOARD, AddressOf KbHook, App.hInstance, App.ThreadID)
 
In Function KbHook(Code, Param1, Param2):
 
  KBHook=CallNextHookEx(hHook,Code,Param1,ByVal Param2)
  Your code
 
I hope this helps
Fabian


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: ahora
Date Posted: 06 March 2007 at 10:26am
uploads/20070306_102355_TestHooks.zip - uploads/20070306_102355_TestHooks.zip

Here is an example to view the error when you turn on the hooks.

Regards.


Posted By: Fabian
Date Posted: 06 March 2007 at 11:31am
Try ByVal on Param2 calling CallNextHookEx(hHook,Code,Param1,ByVal Param2)

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: Oleg
Date Posted: 07 March 2007 at 5:12am
Hi,
You call CallNextHookEx 2 times. and use wrong "lParamComa" instead "lParam" etc. 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ahora
Date Posted: 12 March 2007 at 9:48am
Oh oh oh yeeees

Thank you!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net