Krol Posted August 30, 2007 Posted August 30, 2007 Can i create (simple, without GUI) context menu, which will be to appear at pressing hot key?
tAKTelapis Posted August 30, 2007 Posted August 30, 2007 So, press a hotkey, and a small menu pops up? Yup, but its gonna need a GUI. Just have the hotkey change the state of the GUI, from @SW_HIDE to @SW_SHOW. Or even have it draw and destroy the GUI.
Krol Posted August 30, 2007 Author Posted August 30, 2007 It would not be desirable to do GUI but if it is impossible to use simple context menu likely it is necessary
James Posted August 30, 2007 Posted August 30, 2007 Something like this should start you off. #include <GuiConstants.au3> HotKeySet("{F2}", "Context") $hwnd = GUICreate("", 400, 300) GUISetState() Do $Msg = GUIGetMsg() Until $Msg = $GUI_EVENT_CLOSE Func Context() Local $Pos = WinGetPos($hwnd) $C = GUICreate("", 60, 80, $Pos[2], $Pos[3]) GUISetState() While WinExists($C) $cMsg = GUIGetMsg() Switch $cMsg Case $GUI_EVENT_CLOSE GUIDelete($C) EndSwitch WEnd EndFunc You will need to change the Context GUI style. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Somerset Posted August 30, 2007 Posted August 30, 2007 made this awhile ago.. expandcollapse popup#include <GUIConstants.au3> Global $title="Customizedcontextmenu" HotKeySet("{End}", "Terminate") HotKeySet("{f1}", "RClickie") GUICreate($title, 1, 1,1,1,$WS_POPUP) $contextmenu = GUICtrlCreateContextMenu () $newsubmenu = GUICtrlCreateMenu ("new", $contextmenu) $textitem = GUICtrlCreateMenuitem ("text", $newsubmenu) $fileitem = GUICtrlCreateMenuitem ("Open", $contextmenu) $saveitem = GUICtrlCreateMenuitem ("Save", $contextmenu) GUICtrlCreateMenuitem ("", $contextmenu) ; separator $notepad = GUICtrlCreateMenuitem ("Notepad", $contextmenu) GUISetState () WinSetState ($title, "",@SW_HIDE) While 1 $msg = GUIGetMsg() if $msg = $notepad then Run ( "notepad.exe") Sleep(10) WEnd Func Terminate() Exit 0 EndFunc Func RClickie() $pos = MouseGetPos() WinMove ($title, "", $pos[0], $pos[1]) ControlClick ($title,"","","right") WinSetState ($title, "",@SW_hide) EndFunc
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