home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 February / PCWorld_2006-02_cd.bin / software / vyzkuste / triky / triky.exe / autoit-v3-setup.exe / Examples / GUICtrlCreateContextMenu.au3 < prev    next >
Text File  |  2004-12-04  |  783b  |  29 lines

  1. #include <GUIConstants.au3>
  2.  
  3. GUICreate("My GUI Context Menu",300,200)
  4.  
  5. $contextmenu = GUICtrlCreateContextMenu ()
  6.  
  7. $button = GUICtrlCreateButton("OK",100,100,70,20)
  8. $buttoncontext = GUICtrlCreateContextMenu($button)
  9. $buttonitem = GUICtrlCreateMenuitem("About button",$buttoncontext)
  10.  
  11. $newsubmenu  = GUICtrlCreateMenu ("new", $contextmenu)
  12. $textitem    = GUICtrlCreateMenuitem ("text",$newsubmenu)
  13.  
  14. $fileitem = GUICtrlCreateMenuitem ("Open",$contextmenu)
  15. $saveitem = GUICtrlCreateMenuitem ("Save",$contextmenu)
  16. GUICtrlCreateMenuitem ("",$contextmenu)    ; separator
  17.  
  18. $infoitem = GUICtrlCreateMenuitem ("Info",$contextmenu)
  19.  
  20. GUISetState ()
  21.  
  22. ; Run the GUI until the dialog is closed
  23. While 1
  24.     $msg = GUIGetMsg()
  25.     
  26.     If $msg = $GUI_EVENT_CLOSE Then ExitLoop
  27. Wend
  28.  
  29.