|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Some hotkeys register but....Hello,
How to explain that: Using CTRL key combination with another key sometimes such combination registers without an error but it does not work. For example: CTRL + all function keys. It registers with Windows but it does not work. Jack On Thu, 12 May 2005 00:21:56 -0400, "Jack" <replyto@newsgroup> wrote: AFIK there's nothing special about Ctrl+Fcn keys. They work fine here> How to explain that: >Using CTRL key combination with another key sometimes such combination >registers without an error but it does not work. >For example: >CTRL + all function keys. >It registers with Windows but it does not work. >Jack with the RegisterHotKey Api function and subclassing for WM_HOTKEY, or with the WM_SETHOTKEY method. Maybe post the code you're using to set it. -Tom MVP - Visual Basic (please post replies to the newsgroup) It does not work on 2 different computers.
The following key combination does not work: CTRL + Function Keys F1 -F12 Code: Declare Function RegisterHotKey Lib "user32.dll" (ByVal hwnd As Long, ByVal Id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long rtn = RegisterHotKey(Me.hwnd, Id, MOD_CONTROL, Vkey) for VKey I use Vkey = vbKeyF1 ---> to vbKeyF12 API returns rtn > 0 so registration is successful. However WM_HOTKEY message is never fired. Just to make sure: Only CTRL+ Function key combination does not work. Using the same code with another CTRL + key combination works fine. Your thoughts please. Jack Show quote "Tom Esh" <tjeshGibber***@suscom.net> wrote in message news:gcv581t2pij4j2sqmfagam6dfghoeeifd9@4ax.com... > On Thu, 12 May 2005 00:21:56 -0400, "Jack" <replyto@newsgroup> wrote: > >> How to explain that: >>Using CTRL key combination with another key sometimes such combination >>registers without an error but it does not work. >>For example: >>CTRL + all function keys. >>It registers with Windows but it does not work. >>Jack > > AFIK there's nothing special about Ctrl+Fcn keys. They work fine here > with the RegisterHotKey Api function and subclassing for WM_HOTKEY, or > with the WM_SETHOTKEY method. Maybe post the code you're using to set > it. > > > -Tom > MVP - Visual Basic > (please post replies to the newsgroup)
Show quote
On Thu, 12 May 2005 23:07:41 -0400, "Jack" <replyto@newsgroup> wrote: Hmmm... strange. Only a couple things come to mind:>It does not work on 2 different computers. >The following key combination does not work: >CTRL + Function Keys F1 -F12 >Code: >Declare Function RegisterHotKey Lib "user32.dll" (ByVal hwnd As Long, ByVal >Id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long > >rtn = RegisterHotKey(Me.hwnd, Id, MOD_CONTROL, Vkey) > >for VKey I use Vkey = vbKeyF1 ---> to vbKeyF12 > >API returns rtn > 0 so registration is successful. >However WM_HOTKEY message is never fired. > >Just to make sure: >Only CTRL+ Function key combination does not work. >Using the same code with another CTRL + key combination works fine. > >Your thoughts please. 1) The Id value. It should be between 0 and &HBFFF, and if your app is registering multiple hotkeys it should be different for each. 2) Test the compiled exe with nothing else running, especially VS or the IDE. They like to hijack F keys. 3) Presumably your MOD_CONTROL declare is correct since it works with other Ctrl+ combinations, but just in case: Const MOD_CONTROL = &H2 -Tom MVP - Visual Basic (please post replies to the newsgroup) |
|||||||||||||||||||||||