jonny1234 Posted December 22, 2006 Share Posted December 22, 2006 Hi, Please could you tell me how to disable the context menu key (APPSKEY). I have tried setting it as a hotkey using: HotKeySet("{APPSKEY}", "KeyPressedApps") The KeyPressedApps function detects the apps key down event, but the context menu is still displayed when the apps key is released. Is there a way to intercept this? Thanks for your help. Regards, Jonny Link to comment Share on other sites More sharing options...
Sunaj Posted December 23, 2006 Share Posted December 23, 2006 Hi, you cannot set hotkeys to the winkey - please refer to the help file before asking! Cheers, Sunaj Btw; you could have a look at a derivative of AutoIt; http://www.autohotkey.com/docs/Hotkeys.htm - but this should not be discussed any further on this forum since it pertains to different software product than AutoIt. Hi, Please could you tell me how to disable the context menu key (APPSKEY). I have tried setting it as a hotkey using: HotKeySet("{APPSKEY}", "KeyPressedApps") The KeyPressedApps function detects the apps key down event, but the context menu is still displayed when the apps key is released. Is there a way to intercept this? Thanks for your help. Regards, Jonny [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
jonny1234 Posted December 23, 2006 Author Share Posted December 23, 2006 Hi, you cannot set hotkeys to the winkey - please refer to the help file before asking!Thanks for the interesting aside and advice. I'll keep them both in mind. Now back to the question of disabling the APPSKEY (which is not the Win key). Please refer to the first post before answering.Regards,Jonny Link to comment Share on other sites More sharing options...
Sunaj Posted December 25, 2006 Share Posted December 25, 2006 Heheh, sorry for that one - my bad, I looked through the helpfile too quickly myself - Anyway, think I may have an idea for you: it seems that Shift + F10 controls the same feature as the APPSKEY.. and you can definately set a hotkey on Shift + F10 that intercepts the context menu which would otherwise have been called forth:HotKeySet("+{F10}", "KeyPressedApps")That's about all I can offer on this one as I don't have a APPSKEY on my laptop.Thanks for the interesting aside and advice. I'll keep them both in mind. Now back to the question of disabling the APPSKEY (which is not the Win key). Please refer to the first post before answering. [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
jonny1234 Posted December 25, 2006 Author Share Posted December 25, 2006 Heheh, sorry for that one - my bad, I looked through the helpfile too quickly myself - Anyway, think I may have an idea for you: it seems that Shift + F10 controls the same feature as the APPSKEY.. and you can definately set a hotkey on Shift + F10 that intercepts the context menu which would otherwise have been called forth:HotKeySet("+{F10}", "KeyPressedApps")That's about all I can offer on this one as I don't have a APPSKEY on my laptop.Thanks for trying to help Sunaj. Your solution does prevent the context menu from being displayed when Shift+F10 is pressed. But when I change "+{F10}" to "{APPSKEY}" and press the APPSKEY, the context menu still appears.I don't see a solution to this other than updating the help file to say that the APPSKEY press will always be forwarded to the active application.Unless anyone else has any ideas?Regards,Jonny Link to comment Share on other sites More sharing options...
martin Posted December 30, 2006 Share Posted December 30, 2006 Thanks for trying to help Sunaj. Your solution does prevent the context menu from being displayed when Shift+F10 is pressed. But when I change "+{F10}" to "{APPSKEY}" and press the APPSKEY, the context menu still appears.I don't see a solution to this other than updating the help file to say that the APPSKEY press will always be forwarded to the active application.Unless anyone else has any ideas?Regards,JonnyJust to make this clear to me, do you mean that setting a hotkey for "+{F10}" stops Shift+F10, but doesn't stop the APPSKEY? I would be interested to know because I don't have an APPSKEY and I believed it was identical to pressing shift+F10. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Holger Posted December 30, 2006 Share Posted December 30, 2006 (edited) Small hack : ; ; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/menus/menureference/menumessages/wm_contextmenu.asp ; ; "...DefWindowProc generates the WM_CONTEXTMENU message when it processes the WM_RBUTTONUP or WM_NCRBUTTONUP message ; or when the user types SHIFT+F10. ; The WM_CONTEXTMENU message is also generated when the user presses and releases the VK_APPS key. ; If the context menu is generated from the keyboard - for example, if the user types SHIFT+F10 - ; then the x- and y-coordinates are -1" ; #include <GUIConstants.au3> Global Const $WM_CONTEXTMENU = 0x007B GUIRegisterMsg($WM_CONTEXTMENU, "WndProc") $hGUI = GUICreate("Test") $context = GUICtrlCreateContextMenu(-1) $item1 = GUICtrlCreateMenuItem("Item1", $context) $item2 = GUICtrlCreateMenuItem("Item2", $context) GUISetState() Do $Msg = GUIGetMsg() Until $Msg = $GUI_EVENT_CLOSE Exit Func WndProc($hWnd, $Msg, $wParam, $lParam) If $Msg = $WM_CONTEXTMENU And $lParam = -1 Then ConsoleWrite("Appskey was pressed" & @LF) Return 0 EndIf EndFunc Greets Holger Edited December 30, 2006 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
jonny1234 Posted December 31, 2006 Author Share Posted December 31, 2006 (edited) Just to make this clear to me, do you mean that setting a hotkey for "+{F10}" stops Shift+F10, but doesn't stop the APPSKEY?Yes, that's what I mean.Regards,Jonny Edited December 31, 2006 by jonny1234 Link to comment Share on other sites More sharing options...
jonny1234 Posted December 31, 2006 Author Share Posted December 31, 2006 Thanks for your reply, Holger. I have modified your code by adding an input control. You will see that it is possible to use the right mouse button and the apps key on the input control. I don't want the context menu to be displayed at all for the input control (or for any other control on my form), either by using the mouse or by using the apps key. #include <GUIConstants.au3> Global Const $WM_CONTEXTMENU = 0x007B GUIRegisterMsg($WM_CONTEXTMENU, "WndProc") $hGUI = GUICreate("Test") $context = GUICtrlCreateContextMenu(-1) $item1 = GUICtrlCreateMenuItem("Item1", $context) $item2 = GUICtrlCreateMenuItem("Item2", $context) $inpTest = GUICtrlCreateInput("", 50, 50, 300, 20) GUICtrlSetData($inpTest, "You can right-click or press APPS key here") GUISetState() Do $Msg = GUIGetMsg() Until $Msg = $GUI_EVENT_CLOSE Exit Func WndProc($hWnd, $Msg, $wParam, $lParam) If $Msg = $WM_CONTEXTMENU And $lParam = -1 Then ConsoleWrite("Appskey was pressed" & @LF) Return 0 EndIf EndFunc Regards, Jonny Link to comment Share on other sites More sharing options...
Holger Posted January 2, 2007 Share Posted January 2, 2007 (edited) There is no solution at the moment I think cause you cannot 'subclass' a control - you cannot receive the _window_ - messages from the control window itself (like i.e. WM_Contextmenu). Edited January 2, 2007 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now