kaotkbliss Posted August 9, 2010 Share Posted August 9, 2010 (edited) I'm not sure what's going on here (probably poor coding?) But I have been working on a program on an xp machine. Once I had it mostly working, I took it home to my Windows 7 64bit machine for further testing. However, it won't launch any programs. I tried runas as well as requireadmin but still no effect. *edit* updated code: expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <Array.au3> #include <File.au3> #include <staticconstants.au3> AutoItSetOption("trayicondebug", 1) Dim $prog[10] Dim $progb[10] Dim $progc[10] Global $add1, $add2, $add3, $fileitem1, $fileitem2, $main, $remove1, $remove2, $remove3, $y, $x, $w Global $aup, $aup1, $adown, $adown1, $bup, $bup1, $bdown, $bdown1, $cup, $cup1, $cdown, $cdown1 $a = 1 $b = 1 $c = 1 $ini = FileExists(@WorkingDir & "\pldata.ini") If $ini = 0 Then firstrun() EndIf $tab1 = IniRead(@WorkingDir & "\pldata.ini", "Tab", 1, "Tab1") $tab2 = IniRead(@WorkingDir & "\pldata.ini", "Tab", 2, "Tab2") $tab3 = IniRead(@WorkingDir & "\pldata.ini", "Tab", 3, "Tab3") gui() Func gui() $posx = IniRead(@WorkingDir & "\pldata.ini", "pos", 1, -1) $posy = IniRead(@WorkingDir & "\pldata.ini", "pos", 2, -1) $y = 25 $w = 1 $main = GUICreate("Program Launcher", 350, 446, $posx, $posy) $filemenu = GUICtrlCreateMenu("Options") $fileitem1 = GUICtrlCreateMenuItem("Add Tab", $filemenu) $fileitem2 = GUICtrlCreateMenuItem("Remove Tab", $filemenu) GUICtrlCreateTab(2, 2, 346, 426) $win = GUICtrlCreateTabItem($tab1) createtaba() $y = 25 $w = 1 $add1 = GUICtrlCreateButton("Add Program", 95, 400, 73, 25) $remove1 = GUICtrlCreateButton("Remove Program", 180, 400, 90, 25) GUICtrlCreateLabel("", 324, 64, 22, 295, $SS_BLACKFRAME) $aup = GUICtrlCreateButton("/\" & @CR & "/\", 323, 26, 22, 25, BitOR($BS_MULTILINE, $BS_CENTER)) $aup1 = GUICtrlCreateButton("/\", 323, 50, 22, 22, BitOR($BS_MULTILINE, $BS_CENTER)) $adown = GUICtrlCreateButton("\/" & @CR & "\/", 323, 373, 22, 25, BitOR($BS_MULTILINE, $BS_VCENTER)) $adown1 = GUICtrlCreateButton("\/", 323, 352, 22, 22, $BS_VCENTER) $win2 = GUICtrlCreateTabItem($tab2) createtabb() $y = 25 $w = 1 $add2 = GUICtrlCreateButton("Add Program", 95, 400, 73, 25) $remove2 = GUICtrlCreateButton("Remove Program", 180, 400, 90, 25) GUICtrlCreateLabel("", 324, 64, 22, 295, $SS_BLACKFRAME) $bup = GUICtrlCreateButton("/\" & @CR & "/\", 323, 26, 22, 25, BitOR($BS_MULTILINE, $BS_CENTER)) $bup1 = GUICtrlCreateButton("/\", 323, 50, 22, 22, BitOR($BS_MULTILINE, $BS_CENTER)) $bdown = GUICtrlCreateButton("\/" & @CR & "\/", 323, 373, 22, 25, BitOR($BS_MULTILINE, $BS_VCENTER)) $bdown1 = GUICtrlCreateButton("\/", 323, 352, 22, 22, $BS_VCENTER) $win3 = GUICtrlCreateTabItem($tab3) createtabc() $y = 25 $w = 1 $add3 = GUICtrlCreateButton("Add Program", 95, 400, 73, 25) $remove3 = GUICtrlCreateButton("Remove Program", 180, 400, 90, 25) GUICtrlCreateLabel("", 324, 64, 22, 295, $SS_BLACKFRAME) $cup = GUICtrlCreateButton("/\" & @CR & "/\", 323, 26, 22, 25, BitOR($BS_MULTILINE, $BS_CENTER)) $cup1 = GUICtrlCreateButton("/\", 323, 50, 22, 22, BitOR($BS_MULTILINE, $BS_CENTER)) $cdown = GUICtrlCreateButton("\/" & @CR & "\/", 323, 373, 22, 25, BitOR($BS_MULTILINE, $BS_VCENTER)) $cdown1 = GUICtrlCreateButton("\/", 323, 352, 22, 22, $BS_VCENTER) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) EndFunc ;==>gui While 1 $msg = GUIGetMsg() If $msg = $add1 Then createpath1() ElseIf $msg = $add2 Then createpath2() ElseIf $msg = $add3 Then createpath3() ElseIf $msg = $fileitem1 Then addtab() ElseIf $msg = $fileitem2 Then deltab() ElseIf $msg = $remove1 Then removea() ElseIf $msg = $remove2 Then removeb() ElseIf $msg = $remove3 Then removec() ElseIf $msg = $adown Then Dim $taba _FileReadToArray(@WorkingDir & "\taba.cfg", $taba) If IsArray($taba) Then $a += 5 If $a > $taba[0] Then $a = $taba[0] pos() taba() EndIf ElseIf $msg = $adown1 Then Dim $taba _FileReadToArray(@WorkingDir & "\taba.cfg", $taba) If IsArray($taba) Then $a += 1 If $a > $taba[0] Then $a = $taba[0] pos() taba() EndIf ElseIf $msg = $aup Then Dim $taba _FileReadToArray(@WorkingDir & "\taba.cfg", $taba) If IsArray($taba) Then $a -= 5 If $a < 1 Then $a = 1 pos() taba() EndIf ElseIf $msg = $aup1 Then Dim $taba _FileReadToArray(@WorkingDir & "\taba.cfg", $taba) If IsArray($taba) Then $a -= 1 If $a < 1 Then $a = 1 pos() taba() EndIf ElseIf $msg = $bdown Then Dim $tabb _FileReadToArray(@WorkingDir & "\tabb.cfg", $tabb) If IsArray($tabb) Then $b += 5 If $b > $tabb[0] Then $b = $tabb[0] pos() tabb() EndIf ElseIf $msg = $bdown1 Then Dim $tabb _FileReadToArray(@WorkingDir & "\tabb.cfg", $tabb) If IsArray($tabb) Then $b += 1 If $b > $tabb[0] Then $b = $tabb[0] pos() tabb() EndIf ElseIf $msg = $bup Then Dim $tabb _FileReadToArray(@WorkingDir & "\tabb.cfg", $tabb) If IsArray($tabb) Then $b -= 5 If $b < 1 Then $b = 1 pos() tabb() EndIf ElseIf $msg = $bup1 Then Dim $tabb _FileReadToArray(@WorkingDir & "\tabb.cfg", $tabb) If IsArray($tabb) Then $b -= 1 If $b < 1 Then $b = 1 pos() tabb() EndIf ElseIf $msg = $cdown Then Dim $tabc _FileReadToArray(@WorkingDir & "\tabc.cfg", $tabc) If IsArray($tabc) Then $c += 5 If $c > $tabc[0] Then $c = $tabc[0] pos() tabc() EndIf ElseIf $msg = $cdown1 Then Dim $tabc _FileReadToArray(@WorkingDir & "\tabc.cfg", $tabc) If IsArray($tabc) Then $c += 1 If $c > $tabc[0] Then $c = $tabc[0] pos() tabc() EndIf ElseIf $msg = $cup Then Dim $tabc _FileReadToArray(@WorkingDir & "\tabc.cfg", $tabc) If IsArray($tabc) Then $c -= 5 If $c < 1 Then $c = 1 pos() tabc() EndIf ElseIf $msg = $cup1 Then Dim $tabc _FileReadToArray(@WorkingDir & "\tabc.cfg", $tabc) If IsArray($tabc) Then $c -= 1 If $c < 1 Then $c = 1 pos() tabc() EndIf ElseIf $msg = $GUI_EVENT_CLOSE Then pos() GUIDelete() Exit (1) ElseIf $msg > 0 Then $run = GUICtrlRead($msg) Run($run) EndIf WEnd Func taba() Dim $taba Dim $buta _FileReadToArray(@WorkingDir & "\taba.cfg", $buta) ;$q=$buta[0] ;ReDim $buta[$q] $i = 1 $y = 25 $w = 1 For $i = 1 To UBound($buta) - 1 GUICtrlDelete($buta[$i]) Next _FileReadToArray(@WorkingDir & "\taba.cfg", $taba) If IsArray($taba) Then If Int($taba[0]) - $a > 9 Then For $i = $a To $a + 8 If $taba[$i] <> "" Then If $y > 385 Then $y = 385 GUICtrlCreateLabel("", 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($taba[$i], "\") $o = $name[0] Int($o) If $w > 9 Then $w = 9 GUICtrlSetData($prog[$w], $name[$o]) _ArrayAdd($buta, $w) $buta[$w] = GUICtrlCreateButton("", 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($buta[$w], $taba[$i]) GUICtrlSetImage($buta[$w], "" & $taba[$i] & "", 1) $y += 40 $w += 1 EndIf Next ElseIf Int($taba[0]) - $a < 10 Then For $i = $a To UBound($taba) - 1 If $taba[$i] <> "" Then If $y > 385 Then $y = 385 GUICtrlCreateLabel($taba[$i], 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($taba[$i], "\") $o = $name[0] Int($o) If $w > 9 Then $w = 9 GUICtrlSetData($prog[$w], $name[$o]) _ArrayAdd($buta, $w) $buta[$w] = GUICtrlCreateButton($taba[$i], 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($buta[$w], $taba[$i]) GUICtrlSetImage($buta[$w], $taba[$i], 1) $y += 40 $w += 1 EndIf Next EndIf EndIf EndFunc ;==>taba Func tabb() Dim $tabb Dim $butb[1] $i = 1 $y = 25 $w = 1 For $i = 1 To UBound($butb) - 1 GUICtrlDelete($butb[$i]) Next _FileReadToArray(@WorkingDir & "\tabb.cfg", $tabb) If IsArray($tabb) Then If Int($tabb[0]) - $b > 9 Then For $i = $b To $b + 8 If $tabb[$i] <> "" Then If $y > 385 Then $y = 385 GUICtrlCreateLabel("", 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($tabb[$i], "\") $o = $name[0] Int($o) If $w > 9 Then $w = 9 GUICtrlSetData($progb[$w], $name[$o]) _ArrayAdd($butb, $w) $butb[$w] = GUICtrlCreateButton("", 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($butb[$w], $tabb[$i]) GUICtrlSetImage($butb[$w], "" & $tabb[$i] & "", 1) $y += 40 $w += 1 EndIf Next ElseIf Int($tabb[0]) - $b < 10 Then For $i = $b To UBound($tabb) - 1 If $tabb[$i] <> "" Then If $y > 385 Then $y = 385 GUICtrlCreateLabel($tabb[$i], 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($tabb[$i], "\") $o = $name[0] Int($o) If $w > 9 Then $w = 9 GUICtrlSetData($progb[$w], $name[$o]) _ArrayAdd($butb, $w) $butb[$w] = GUICtrlCreateButton($tabb[$i], 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($butb[$w], $tabb[$i]) GUICtrlSetImage($butb[$w], $tabb[$i], 1) $y += 40 $w += 1 EndIf Next EndIf EndIf EndFunc ;==>tabb Func tabc() Dim $tabc Dim $butc[1] $i = 1 $y = 25 $w = 1 For $i = 1 To UBound($butc) - 1 GUICtrlDelete($butc[$i]) Next _FileReadToArray(@WorkingDir & "\tabc.cfg", $tabc) If IsArray($tabc) Then If Int($tabc[0]) - $c > 9 Then For $i = $c To $c + 8 If $tabc[$i] <> "" Then If $y > 385 Then $y = 385 GUICtrlCreateLabel("", 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($tabc[$i], "\") $o = $name[0] Int($o) If $w > 9 Then $w = 9 GUICtrlSetData($progc[$w], $name[$o]) _ArrayAdd($butc, $w) $butc[$w] = GUICtrlCreateButton("", 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($butc[$w], $tabc[$i]) GUICtrlSetImage($butc[$w], "" & $tabc[$i] & "", 1) $y += 40 $w += 1 EndIf Next ElseIf Int($tabc[0]) - $c < 10 Then For $i = $c To UBound($tabc) - 1 If $tabc[$i] <> "" Then If $y > 385 Then $y = 385 GUICtrlCreateLabel($tabc[$i], 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($tabc[$i], "\") $o = $name[0] Int($o) If $w > 9 Then $w = 9 GUICtrlSetData($progc[$w], $name[$o]) _ArrayAdd($butc, $w) $butc[$w] = GUICtrlCreateButton($tabc[$i], 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($butc[$w], $tabc[$i]) GUICtrlSetImage($butc[$w], $tabc[$i], 1) $y += 40 $w += 1 EndIf Next EndIf EndIf EndFunc ;==>tabc Func createpath1() $adpro = GUICreate("Add Program", 200, 30, -1, -1, -1, $WS_EX_ACCEPTFILES) $ftpr = GUICtrlCreateInput("", 1, 4, 160, 20) GUICtrlSetState($ftpr, $GUI_DROPACCEPTED) $prin = GUICtrlCreateButton("OK", 165, 1) GUISetState(@SW_SHOW) While 1 $msg2 = GUIGetMsg() If $msg2 = $prin Then $read = GUICtrlRead($ftpr) FileWriteLine(@WorkingDir & "\taba.cfg", $read) GUIDelete($adpro) ExitLoop ElseIf $msg2 = $GUI_EVENT_CLOSE Then GUIDelete($adpro) ExitLoop EndIf WEnd pos() taba() EndFunc ;==>createpath1 Func createpath2() GUICreate("Add Program", 200, 30, -1, -1, -1, $WS_EX_ACCEPTFILES) $ftpr = GUICtrlCreateInput("", 1, 4, 160, 20) GUICtrlSetState($ftpr, $GUI_DROPACCEPTED) $prin = GUICtrlCreateButton("OK", 165, 1) GUISetState(@SW_SHOW) While 1 $msg2 = GUIGetMsg() If $msg2 = $prin Then $read = GUICtrlRead($ftpr) FileWriteLine(@WorkingDir & "\tabb.cfg", $read) GUIDelete() ExitLoop ElseIf $msg2 = $GUI_EVENT_CLOSE Then GUIDelete() ExitLoop EndIf WEnd pos() tabb() EndFunc ;==>createpath2 Func createpath3() GUICreate("Add Program", 200, 30, -1, -1, -1, $WS_EX_ACCEPTFILES) $ftpr = GUICtrlCreateInput("", 1, 4, 160, 20) GUICtrlSetState($ftpr, $GUI_DROPACCEPTED) $prin = GUICtrlCreateButton("OK", 165, 1) GUISetState(@SW_SHOW) While 1 $msg2 = GUIGetMsg() If $msg2 = $prin Then $read = GUICtrlRead($ftpr) FileWriteLine(@WorkingDir & "\tabc.cfg", $read) GUIDelete() ExitLoop ElseIf $msg2 = $GUI_EVENT_CLOSE Then GUIDelete() ExitLoop EndIf WEnd pos() tabc() EndFunc ;==>createpath3 Func removea() Local $remtaba _FileReadToArray(@WorkingDir & "\taba.cfg", $remtaba) $remove = GUICreate("Remove", 400, 500) $del = GUICtrlCreateButton("Delete", 180, 460, 50, 30) $lista = GUICtrlCreateListView("Select program then click delete", 1, 1, 398, 450) For $i = 1 To UBound($remtaba) - 1 If $remtaba[$i] <> "" Then GUICtrlCreateListViewItem($remtaba[$i] & "|", $lista) EndIf Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $del Then $select = GUICtrlRead($lista) $select1 = GUICtrlRead($select) $select2 = StringTrimRight($select1, 1) $read = FileRead(@WorkingDir & "\taba.cfg") $new = StringReplace($read, $select2, "") $new2 = StringReplace($new, @CRLF & @CRLF, @CRLF) $file = FileOpen(@WorkingDir & "\taba.cfg", 2) FileWrite($file, $new2) FileClose($file) ExitLoop ElseIf $msg = $GUI_EVENT_CLOSE Then GUIDelete($remove) ExitLoop EndIf WEnd pos() GUIDelete($remove) GUIDelete($main) gui() EndFunc ;==>removea Func removeb() Local $remtabb _FileReadToArray(@WorkingDir & "\tabb.cfg", $remtabb) $remove = GUICreate("Remove", 400, 500) $del = GUICtrlCreateButton("Delete", 180, 460, 50, 30) $listb = GUICtrlCreateListView("Select program then click delete", 1, 1, 398, 450) For $i = 1 To UBound($remtabb) - 1 If $remtabb[$i] <> "" Then GUICtrlCreateListViewItem($remtabb[$i] & "|", $listb) EndIf Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $del Then $select = GUICtrlRead($listb) $select1 = GUICtrlRead($select) $select2 = StringTrimRight($select1, 1) $read = FileRead(@WorkingDir & "\tabb.cfg") $new = StringReplace($read, $select2, "") $new2 = StringReplace($new, @CRLF & @CRLF, @CRLF) $file = FileOpen(@WorkingDir & "\tabb.cfg", 2) FileWrite($file, $new2) FileClose($file) ExitLoop ElseIf $msg = $GUI_EVENT_CLOSE Then GUIDelete($remove) ExitLoop EndIf WEnd pos() GUIDelete($remove) GUIDelete($main) gui() EndFunc ;==>removeb Func removec() Local $remtabc _FileReadToArray(@WorkingDir & "\tabc.cfg", $remtabc) $remove = GUICreate("Remove", 400, 500) $del = GUICtrlCreateButton("Delete", 180, 460, 50, 30) $listc = GUICtrlCreateListView("Select program then click delete", 1, 1, 398, 450) For $i = 1 To UBound($remtabc) - 1 If $remtabc[$i] <> "" Then GUICtrlCreateListViewItem($remtabc[$i] & "|", $listc) EndIf Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $del Then $select = GUICtrlRead($listc) $select1 = GUICtrlRead($select) $select2 = StringTrimRight($select1, 1) $read = FileRead(@WorkingDir & "\tabc.cfg") $new = StringReplace($read, $select2, "") $new2 = StringReplace($new, @CRLF & @CRLF, @CRLF) $file = FileOpen(@WorkingDir & "\tabc.cfg", 2) FileWrite($file, $new2) FileClose($file) ExitLoop ElseIf $msg = $GUI_EVENT_CLOSE Then GUIDelete($remove) ExitLoop EndIf WEnd pos() GUIDelete($remove) GUIDelete($main) gui() EndFunc ;==>removec Func addtab() EndFunc ;==>addtab Func deltab() EndFunc ;==>deltab Func firstrun() $1 = InputBox("Enter Tab 1 Name", "Enter a Name for Tab 1", "Tab1") $2 = InputBox("Enter Tab 2 Name", "Enter a Name for Tab 2", "Tab2") $3 = InputBox("Enter Tab 3 Name", "Enter a Name for Tab 3", "Tab3") IniWrite(@WorkingDir & "\pldata.ini", "Tab", 1, $1) IniWrite(@WorkingDir & "\pldata.ini", "Tab", 2, $2) IniWrite(@WorkingDir & "\pldata.ini", "Tab", 3, $3) EndFunc ;==>firstrun Func pos() $pos = WinGetPos($main) IniWrite(@WorkingDir & "\pldata.ini", "pos", 1, $pos[0]) IniWrite(@WorkingDir & "\pldata.ini", "pos", 2, $pos[1]) EndFunc ;==>pos Func createtaba() $prog[1] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[2] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[3] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[4] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[5] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[6] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[7] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[8] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[9] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) taba() EndFunc ;==>createtaba Func createtabb() $progb[1] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[2] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[3] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[4] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[5] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[6] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[7] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[8] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[9] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) tabb() EndFunc ;==>createtabb Func createtabc() $progc[1] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[2] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[3] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[4] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[5] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[6] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[7] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[8] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[9] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) tabc() EndFunc ;==>createtabc <-Updated Edited August 9, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
jaberwacky Posted August 9, 2010 Share Posted August 9, 2010 It runs on my win 7 64 but I don't know if it runs correctly. I get 3 windows asking me for tab names and then another gui that has a button for entering and deleting programs. I enter a program name, click the button, but nothing happens. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
kaotkbliss Posted August 9, 2010 Author Share Posted August 9, 2010 (edited) Since it's not finished, I have not created any instructions yet. It's also in early stages I just got the problem figured out but basically what you do is name your tabs (only on first run) then click add and drag/drop or type in full path and click OK this will add a bar on the gui to launch the program when clicked. the couple things I had to do were: change ElseIf $msg <> 0 Then $run = GUICtrlRead($msg) Run($run) to ElseIf $msg > 0 Then $run = GUICtrlRead($msg) Run($run) and also add GUICtrlSetData($buta[$w], $taba[$i]) before setting the image. GUICtrlSetImage($buta[$w], "" & $taba[$i] & "", 1) Somehow windows xp was able to read the program path from the icon so was able to launch the programs in the gui, windows 7 would not so I had to create a label under the icon for the guigetmsg to read. expandcollapse popup#RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=Allin1.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <Array.au3> #include <File.au3> #include <staticconstants.au3> AutoItSetOption("trayicondebug", 1) Dim $prog[10] Dim $progb[10] Dim $progc[10] Global $add1, $add2, $add3, $fileitem1, $fileitem2, $main, $remove1, $remove2, $remove3, $y, $x, $w Global $aup, $aup1, $adown, $adown1, $bup, $bup1, $bdown, $bdown1, $cup, $cup1, $cdown, $cdown1 $a=1 $b=1 $c=1 $ini = FileExists(@WorkingDir & "\pldata.ini") If $ini = 0 Then firstrun() EndIf $tab1 = IniRead(@WorkingDir & "\pldata.ini", "Tab", 1, "Tab1") $tab2 = IniRead(@WorkingDir & "\pldata.ini", "Tab", 2, "Tab2") $tab3 = IniRead(@WorkingDir & "\pldata.ini", "Tab", 3, "Tab3") gui() Func gui() $posx = IniRead(@WorkingDir & "\pldata.ini", "pos", 1, -1) $posy = IniRead(@WorkingDir & "\pldata.ini", "pos", 2, -1) $y = 25 $w = 1 $main = GUICreate("Program Launcher", 350, 446, $posx, $posy) $filemenu = GUICtrlCreateMenu("Options") $fileitem1 = GUICtrlCreateMenuItem("Add Tab", $filemenu) $fileitem2 = GUICtrlCreateMenuItem("Remove Tab", $filemenu) GUICtrlCreateTab(2, 2, 346, 426) $win = GUICtrlCreateTabItem($tab1) taba() $y = 25 $w = 1 $add1 = GUICtrlCreateButton("Add Program", 95, 400, 73, 25) $remove1 = GUICtrlCreateButton("Remove Program", 180, 400, 90, 25) GUICtrlCreateLabel("", 324, 64, 22, 295, $SS_BLACKFRAME) $aup = GUICtrlCreateButton("/\" & @CR & "/\", 323, 26, 22, 25, BitOR($BS_MULTILINE, $BS_CENTER)) $aup1 = GUICtrlCreateButton("/\", 323, 50, 22, 22, BitOR($BS_MULTILINE, $BS_CENTER)) $adown = GUICtrlCreateButton("\/" & @CR & "\/", 323, 373, 22, 25, BitOR($BS_MULTILINE, $BS_VCENTER)) $adown1 = GUICtrlCreateButton("\/", 323, 352, 22, 22, $BS_VCENTER) $win2 = GUICtrlCreateTabItem($tab2) tabb() $y = 25 $w = 1 $add2 = GUICtrlCreateButton("Add Program", 95, 400, 73, 25) $remove2 = GUICtrlCreateButton("Remove Program", 180, 400, 90, 25) GUICtrlCreateLabel("", 324, 64, 22, 295, $SS_BLACKFRAME) $bup = GUICtrlCreateButton("/\" & @CR & "/\", 323, 26, 22, 25, BitOR($BS_MULTILINE, $BS_CENTER)) $bup1 = GUICtrlCreateButton("/\", 323, 50, 22, 22, BitOR($BS_MULTILINE, $BS_CENTER)) $bdown = GUICtrlCreateButton("\/" & @CR & "\/", 323, 373, 22, 25, BitOR($BS_MULTILINE, $BS_VCENTER)) $bdown1 = GUICtrlCreateButton("\/", 323, 352, 22, 22, $BS_VCENTER) $win3 = GUICtrlCreateTabItem($tab3) tabc() $y = 25 $w = 1 $add3 = GUICtrlCreateButton("Add Program", 95, 400, 73, 25) $remove3 = GUICtrlCreateButton("Remove Program", 180, 400, 90, 25) GUICtrlCreateLabel("", 324, 64, 22, 295, $SS_BLACKFRAME) $cup = GUICtrlCreateButton("/\" & @CR & "/\", 323, 26, 22, 25, BitOR($BS_MULTILINE, $BS_CENTER)) $cup1 = GUICtrlCreateButton("/\", 323, 50, 22, 22, BitOR($BS_MULTILINE, $BS_CENTER)) $cdown = GUICtrlCreateButton("\/" & @CR & "\/", 323, 373, 22, 25, BitOR($BS_MULTILINE, $BS_VCENTER)) $cdown1 = GUICtrlCreateButton("\/", 323, 352, 22, 22, $BS_VCENTER) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) EndFunc ;==>gui While 1 $msg = GUIGetMsg() If $msg = $add1 Then createpath1() ElseIf $msg = $add2 Then createpath2() ElseIf $msg = $add3 Then createpath3() ElseIf $msg = $fileitem1 Then addtab() ElseIf $msg = $fileitem2 Then deltab() ElseIf $msg = $remove1 Then removea() ElseIf $msg = $remove2 Then removeb() ElseIf $msg = $remove3 Then removec() ElseIf $msg = $adown Then Dim $taba _FileReadToArray(@WorkingDir & "\taba.cfg", $taba) $a+=5 If $a>$taba[0] Then $a=$taba[0] pos() GUIDelete($main) gui() ElseIf $msg = $adown1 Then Dim $taba _FileReadToArray(@WorkingDir & "\taba.cfg", $taba) $a+=1 If $a>$taba[0] Then $a=$taba[0] pos() GUIDelete($main) gui() ElseIf $msg = $aup Then $a-=5 If $a<1 Then $a=1 pos() GUIDelete($main) gui() ElseIf $msg = $aup1 Then $a-=1 If $a<1 Then $a=1 pos() GUIDelete($main) gui() ElseIf $msg = $bdown Then Dim $tabb _FileReadToArray(@WorkingDir & "\tabb.cfg", $tabb) $b+=5 If $b>$tabb[0] Then $b=$tabb[0] pos() GUIDelete($main) gui() ElseIf $msg = $bdown1 Then Dim $tabb _FileReadToArray(@WorkingDir & "\tabb.cfg", $tabb) $b+=1 If $b>$tabb[0] Then $b=$tabb[0] pos() GUIDelete($main) gui() ElseIf $msg = $bup Then $b-=5 If $b<1 Then $b=1 pos() GUIDelete($main) gui() ElseIf $msg = $bup1 Then $b-=1 If $b<1 Then $b=1 pos() GUIDelete($main) gui() ElseIf $msg = $cdown Then Dim $tabc _FileReadToArray(@WorkingDir & "\tabc.cfg", $tabc) $c+=5 If $c>$tabc[0] Then $c=$tabc[0] pos() GUIDelete($main) gui() ElseIf $msg = $cdown1 Then Dim $tabc _FileReadToArray(@WorkingDir & "\tabc.cfg", $tabc) $c+=1 If $c>$tabc[0] Then $c=$tabc[0] pos() GUIDelete($main) gui() ElseIf $msg = $cup Then $c-=5 If $c<1 Then $c=1 pos() GUIDelete($main) gui() ElseIf $msg = $cup1 Then $c-=1 If $c<1 Then $c=1 pos() GUIDelete($main) gui() ElseIf $msg = $GUI_EVENT_CLOSE Then pos() GUIDelete() Exit (1) ElseIf $msg > 0 Then $run = GUICtrlRead($msg) Run($run) EndIf WEnd Func taba() Dim $taba Dim $buta[1] If $y>385 Then $y=385 $prog[1] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[2] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[3] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[4] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[5] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[6] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[7] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[8] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $prog[9] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $i = 1 $y = 25 $w = 1 _FileReadToArray(@WorkingDir & "\taba.cfg", $taba) If IsArray($taba) Then If Int($taba[0])-$a > 9 Then For $i = $a To $a+8 If $taba[$i] <> "" Then If $y>385 Then $y=385 GUICtrlCreateLabel("", 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($taba[$i], "\") $o = $name[0] Int($o) If $w>9 then $w=9 GUICtrlSetData($prog[$w], $name[$o]) _ArrayAdd($buta, $w) $buta[$w] = GUICtrlCreateButton("", 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($buta[$w], $taba[$i]) GUICtrlSetImage($buta[$w], "" & $taba[$i] & "", 1) $y += 40 $w += 1 EndIf Next ElseIf Int($taba[0])-$a < 10 Then For $i = $a To UBound($taba) - 1 If $taba[$i] <> "" Then If $y>385 Then $y=385 GUICtrlCreateLabel($taba[$i], 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($taba[$i], "\") $o = $name[0] Int($o) If $w>9 then $w=9 GUICtrlSetData($prog[$w], $name[$o]) _ArrayAdd($buta, $w) $buta[$w] = GUICtrlCreateButton($taba[$i], 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($buta[$w], $taba[$i]) GUICtrlSetImage($buta[$w], $taba[$i], 1) $y += 40 $w += 1 EndIf Next EndIf EndIf EndFunc ;==>taba Func tabb() Dim $tabb Dim $butb[1] If $y>385 Then $y=385 $progb[1] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[2] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[3] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[4] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[5] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[6] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[7] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[8] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progb[9] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $i = 1 $y = 25 $w = 1 _FileReadToArray(@WorkingDir & "\tabb.cfg", $tabb) If IsArray($tabb) Then If Int($tabb[0])-$b > 9 Then For $i = $b To $b+8 If $tabb[$i] <> "" Then If $y>385 Then $y=385 GUICtrlCreateLabel("", 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($tabb[$i], "\") $o = $name[0] Int($o) If $w>9 then $w=9 GUICtrlSetData($progb[$w], $name[$o]) _ArrayAdd($butb, $w) $butb[$w] = GUICtrlCreateButton("", 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($butb[$w], $tabb[$i]) GUICtrlSetImage($butb[$w], "" & $tabb[$i] & "", 1) $y += 40 $w += 1 EndIf Next ElseIf Int($tabb[0])-$b < 10 Then For $i = $b To UBound($tabb) - 1 If $tabb[$i] <> "" Then If $y>385 Then $y=385 GUICtrlCreateLabel($tabb[$i], 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($tabb[$i], "\") $o = $name[0] Int($o) If $w>9 then $w=9 GUICtrlSetData($progb[$w], $name[$o]) _ArrayAdd($butb, $w) $butb[$w] = GUICtrlCreateButton($tabb[$i], 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($butb[$w], $tabb[$i]) GUICtrlSetImage($butb[$w], $tabb[$i], 1) $y += 40 $w += 1 EndIf Next EndIf EndIf EndFunc ;==>tabb Func tabc() Dim $tabc Dim $butc[1] If $y>385 Then $y=385 $progc[1] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[2] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[3] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[4] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[5] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[6] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[7] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[8] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $y += 40 $progc[9] = GUICtrlCreateLabel("", 65, $y + 15, 185, 24) $i = 1 $y = 25 $w = 1 _FileReadToArray(@WorkingDir & "\tabc.cfg", $tabc) If IsArray($tabc) Then If Int($tabc[0])-$c > 9 Then For $i = $c To $c+8 If $tabc[$i] <> "" Then If $y>385 Then $y=385 GUICtrlCreateLabel("", 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($tabc[$i], "\") $o = $name[0] Int($o) If $w>9 then $w=9 GUICtrlSetData($progc[$w], $name[$o]) _ArrayAdd($butc, $w) $butc[$w] = GUICtrlCreateButton("", 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($butc[$w], $tabc[$i]) GUICtrlSetImage($butc[$w], "" & $tabc[$i] & "", 1) $y += 40 $w += 1 EndIf Next ElseIf Int($tabc[0])-$c < 10 Then For $i = $c To UBound($tabc) - 1 If $tabc[$i] <> "" Then If $y>385 Then $y=385 GUICtrlCreateLabel($tabc[$i], 36, $y, 287, 40, $SS_BLACKFRAME) $name = StringSplit($tabc[$i], "\") $o = $name[0] Int($o) If $w>9 then $w=9 GUICtrlSetData($progc[$w], $name[$o]) _ArrayAdd($butc, $w) $butc[$w] = GUICtrlCreateButton($tabc[$i], 5, $y + 1, 40, 40, $BS_ICON) GUICtrlSetData($butc[$w], $tabc[$i]) GUICtrlSetImage($butc[$w], $tabc[$i], 1) $y += 40 $w += 1 EndIf Next EndIf EndIf EndFunc ;==>tabc Func createpath1() $adpro=GUICreate("Add Program", 200, 30, -1, -1, -1, $WS_EX_ACCEPTFILES) $ftpr = GUICtrlCreateInput("", 1, 4, 160, 20) GUICtrlSetState($ftpr, $GUI_DROPACCEPTED) $prin = GUICtrlCreateButton("OK", 165, 1) GUISetState(@SW_SHOW) While 1 $msg2 = GUIGetMsg() If $msg2 = $prin Then $read = GUICtrlRead($ftpr) FileWriteLine(@WorkingDir & "\taba.cfg", $read) GUIDelete($adpro) ExitLoop ElseIf $msg2 = $GUI_EVENT_CLOSE Then GUIDelete($adpro) ExitLoop EndIf WEnd pos() GUIDelete($main) gui() EndFunc ;==>createpath1 Func createpath2() GUICreate("Add Program", 200, 30, -1, -1, -1, $WS_EX_ACCEPTFILES) $ftpr = GUICtrlCreateInput("", 1, 4, 160, 20) GUICtrlSetState($ftpr, $GUI_DROPACCEPTED) $prin = GUICtrlCreateButton("OK", 165, 1) GUISetState(@SW_SHOW) While 1 $msg2 = GUIGetMsg() If $msg2 = $prin Then $read = GUICtrlRead($ftpr) FileWriteLine(@WorkingDir & "\tabb.cfg", $read) GUIDelete() ExitLoop ElseIf $msg2 = $GUI_EVENT_CLOSE Then GUIDelete() ExitLoop EndIf WEnd pos() GUIDelete($main) gui() EndFunc ;==>createpath2 Func createpath3() GUICreate("Add Program", 200, 30, -1, -1, -1, $WS_EX_ACCEPTFILES) $ftpr = GUICtrlCreateInput("", 1, 4, 160, 20) GUICtrlSetState($ftpr, $GUI_DROPACCEPTED) $prin = GUICtrlCreateButton("OK", 165, 1) GUISetState(@SW_SHOW) While 1 $msg2 = GUIGetMsg() If $msg2 = $prin Then $read = GUICtrlRead($ftpr) FileWriteLine(@WorkingDir & "\tabc.cfg", $read) GUIDelete() ExitLoop ElseIf $msg2 = $GUI_EVENT_CLOSE Then GUIDelete() ExitLoop EndIf WEnd pos() GUIDelete($main) gui() EndFunc ;==>createpath3 Func removea() Local $remtaba _FileReadToArray(@WorkingDir & "\taba.cfg", $remtaba) $remove = GUICreate("Remove", 400, 500) $del = GUICtrlCreateButton("Delete", 180, 460, 50, 30) $lista = GUICtrlCreateListView("Select program then click delete", 1, 1, 398, 450) For $i = 1 To UBound($remtaba) - 1 If $remtaba[$i] <> "" Then GUICtrlCreateListViewItem($remtaba[$i] & "|", $lista) EndIf Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $del Then $select = GUICtrlRead($lista) $select1 = GUICtrlRead($select) $select2 = StringTrimRight($select1, 1) $read = FileRead(@WorkingDir & "\taba.cfg") $new = StringReplace($read, $select2, "") $new2 = StringReplace($new, @CRLF & @CRLF, @CRLF) $file = FileOpen(@WorkingDir & "\taba.cfg", 2) FileWrite($file, $new2) FileClose($file) ExitLoop ElseIf $msg = $GUI_EVENT_CLOSE Then GUIDelete($remove) ExitLoop EndIf WEnd pos() GUIDelete($remove) GUIDelete($main) gui() EndFunc ;==>removea Func removeb() Local $remtabb _FileReadToArray(@WorkingDir & "\tabb.cfg", $remtabb) $remove = GUICreate("Remove", 400, 500) $del = GUICtrlCreateButton("Delete", 180, 460, 50, 30) $listb = GUICtrlCreateListView("Select program then click delete", 1, 1, 398, 450) For $i = 1 To UBound($remtabb) - 1 If $remtabb[$i] <> "" Then GUICtrlCreateListViewItem($remtabb[$i] & "|", $listb) EndIf Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $del Then $select = GUICtrlRead($listb) $select1 = GUICtrlRead($select) $select2 = StringTrimRight($select1, 1) $read = FileRead(@WorkingDir & "\tabb.cfg") $new = StringReplace($read, $select2, "") $new2 = StringReplace($new, @CRLF & @CRLF, @CRLF) $file = FileOpen(@WorkingDir & "\tabb.cfg", 2) FileWrite($file, $new2) FileClose($file) ExitLoop ElseIf $msg = $GUI_EVENT_CLOSE Then GUIDelete($remove) ExitLoop EndIf WEnd pos() GUIDelete($remove) GUIDelete($main) gui() EndFunc ;==>removeb Func removec() Local $remtabc _FileReadToArray(@WorkingDir & "\tabc.cfg", $remtabc) $remove = GUICreate("Remove", 400, 500) $del = GUICtrlCreateButton("Delete", 180, 460, 50, 30) $listc = GUICtrlCreateListView("Select program then click delete", 1, 1, 398, 450) For $i = 1 To UBound($remtabc) - 1 If $remtabc[$i] <> "" Then GUICtrlCreateListViewItem($remtabc[$i] & "|", $listc) EndIf Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $del Then $select = GUICtrlRead($listc) $select1 = GUICtrlRead($select) $select2 = StringTrimRight($select1, 1) $read = FileRead(@WorkingDir & "\tabc.cfg") $new = StringReplace($read, $select2, "") $new2 = StringReplace($new, @CRLF & @CRLF, @CRLF) $file = FileOpen(@WorkingDir & "\tabc.cfg", 2) FileWrite($file, $new2) FileClose($file) ExitLoop ElseIf $msg = $GUI_EVENT_CLOSE Then GUIDelete($remove) ExitLoop EndIf WEnd pos() GUIDelete($remove) GUIDelete($main) gui() EndFunc ;==>removec Func addtab() EndFunc ;==>addtab Func deltab() EndFunc ;==>deltab Func firstrun() $1 = InputBox("Enter Tab 1 Name", "Enter a Name for Tab 1","Tab1") $2 = InputBox("Enter Tab 2 Name", "Enter a Name for Tab 2","Tab2") $3 = InputBox("Enter Tab 3 Name", "Enter a Name for Tab 3","Tab3") IniWrite(@WorkingDir & "\pldata.ini", "Tab", 1, $1) IniWrite(@WorkingDir & "\pldata.ini", "Tab", 2, $2) IniWrite(@WorkingDir & "\pldata.ini", "Tab", 3, $3) EndFunc ;==>firstrun Func pos() $pos = WinGetPos($main) IniWrite(@WorkingDir & "\pldata.ini", "pos", 1, $pos[0]) IniWrite(@WorkingDir & "\pldata.ini", "pos", 2, $pos[1]) EndFunc *edit* Now I am working on a better way of updating the changes made to programs without consistantly destroying and rebuilding the gui Edited August 9, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! 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