Jump to content

script pauses when i try drag the gui


Recommended Posts

hello,

i have a countdownpart in my script like this:

$i = 10
while $i > 0
    $i -= 1
    sleep(1000)
wend

when i try to drag my gui with mousepointer to another position DURING active countdown,

countdown stops as long as mousekey is down and continues when i release mousekey.

is this a normal reaction from autiot? how can i prevent this?

thanks, andy (germany)

Link to comment
Share on other sites

hello,

i have a countdownpart in my script like this:

$i = 10
while $i > 0
 $i -= 1
 sleep(1000)
wend

when i try to drag my gui with mousepointer to another position DURING active countdown,

countdown stops as long as mousekey is down and continues when i release mousekey.

is this a normal reaction from autiot? how can i prevent this?

thanks, andy (germany)

This is normal behavior. Many windows programs written in other languages show this characteristic.

You need to use a timer, AdlibRegister won't work in this situation.

Something like this

#include <timers.au3>
Global $h = 1

$G1 = GUICreate("JKH",300,300)
$L0 = GUICtrlCreateLabeL("1000",50,50)
GUISetState()

_Timer_SetTimer($g1,500,"addup")

while 1
    sleep(200)
    if GUIGetMsg() = -3 then exit
WEnd


Func addup($a,$b,$c,$d)
    $h += 1
    GUICtrlSetData($L0,$h)
EndFunc
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

thank you, your example works fine. i fit it into my script.

NP.

I forgot to mention that the function called by the timer has to have parameters even if you don't use them, as my example, or the function won't work. See the help for what the parameters can be used for.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

NP.

I forgot to mention that the function called by the timer has to have parameters even if you don't use them, as my example, or the function won't work. See the help for what the parameters can be used for.

yes, i recognized that during some tests. i found this in the help:

Func _UpdateStatusBarClock($hWnd, $Msg, $iIDTimer, $dwTime)
    #forceref $hWnd, $Msg, $iIDTimer, $dwTime

but at the moment i dont use the parameters so i did it similair your example with just ($a, $b, $c, $d).

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...