xah Posted January 28, 2009 Share Posted January 28, 2009 I want to set a timeout for the GUI, but I can't get it to work. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Timers.au3> Local $doorgaan, $overslaan, $msg $hGUI = GUICreate("AH-Tool", 190, 85) GUISetStyle(BitOR($WS_CAPTION, $WS_POPUPWINDOW) ) GUICtrlCreateLabel("LOT01101", 10, 10) $doorgaan = GUICtrlCreateButton("Doorgaan", 10, 30, 80, 20) $overslaan = GUICtrlCreateButton("Overslaan", 100, 30, 80, 20) GUISetState() ; display the GUI _Timer_SetTimer($hGUI, 2000, "Quit"); create timer While 1 $msg = GUIGetMsg() Sleep(1000) Switch $msg Case $doorgaan GUIDelete() MsgBox(0, "Info", "$doorgaan") Exit Case $overslaan GUIDelete() MsgBox(0, "Info", "$overslaan") Exit Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd Func Quit() Exit EndFunc Help please, I just need this GUI to timeout and quit. Link to comment Share on other sites More sharing options...
KaFu Posted January 28, 2009 Share Posted January 28, 2009 The called func expects params. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Timers.au3> Local $doorgaan, $overslaan, $msg $hGUI = GUICreate("AH-Tool", 190, 85) GUISetStyle(BitOR($WS_CAPTION, $WS_POPUPWINDOW) ) GUICtrlCreateLabel("LOT01101", 10, 10) $doorgaan = GUICtrlCreateButton("Doorgaan", 10, 30, 80, 20) $overslaan = GUICtrlCreateButton("Overslaan", 100, 30, 80, 20) GUISetState() ; display the GUI _Timer_SetTimer($hGUI, 2000, "Quit") While 1 $msg = GUIGetMsg() Sleep(10) Switch $msg Case $doorgaan GUIDelete() MsgBox(0, "Info", "$doorgaan") Exit Case $overslaan GUIDelete() MsgBox(0, "Info", "$overslaan") Exit Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd Func Quit($hWnd, $Msg, $iIDTimer, $dwTime) Exit EndFunc OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
xah Posted January 28, 2009 Author Share Posted January 28, 2009 Yes, that's what I was missing. 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