Jump to content

Help with context menu variable incrementing


Ambient
 Share

Recommended Posts

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...