Include "HjGlobal.jsh" ; default HJ global variables
Include "hjconst.jsh" ; default HJ constants

Script CreateMenu ()
var
string MyMenu, ; variable to hold menu text.
string MenuTitle, ; variable to hold menu title.
int index ; integer variable to hold menu numbers.

let MenuTitle="Main Menu" ; assign name .
let MyMenu="|Cleanup Manager"+
"|Control Panel"+
"|MSConfig"+
"|Volume Control XP"+
"|Volume Control Vista / Windows 7"

let index=DlgSelectItemInList(MyMenu,MenuTitle,FALSE)
IsSelectItemDlg() ; function to ensure focus is correct 
If(index==1) Then
CleanupManager ()
ElIf(index==2) Then
ControlPanel ()
ElIf(index==3) Then
MSConfig ()
ElIf(index==4) Then
VolumeControlXP ()
ElIf(index==5) Then
VolumeControl7 ()
Else
Say("Menu cancelled.",ot_message)
EndIf
EndScript

Function CleanupManager ()
Run ("cleanmgr.exe")	
EndFunction

Function MSConfig ()
Run ("msconfig.exe")
EndFunction

Function ControlPanel ()
Run ("control")
EndFunction

Function VolumeControlXP ()
Run ("sndvol32")
EndFunction

Function VolumeControl7 ()
Run ("sndvol")
EndFunction