Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Trouble with hooks
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Trouble with hooks

 Post Reply Post Reply
Author
Message
ahora View Drop Down
Groupie
Groupie
Avatar

Joined: 17 March 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote ahora Quote  Post ReplyReply Direct Link To This Post Topic: Trouble with hooks
    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
Back to Top
ahora View Drop Down
Groupie
Groupie
Avatar

Joined: 17 March 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote ahora Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2007 at 7:30am
Hi,

Anybody knows the solution???!!?

Regars.
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ahora View Drop Down
Groupie
Groupie
Avatar

Joined: 17 March 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote ahora Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2007 at 10:26am
uploads/20070306_102355_TestHooks.zip

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

Regards.
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ahora View Drop Down
Groupie
Groupie
Avatar

Joined: 17 March 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote ahora Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2007 at 9:48am
Oh oh oh yeeees

Thank you!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.