Ambient Posted February 3, 2009 Share Posted February 3, 2009 I have been trying to create a context menu on the fly so that I can have users change skins I an reading from an ini file at the moment but have a version that reads in from a folder. problem is I can get the menu created but can't capture when its clicked . I think I need a way of incrementing the variable $newsubmenu although i don't think that thisis possible. Dim $EXIT Opt("TrayMenuMode", 1) ; stops script from being paused GUICreate("My GUI Context Menu",300,200) #include "GUIConstants.au3" #include <Process.au3> opt("GUIOnEventMode",1); HotKeySet("{PAUSE}","TESTER") $contextmenu = GUICtrlCreateContextMenu () ToolTip("Loading Skins....",@desktopheight /3,0); An often unused part of the screen Sleep(1000) $folder=@Scriptdir ; Do file openfile $count=0 for $i=1 to 24 $skinname= IniRead($folder &"\skins.ini","available",$i,"Carbon") $count=$count+1 $newsubmenu = GUICtrlCreateMenu ($skinname, $contextmenu) ;msgbox(1,$newsubmenu,$contextmenu) if mod($count,5)=0 then GUICtrlCreateMenuitem ("",$contextmenu) ; separator endif next ToolTip("") GUISetState () While 1 $msg = GUIGetMsg() ;~ If $msg = $newsubmenu Then ;~ msgbox(0,$msg,$msg) ;~ msgbox(0,$newsubmenu,$newsubmenu) ;~ endif If $msg = $GUI_EVENT_CLOSE Then ExitLoop ;If $msg = $EXIT Then Exit Wend FUNC TESTER() ToolTip($newsubmenu) EndFunc Link to comment Share on other sites More sharing options...
BrettF Posted February 3, 2009 Share Posted February 3, 2009 Maybe try using an array? Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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