Madza91 Posted April 11, 2008 Posted April 11, 2008 (edited) Hi, i maded this bugged example script and i want to fix it but i don't know how, when draging GUI called func stops... i don't know why... Is possible to fix this or to made on another way ? :S expandcollapse popup#include <GuiConstants.au3> #include <GUIListBox.au3> Dim $progress = 0 Dim $1 = 0 $inifile = @DesktopDir & "\ex.ini" $guiname = "Example" $hGui = GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $List1 = GUICtrlCreateList("", 16, 16, 201, 240) $StartBtn = GUICtrlCreateButton("Start", 20, 250, 50, 25) $StopBtn = GUICtrlCreateButton("Stop", 320, 250, 50, 25) $Progress_1 = GuiCtrlCreateProgress(40, 120, 320, 20) $label = GUICtrlCreateLabel("? %",300,300,100,20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE TimerDisable($hGui) ExitLoop Case $msg = $StartBtn TimerEnable("_IniGetSectionNames", $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 _IniGetSectionNames() $varx = IniReadSectionNames($inifile) If @error Then TrayTip($guiname, "You don't have added any entries!" &@CRLF& "Click the ""Add"" button for new entry", 5, 1) Else For $x = 1 To $varx[0] $var = IniReadSection($inifile, $varx[$x]) If @error Then TrayTip($guiname, "Your account file list is corrupted!", 5, 3) Else _GUICtrlListBox_AddString($List1, $varx[$x]) Sleep(500) EndIf Next EndIf ;TimerDisable($hGui) EndFunc ;==>_IniGetSectionNamesƒoÝŠ÷ ØLbž&®¶ˆse¶6EЦÖ6@¥¶6FEЦÖ76@¥¶6FEЦÖ6@¥·66EЦÖ6@¥¶FF6EЦÖ6@¥¶66FEЦÖ6 Edited April 11, 2008 by n3nE [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) :)
Swift Posted April 11, 2008 Posted April 11, 2008 (edited) In AutoIt standard, if you drag a window, it will stop any parsing. I have a example script somewhere that shows how to continue script when dragged. I'll look for it. EDIT: Can't find it! Ahh! Edited April 11, 2008 by Swift
Madza91 Posted April 11, 2008 Author Posted April 11, 2008 Man, add this func in my example: Func Progress() $progress += 1 If $progress >= 100 Then $progress = 0 GUICtrlSetData($Progress_1, $progress) EndFunc And change in line 27 "_IniGetSectionNames" in "progress" and you will see to work for that func when drag window....but for IniGetSectionNames not :S [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) :)
AdmiralAlkex Posted April 11, 2008 Posted April 11, 2008 In AutoIt standard, if you drag a window, it will stop any parsing. I have a example script somewhere that shows how to continue script when dragged. I'll look for it.EDIT: Can't find it! Ahh!You probably meant MsCreatoR's "Gui Drag Without pause the script" .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
rasim Posted April 12, 2008 Posted April 12, 2008 n3nEMayb so:expandcollapse popup#include <GuiConstants.au3> #include <GUIListBox.au3> Dim $progress = 0 Global $count = 0 $inifile = @DesktopDir & "\ex.ini" $guiname = "Example" $hGui = GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $List1 = GUICtrlCreateList("", 16, 16, 360, 160) $StartBtn = GUICtrlCreateButton("Start", 20, 250, 50, 25) $StopBtn = GUICtrlCreateButton("Stop", 320, 250, 50, 25) $Progress_1 = GuiCtrlCreateProgress(40, 200, 320, 20) $label = GUICtrlCreateLabel("? %",300,300,100,20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE TimerDisable($hGui) ExitLoop Case $msg = $StartBtn TimerEnable("_IniGetSectionNames", $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 _IniGetSectionNames() $count += 1 If $count > 100 Then $count = 0 TimerDisable($hGui) EndIf GUICtrlSetData($Progress_1, $count) _GUICtrlListBox_AddString($List1, StringFormat("%03d : Item ", $count)) EndFunc
Madza91 Posted April 12, 2008 Author Posted April 12, 2008 Thank you for example, i maded it [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) :)
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