Jump to content
Sign in to follow this  

floating context menu

Recommended Posts

Hi, this is a first post...

I designined a little app using power pro

And I am trying to use autoit to develop a downloadable .exe of the same functionality.

But Autoit does things in a different style, for example getting you to put everything on a gui....

How can I get my own "Context" Menu to appear at the cursor when I hold the right mouse button down, system wide?

button down

menu appears at cursor possition

make selection

menu goes away

..no OK button, no clunky border, no title, no minimize......

can I use Autoit for this?

Share this post

Link to post
Share on other sites

#include <GUIConstants.au3>

;right click on gui to bring up context Menu.
;right click on the "ok" button to bring up a controll specific context menu.

GuiCreate("My GUI Context Menu",300,200,-1,-1,BitOR($WS_POPUP,$WS_BORDER),BitOr($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
;~ GUICreate("My GUI Context Menu", 300, 200)

$contextmenu    = GUICtrlCreateContextMenu ()
$button         = GUICtrlCreateButton("OK", 100, 100, 70, 20)
$buttoncontext  = GUICtrlCreateContextMenu($button)
$buttonitem     = GUICtrlCreateMenuitem("About button", $buttoncontext)
$newsubmenu     = GUICtrlCreateMenu ("new", $contextmenu)
$textitem       = GUICtrlCreateMenuitem ("text", $newsubmenu)
$fileitem       = GUICtrlCreateMenuitem ("Open", $contextmenu)
$saveitem       = GUICtrlCreateMenuitem ("Save", $contextmenu)
GUICtrlCreateMenuitem ("", $contextmenu)    ; separator
$infoitem       = GUICtrlCreateMenuitem ("Info", $contextmenu)
GUISetState ()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Share this post

Link to post
Share on other sites

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
Sign in to follow this  

  • Create New...