blackman12 Posted January 27, 2009 Share Posted January 27, 2009 expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) WinSetOnTop("Program Kurulumu","",1) GuiCreate("Tema Seçim", 640, 460,-1, -1,$WS_POPUP) $yol = @WindowsDir & "\Resources\Themes\" $yol2 = @WindowsDir & "\Web\Wallpaper\" $yol3 = @ScriptDir & "\Kaynak\" $tab = GUICtrlCreateTab(140, 10, 490, 420) $tab1 = GUICtrlCreateTabItem("Tema") $label = GUICtrlCreateLabel("Lütfen bir tema seçin:",150,45,110,20) $combo = GUICtrlCreateCombo("Windows XP",257,40,150,10) GUICtrlSetData(-1, "Inspirat2|LiveBlue|SevenVG|SidCrafty7", "Windows XP") GUICtrlSetOnEvent(-1, "TemaFonk") $Grup = GuiCtrlCreateGroup("Windows XP", 150, 70, 470, 350) $Onizleme = GuiCtrlCreatePic($yol3 & "Windows XP.jpg", 170, 100, 430, 300) $tab2 = GUICtrlCreateTabItem("Arkaplan") $label2 = GUICtrlCreateLabel("Lütfen bir arkaplan seçin:",150,45,120,20) $combo2 = GUICtrlCreateCombo("BlackXP 0",273,40,150,10) GUICtrlSetData(-1, "BlackXP 1|BlackXP 2|BlackXP 3|BlackXP 4|BlackXP 5|BlackXP 6|BlackXP 7|BlackXP 8|BlackXP 9|BlackXP 10|BlackXP 11|BlackXP 12|BlackXP 13|BlackXP 14|BlackXP 15|BlackXP 16", "BlackXP 0") GUICtrlSetOnEvent(-1, "ArtFonk") $Grup2 = GuiCtrlCreateGroup("BlackXP 0", 150, 70, 470, 350) $Onizleme2 = GuiCtrlCreatePic($yol2 & "\BlackXP 0.jpg", 170, 100, 430, 300) GUICtrlCreateTabItem("") $button = GUICtrlCreateButton("Durdur",555,430,75,25) $YanPanel = GuiCtrlCreatePic($yol3 & "tema.jpg", 0, 0, 130, 460) GuiSetState(@SW_SHOW) While 1 Sleep(10) WEnd Func ArtFonk() Select case $combo2 $resim = Guictrlread($combo2) Guictrlsetimage($Onizleme2,$yol2 & $resim & ".jpg") GUICtrlSetData($Grup2,$resim) EndSelect EndFunc func TemaFonk() Select case $combo $data = Guictrlread($combo) Guictrlsetimage($Onizleme,$yol3 & $data & ".jpg") GUICtrlSetData($grup,$data) case $button $data = Guictrlread($combo) DirMove($yol & $data,$yol & "BlackXP",1) FileMove($yol & "BlackXP\" & $data & ".msstyles",$yol & "BlackXP\blackxp.msstyles",1) $resim = Guictrlread($combo2) RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper", "REG_SZ", $yol2 & $resim & ".jpg") EndSelect EndFunc My codes are these.But button doesnt work.What is the problem? expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) WinSetOnTop("Program Kurulumu","",1) $reg = RegRead("HKEY_CURRENT_USER\BlackXP", "ProgramDeger") if $reg = "Hayır" then Program() RunWait(@ScriptDir & "\inceayar.exe") Exit Else RunWait(@ScriptDir & "\inceayar.exe") Exit EndIf func program() GuiCreate("Tema Seçim", 640, 460,-1, -1,$WS_POPUP) $yol = @WindowsDir & "\Resources\Themes\" $yol2 = @WindowsDir & "\Web\Wallpaper\" $yol3 = @ScriptDir & "\Kaynak\" $tab = GUICtrlCreateTab(140, 10, 490, 420) $tab1 = GUICtrlCreateTabItem("Tema") $label = GUICtrlCreateLabel("Lütfen bir tema seçin:",150,45,110,20) $combo = GUICtrlCreateCombo("Windows XP",257,40,150,10) GUICtrlSetData(-1, "Inspirat2|LiveBlue|SevenVG|SidCrafty7", "Windows XP") GUICtrlSetOnEvent(-1, "TemaFonk") $Grup = GuiCtrlCreateGroup("Windows XP", 150, 70, 470, 350) $Onizleme = GuiCtrlCreatePic($yol3 & "Windows XP.jpg", 170, 100, 430, 300) $tab2 = GUICtrlCreateTabItem("Arkaplan") $label2 = GUICtrlCreateLabel("Lütfen bir arkaplan seçin:",150,45,120,20) $combo2 = GUICtrlCreateCombo("BlackXP 0",273,40,150,10) GUICtrlSetData(-1, "BlackXP 1|BlackXP 2|BlackXP 3|BlackXP 4|BlackXP 5|BlackXP 6|BlackXP 7|BlackXP 8|BlackXP 9|BlackXP 10|BlackXP 11|BlackXP 12|BlackXP 13|BlackXP 14|BlackXP 15|BlackXP 16", "BlackXP 0") GUICtrlSetOnEvent(-1, "ArtFonk") $Grup2 = GuiCtrlCreateGroup("BlackXP 0", 150, 70, 470, 350) $Onizleme2 = GuiCtrlCreatePic($yol2 & "\BlackXP 0.jpg", 170, 100, 430, 300) GUICtrlCreateTabItem("") $button = GUICtrlCreateButton("Durdur",555,430,75,25) $YanPanel = GuiCtrlCreatePic($yol3 & "tema.jpg", 0, 0, 130, 460) GuiSetState(@SW_SHOW) While 1 Sleep(10) WEnd EndFunc Func ArtFonk() Select case $combo2 $resim = Guictrlread($combo2) Guictrlsetimage($Onizleme2,$yol2 & $resim & ".jpg") GUICtrlSetData($Grup2,$resim) EndSelect EndFunc func TemaFonk() Select case $combo $data = Guictrlread($combo) Guictrlsetimage($Onizleme,$yol3 & $data & ".jpg") GUICtrlSetData($grup,$data) case $button $data = Guictrlread($combo) DirMove($yol & $data,$yol & "BlackXP",1) FileMove($yol & "BlackXP\" & $data & ".msstyles",$yol & "BlackXP\blackxp.msstyles",1) $resim = Guictrlread($combo2) RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper", "REG_SZ", $yol2 & $resim & ".jpg") EndSelect EndFunc or what is the problem now? Link to comment Share on other sites More sharing options...
Authenticity Posted January 27, 2009 Share Posted January 27, 2009 (edited) This -> $button = GUICtrlCreateButton("Durdur",555,430,75,25) and this -> case $button can't work because you didn't register on event function 'TemaFonk' to the control Edit: use the @GUI_CtrlId macro instead to distinguish between the control. like 'Case @GUI_CtrlId = $button Then' Edited January 27, 2009 by Authenticity Link to comment Share on other sites More sharing options...
FireFox Posted January 27, 2009 Share Posted January 27, 2009 @BlackMan12 I see that you use GuiOnEventMode, so you cant merge it with guiregistermsg... after your control, for make it on event, just write this line : ; -1 = up line, can be remplaced with $variable of control GuiCtrlSetOnEvent(-1, "function") Cheers, FireFox. Link to comment Share on other sites More sharing options...
blackman12 Posted January 27, 2009 Author Share Posted January 27, 2009 how i did leave this detail out of account.Very thanks guys. Link to comment Share on other sites More sharing options...
blackman12 Posted January 28, 2009 Author Share Posted January 28, 2009 (edited) Thanks guys but.These codes are correct... expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) WinSetOnTop("Program Kurulumu","",1) GuiCreate("Tema Seçim", 640, 460,-1, -1,$WS_POPUP) $yol = @WindowsDir & "\Resources\Themes\" $yol2 = @WindowsDir & "\Web\Wallpaper\" $yol3 = @ScriptDir & "\Kaynak\" $tab = GUICtrlCreateTab(140, 10, 490, 420) $tab1 = GUICtrlCreateTabItem("Tema") $label = GUICtrlCreateLabel("Lütfen bir tema seçin:",150,45,110,20) $combo = GUICtrlCreateCombo("Windows XP",257,40,150,10) GUICtrlSetData(-1, "Inspirat2|LiveBlue|SevenVG|SidCrafty7", "Windows XP") GUICtrlSetOnEvent(-1, "TemaFonk") $Grup = GuiCtrlCreateGroup("Windows XP", 150, 70, 470, 350) $Onizleme = GuiCtrlCreatePic($yol3 & "Windows XP.jpg", 170, 100, 430, 300) $tab2 = GUICtrlCreateTabItem("Arkaplan") $label2 = GUICtrlCreateLabel("Lütfen bir arkaplan seçin:",150,45,120,20) $combo2 = GUICtrlCreateCombo("BlackXP 0",273,40,150,10) GUICtrlSetData(-1, "BlackXP 1|BlackXP 2|BlackXP 3|BlackXP 4|BlackXP 5|BlackXP 6|BlackXP 7|BlackXP 8|BlackXP 9|BlackXP 10|BlackXP 11|BlackXP 12|BlackXP 13|BlackXP 14|BlackXP 15|BlackXP 16", "BlackXP 0") GUICtrlSetOnEvent(-1, "ArtFonk") $Grup2 = GuiCtrlCreateGroup("BlackXP 0", 150, 70, 470, 350) $Onizleme2 = GuiCtrlCreatePic($yol2 & "\BlackXP 0.jpg", 170, 100, 430, 300) GUICtrlCreateTabItem("") $button = GUICtrlCreateButton("Durdur",555,430,75,25) GUICtrlSetOnEvent(-1, "Program") $YanPanel = GuiCtrlCreatePic($yol3 & "tema.jpg", 0, 0, 130, 460) GuiSetState(@SW_SHOW) While 1 Sleep(10) WEnd Func ArtFonk() Select case $combo2 $resim = Guictrlread($combo2) Guictrlsetimage($Onizleme2,$yol2 & $resim & ".jpg") GUICtrlSetData($Grup2,$resim) EndSelect EndFunc func TemaFonk() Select case $combo $data = Guictrlread($combo) Guictrlsetimage($Onizleme,$yol3 & $data & ".jpg") GUICtrlSetData($grup,$data) EndSelect EndFunc Func Program() Select case $button $data = Guictrlread($combo) DirMove($yol & $data,$yol & "BlackXP",1) FileMove($yol & "BlackXP\" & $data & ".msstyles",$yol & "BlackXP\blackxp.msstyles",1) $resim = Guictrlread($combo2) RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper", "REG_SZ", $yol2 & $resim & ".jpg") EndSelect EndFunc But these codes are incorrect. expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) WinSetOnTop("Program Kurulumu","",1) GuiCreate("Tema Seçim", 640, 460,-1, -1,$WS_POPUP) $yol = @WindowsDir & "\Resources\Themes\" $yol2 = @WindowsDir & "\Web\Wallpaper\" $yol3 = @ScriptDir & "\Kaynak\" $var = RegRead("HKEY_CURRENT_USER\BlackXP","TemaDeger") if $var = "Hayır" Then Program() Else Exit EndIf Func Program() $tab = GUICtrlCreateTab(140, 10, 490, 420) $tab1 = GUICtrlCreateTabItem("Tema") $label = GUICtrlCreateLabel("Lütfen bir tema seçin:",150,45,110,20) $combo = GUICtrlCreateCombo("Windows XP",257,40,150,10) GUICtrlSetData(-1, "Inspirat2|LiveBlue|SevenVG|SidCrafty7", "Windows XP") GUICtrlSetOnEvent(-1, "TemaFonk") $Grup = GuiCtrlCreateGroup("Windows XP", 150, 70, 470, 350) $Onizleme = GuiCtrlCreatePic($yol3 & "Windows XP.jpg", 170, 100, 430, 300) $tab2 = GUICtrlCreateTabItem("Arkaplan") $label2 = GUICtrlCreateLabel("Lütfen bir arkaplan seçin:",150,45,120,20) $combo2 = GUICtrlCreateCombo("BlackXP 0",273,40,150,10) GUICtrlSetData(-1, "BlackXP 1|BlackXP 2|BlackXP 3|BlackXP 4|BlackXP 5|BlackXP 6|BlackXP 7|BlackXP 8|BlackXP 9|BlackXP 10|BlackXP 11|BlackXP 12|BlackXP 13|BlackXP 14|BlackXP 15|BlackXP 16", "BlackXP 0") GUICtrlSetOnEvent(-1, "ArtFonk") $Grup2 = GuiCtrlCreateGroup("BlackXP 0", 150, 70, 470, 350) $Onizleme2 = GuiCtrlCreatePic($yol2 & "\BlackXP 0.jpg", 170, 100, 430, 300) GUICtrlCreateTabItem("") $button = GUICtrlCreateButton("Durdur",555,430,75,25) GUICtrlSetOnEvent(-1, "Uygula") $YanPanel = GuiCtrlCreatePic($yol3 & "tema.jpg", 0, 0, 130, 460) EndFunc GuiSetState(@SW_SHOW) While 1 Sleep(10) WEnd Func ArtFonk() Select case $combo2 $resim = Guictrlread($combo2) Guictrlsetimage($Onizleme2,$yol2 & $resim & ".jpg") GUICtrlSetData($Grup2,$resim) EndSelect EndFunc func TemaFonk() Select case $combo $data = Guictrlread($combo) Guictrlsetimage($Onizleme,$yol3 & $data & ".jpg") GUICtrlSetData($grup,$data) EndSelect EndFunc Func Uygula() Select case $button $data = Guictrlread($combo) DirMove($yol & $data,$yol & "BlackXP",1) FileMove($yol & "BlackXP\" & $data & ".msstyles",$yol & "BlackXP\blackxp.msstyles",1) $resim = Guictrlread($combo2) RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper", "REG_SZ", $yol2 & $resim & ".jpg") EndSelect EndFunc What is the problem?Autoit says: Variable used without being declared for "case $combo2" => "case ^" Edited January 28, 2009 by blackman12 Link to comment Share on other sites More sharing options...
Authenticity Posted January 28, 2009 Share Posted January 28, 2009 It's that the function Program is creating this control with local scope so it's not exist outside it, declare it as global in the header for easy solution. Link to comment Share on other sites More sharing options...
blackman12 Posted January 28, 2009 Author Share Posted January 28, 2009 Very thanks. 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