Info Posted February 19, 2008 Share Posted February 19, 2008 #include <GUIConstants.au3> GUICreate("Just a GUI", 500, 321, 258, 181) GUISetBkColor (0x000000) $StartButton = GUICtrlCreateButton("Start", 27, 145, 89, 33, 0) $CheckBox= GUICtrlCreateCheckbox ("BlaBla", 370, 10, 112, 15) GUICtrlSetColor(-1, 0xFFFFFF) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CheckBox), "wstr", "", "wstr", "") GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $CheckBox If WinExists ( "C:\") = True Then Sleep ( 2000 ) WinClose ( "C:\") EndIf Case $msg = $StartButton ShellExecute ("C:\") EndSelect WEnd If I put the EndIf in the end, the script just wont work. So what do I do? Link to comment Share on other sites More sharing options...
BrettF Posted February 19, 2008 Share Posted February 19, 2008 #include <GUIConstants.au3> GUICreate("Just a GUI", 500, 321, 258, 181) GUISetBkColor (0x000000) $StartButton = GUICtrlCreateButton("Start", 27, 145, 89, 33, 0) $CheckBox= GUICtrlCreateCheckbox ("BlaBla", 370, 10, 112, 15) GUICtrlSetColor(-1, 0xFFFFFF) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CheckBox), "wstr", "", "wstr", "") GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $CheckBox If WinExists ( "C:\") = True Then Sleep ( 2000 ) WinClose ( "C:\") EndIf Case $msg = $StartButton ShellExecute ("C:\") EndSelect WEnd If I put the EndIf in the end, the script just wont work. So what do I do? I'm not sure. This works for me. What exactly doens't work? #include <GUIConstants.au3> GUICreate("Just a GUI", 500, 321, 258, 181) GUISetBkColor (0x000000) $StartButton = GUICtrlCreateButton("Start", 27, 145, 89, 33, 0) $CheckBox= GUICtrlCreateCheckbox ("BlaBla", 370, 10, 112, 15) GUICtrlSetColor(-1, 0xFFFFFF) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CheckBox), "wstr", "", "wstr", "") GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $CheckBox If BitAnd(GUICtrlRead($CheckBox),$GUI_CHECKED) Then If WinExists ( "C:\") Then WinClose ( "C:\") EndIf EndIf Case $msg = $StartButton ShellExecute ("C:\") EndSelect WEnd Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Info Posted February 20, 2008 Author Share Posted February 20, 2008 Doesn't working, I just want it to look for a window untill $GUI_EVENT_CLOSE, and if the window is found, exit it. Link to comment Share on other sites More sharing options...
Info Posted February 21, 2008 Author Share Posted February 21, 2008 UP Please help meh =[ Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 21, 2008 Share Posted February 21, 2008 I just want it to look for a window untill $GUI_EVENT_CLOSE, and if the window is found, exit it.Then why do you have your WinExists() executed only when the checkbox is "used" and not when it is checked?? You need to move your WinExists() etc into the main-loop like this #include <GUIConstants.au3> GUICreate("Just a GUI", 500, 321, 258, 181) GUISetBkColor (0x000000) $StartButton = GUICtrlCreateButton("Start", 27, 145, 89, 33, 0) $CheckBox= GUICtrlCreateCheckbox ("BlaBla", 370, 10, 112, 15) GUICtrlSetColor(-1, 0xFFFFFF) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($CheckBox), "wstr", "", "wstr", "") GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $StartButton ShellExecute ("C:\WINDOWS") EndSelect If BitAnd(GUICtrlRead($CheckBox),$GUI_CHECKED) Then If WinExists ( "WINDOWS") Then WinClose ( "WINDOWS") EndIf EndIf WEnd .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Info Posted February 24, 2008 Author Share Posted February 24, 2008 WORKING! 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