Madza91 Posted January 2, 2008 Share Posted January 2, 2008 Why script stops when drag that window? here is example - when drag windows the $label_1-time is not true #include <GuiConstants.au3> #include <Date.au3> GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_1 = GuiCtrlCreateLabel(_NowTime(), 120, 100, 180, 70) GuiSetState() AdlibEnable("now", 1000) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Func now() GUICtrlSetData($Label_1,_NowTime()) EndFunc [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
crzftx Posted January 2, 2008 Share Posted January 2, 2008 that's quite normal. Even programs like Firefox do that. Link to comment Share on other sites More sharing options...
Madza91 Posted January 2, 2008 Author Share Posted January 2, 2008 Not in every prog, like in some installation programs like NSIS ... #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Progress_1 = GuiCtrlCreateProgress(40, 120, 320, 20) GuiSetState() For $i = 10 to 100 Step 1 GUICtrlSetData($Progress_1,$i) Sleep(100) Next While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
crzftx Posted January 2, 2008 Share Posted January 2, 2008 that 2nd example stopped on drag&drop, was there supposed to be a difference? and you are right. i don't know if most windows halt on movement, or if only a few do. Link to comment Share on other sites More sharing options...
crzftx Posted January 2, 2008 Share Posted January 2, 2008 (edited) I thought it might have something to do with not being able to update when the window moves, so the program paused until the window stopped moving when it got to a function that required it to update a moving window, but the pause effect occurred even when no window updates are occuringGUICreate("Window test",200,200) GUISetState() For $z = 0 To 2000000 If Mod($z,100000) = 0 Then ConsoleWrite($z & @CRLF) Nextmaybe it pauses just in case it finds a window updatebut theres a good chance i have no idea what im talking about whatsoever Edited January 2, 2008 by crzftx Link to comment Share on other sites More sharing options...
rasim Posted January 2, 2008 Share Posted January 2, 2008 (edited) Not in every prog, like in some installation programs like NSIS ... #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Progress_1 = GuiCtrlCreateProgress(40, 120, 320, 20) GuiSetState() For $i = 10 to 100 Step 1 GUICtrlSetData($Progress_1,$i) Sleep(100) Next While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Hello! Example from this forum: expandcollapse popup#include <GuiConstants.au3> ;Global Const $WM_TIMER = 0x0113 ;For old autoit version uncomment this string Dim $progress = 0 $hGui = GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $StartBtn = GUICtrlCreateButton("Start", 20, 250, 50, 25) $StopBtn = GUICtrlCreateButton("Stop", 320, 250, 50, 25) $Progress_1 = GuiCtrlCreateProgress(40, 120, 320, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE TimerDisable($hGui) ExitLoop Case $msg = $StartBtn TimerEnable("Progress", $hGui, 100) Case $msg = $StopBtn TimerDisable($hGui) EndSelect WEnd Func TimerEnable($sFunction, $hWnd, $sTime = 100) GUIRegisterMsg($WM_TIMER, $sFunction) DllCall("User32.dll", "int", "SetTimer", "hwnd", $hWnd, "int", 50, "int", $sTime, "int", 0) EndFunc Func TimerDisable($hWnd) GUIRegisterMsg($WM_TIMER, "") DllCall("user32.dll", "int", "KillTimer", "hwnd", $hWnd, "int*", 50) EndFunc Func Progress() $progress += 1 If $progress >= 100 Then $progress = 0 GUICtrlSetData($Progress_1, $progress) EndFunc Edited January 2, 2008 by rasim 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