Jump to content

Recommended Posts

Posted

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.

Posted

It would not be desirable to do GUI but if it is impossible to use simple context menu likely it is necessary :)

Posted

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.

Posted

made this awhile ago.. :)

#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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...