Jump to content

The returning: Indetermined progress bar to move when filecopying


korsg
 Share

Recommended Posts

Hello,

First time i use this forum so wish me luck :wacko:

Well i have a script which copies a file over the network, its triggered by an button. I want an indetermined progress bar to move when the copying is progressing. But i an only get the bar to progress when the copying has finished :D

Heres my script:

#include <GUIConstants.au3>

Global Const $PBS_MARQUEE = 0x08
Global Const $WM_USER = 0x0400
Global Const $PBM_SETMARQUEE = ($WM_USER+10)

Global $status = 1

Opt("GUIOnEventMode", 1)

$GUI = GUICreate("Marquee Progress Bar", 400, 400)
GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_CLOSE")


$salgsstatistik1 = GUICtrlCreateButton ("Hent nyeste Salgsstatisik",  10, 50, 170)
GUICtrlSetOnEvent(-1, "salgsstatistik1")

GUISetState()

While 1 
    Sleep(100)
WEnd

Func salgsstatistik1()
    
$GUI_Progress = GUICtrlCreateProgress(50, 200, 100, 20, $PBS_MARQUEE); progress bar setup
    
GUICtrlSendMsg($GUI_Progress, $PBM_SETMARQUEE, 1, 200); Starts progress bar
       
$salgcopy = FileCopy('K:\Sælgere\Salgsstatistik.zip', 'c:\',1); Copies file


if $salgcopy = 1 then; Makes a small msgbox after the files has been downloadet. 
    $status = 0; turns off progress bar
    MsgBox(4096, "Succes", "download succes")
EndIf

EndFunc

Func GUI_CLOSE()
    Exit
EndFunc

What am i doing wrong?

Link to comment
Share on other sites

Hmm, doesnt quite cut it... need something that only copies files...

Cant figure it out, been searching the forums for ages, there must be something that can get my script working, or am i totally wrong ?

Edited by korsg
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...