Jump to content
Sign in to follow this  
Mcky

Help. Slow update in GUI after disabling.

Recommended Posts

Mcky

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]

Share this post


Link to post
Share on other sites
Siao

Anyone, please help?

Use GUICtrlSetState($nMsg, $GUI_FOCUS) instead of WinActivate($frm_cgkey) Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites
SmOke_N

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

Anyone, 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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×