Delta01 Posted September 7, 2007 Posted September 7, 2007 (edited) Hi, Well, I'm making an AutoIt code and it's my first to deal with GUI's. But i'm having a problem, I have my GUI so that it has 4 buttons, Close the program (kill), minimizer the program, maximize the program and Close, to close the script. The close and the kill button work fine, it's the other 2 that don't. I had hotkeys set up to minimize/maximize and they worked perfectly, so i used the same code and added it to the GUI, but it doesn't work. $main = GUICreate("----", 146, 150) $Kill = GUICtrlCreateButton("Kill Program", 35, 12, 80, 25) $Hide = GUICtrlCreateButton("Minimize Program", 35, 37, 80, 25) $Show = GUICtrlCreateButton("Maximize Program", 35, 63, 80, 25) $Close = GUICtrlCreateButton("Close script", 35, 88, 80, 25) GuiCtrlCreateLabel("Made by ----©", 58, 135) GuiSetstate() While 1 $GuiControl = GUIGetMsg() If $GuiControl = $Close then Exit If $GuiControl = $Kill then If ProcessExists("xxxxx") then sleep(20) ProcessClose("xxxxx") If $GuiControl = $Hide then WinSetState("xxxxx", "", @SW_MINIMIZE) WinSetState("xxxxx", "", @SW_HIDE) If $GuiControl = $Show Then WinSetState("xxxxx", "", @SW_SHOW) WinSetState("xxxxx", "", @SW_RESTORE) EndIf EndIf Endif Endif WEND Does anybody know what's wrong? Edited September 7, 2007 by Delta01
mrbond007 Posted September 7, 2007 Posted September 7, 2007 #include <GuiConstants.au3> $main = GUICreate("----", 146, 150) $Kill = GUICtrlCreateButton("Kill Program", 35, 12, 80, 25) $Hide = GUICtrlCreateButton("Minimize Program", 35, 37, 80, 25) $Show = GUICtrlCreateButton("Maximize Program", 35, 63, 80, 25) $Close = GUICtrlCreateButton("Close script", 35, 88, 80, 25) GuiCtrlCreateLabel("Made by ----©", 58, 135) GuiSetstate() While 1 $GuiControl = GUIGetMsg() If $GuiControl = $Close then Exit If $GuiControl = $Kill then If ProcessExists("xxxxx") then sleep(20) ProcessClose("xxxxx") EndIf EndIf If $GuiControl = $Hide then WinSetState("xxxxx", "", @SW_MINIMIZE) WinSetState("xxxxx", "", @SW_HIDE) EndIf If $GuiControl = $Show Then WinSetState("xxxxx", "", @SW_SHOW) WinSetState("xxxxx", "", @SW_RESTORE) EndIf WEND Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight
Delta01 Posted September 7, 2007 Author Posted September 7, 2007 Ok, It works perfect now. Thanks a ton!
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