Mcky Posted June 11, 2007 Posted June 11, 2007 Problem: 1. Press the button and an input box pops up. The GUI is freezed. Once data is entered, press OK 2. Input box is closed and GUI is enabled but the button default status updates a few milliseconds later. Why the delay? Anything wrong with my code? Thanks #include <GUIConstants.au3> $frm_cgkey = GUICreate("Configurator", 636, 477, 216, 144, -1, 0) GUISetFont(10, 800, 0, "MS Sans Serif") $mngrp = GUICtrlCreateGroup("Application", 16, 8, 601, 457, -1, $WS_EX_TRANSPARENT) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Label1 = GUICtrlCreateLabel("Select !", 24, 48, 156, 20) $btn_newapp = GUICtrlCreateButton("New Application", 192, 85, 121, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn_newapp CHECKNEWAPP() EndSwitch WEnd Func CHECKNEWAPP() GUISetState (@SW_DISABLE,$frm_cgkey) $newprofname=InputBox ("Create New ", "Enter a new application name for this setting. Max 32 letters and no using of \/:*?<>¦") GUISetState (@SW_ENABLE,$frm_cgkey) WinActivate ($frm_cgkey) EndFunc My website: (Lots of AutoIt compiled programs+GameMaker games)http://mcky.sitesled.comMy AutoIt projects:Mcky's CalEntry - Calendar schedulingMcky's Web Extractor - Web page links extractorMcky's Appkey- Powerful Hotkey-listing tool[quote]I wish I was never born. I am just a lonely soul in this world... :([/quote]
Mcky Posted June 12, 2007 Author Posted June 12, 2007 Anyone, please help? My website: (Lots of AutoIt compiled programs+GameMaker games)http://mcky.sitesled.comMy AutoIt projects:Mcky's CalEntry - Calendar schedulingMcky's Web Extractor - Web page links extractorMcky's Appkey- Powerful Hotkey-listing tool[quote]I wish I was never born. I am just a lonely soul in this world... :([/quote]
Siao Posted June 12, 2007 Posted June 12, 2007 (edited) Anyone, please help?Use GUICtrlSetState($nMsg, $GUI_FOCUS) instead of WinActivate($frm_cgkey) Edited June 12, 2007 by Siao "be smart, drink your wine"
Moderators SmOke_N Posted June 12, 2007 Moderators Posted June 12, 2007 Problem: 1. Press the button and an input box pops up. The GUI is freezed. Once data is entered, press OK 2. Input box is closed and GUI is enabled but the button default status updates a few milliseconds later. Why the delay? Anything wrong with my code? Thanks #include <GUIConstants.au3> $frm_cgkey = GUICreate("Configurator", 636, 477, 216, 144, -1, 0) GUISetFont(10, 800, 0, "MS Sans Serif") $mngrp = GUICtrlCreateGroup("Application", 16, 8, 601, 457, -1, $WS_EX_TRANSPARENT) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Label1 = GUICtrlCreateLabel("Select !", 24, 48, 156, 20) $btn_newapp = GUICtrlCreateButton("New Application", 192, 85, 121, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn_newapp CHECKNEWAPP() EndSwitch WEnd Func CHECKNEWAPP() GUISetState (@SW_DISABLE,$frm_cgkey) $newprofname=InputBox ("Create New ", "Enter a new application name for this setting. Max 32 letters and no using of \/:*?<>¦") GUISetState (@SW_ENABLE,$frm_cgkey) WinActivate ($frm_cgkey) EndFuncAnyone, please help? I have no idea what you are looking to do here, you have not explained yourself very well at all, which is why you more than likely have had no responses. Your code does exactly what it looks like it will do when I run it. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Mcky Posted June 12, 2007 Author Posted June 12, 2007 Siao. Thanks!!!!!!! It worked. 5 stars for you! My website: (Lots of AutoIt compiled programs+GameMaker games)http://mcky.sitesled.comMy AutoIt projects:Mcky's CalEntry - Calendar schedulingMcky's Web Extractor - Web page links extractorMcky's Appkey- Powerful Hotkey-listing tool[quote]I wish I was never born. I am just a lonely soul in this world... :([/quote]
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