Jump to content

IniRead array and pass to download function with progress bar


KamikazeXeX
 Share

Recommended Posts

Hiya guys, so i'm trying to work out how to get a downloader function working in a tool i'm working on, basically theres a tab with 3 download buttons, based on what button is clicked in the tab i'd like it to pass to one function, the downloder that will read the links from the ini file, with a progress bar in the tab I'll post the code bellow so you'll get an understanding

so ideally, i want to download them using one function to the @ScriptDir & "Downloads" folder, but display the download progress in the main window (or a popout window that has a okay prompt before closing if thats easier)

Downloads Tab

Func _download_gui()
    $downgui = GUICreate("Downloads", 1270, 610, 5, 105, BitOR($ws_popup, $ws_border), $ws_ex_mdichild, $maingui)
    GUISetBkColor(3487029)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $setgui, "int", 250, "long", 524288)
    $downlabel1 = GUICtrlCreateLabel("Download" & @CRLF & "DownloadName", 50, 50, 350, 100, $ss_center)
    GUICtrlSetFont(-1, 30, 700, 0, "Segeo UI", 4)
    GUICtrlSetBkColor(-1, 3825)
    GUICtrlSetColor(-1, 16777215)
    _guictrl_setonhover(-1, "_Hover", "_Hover_Leave")
    $downlabel2 = GUICtrlCreateLabel("Download" & @CRLF & "DownloadName", 450, 50, 350, 100, $ss_center)
    GUICtrlSetFont(-1, 30, 700, 0, "Segeo UI", 4)
    GUICtrlSetBkColor(-1, 3825)
    GUICtrlSetColor(-1, 16777215)
    _guictrl_setonhover(-1, "_Hover", "_Hover_Leave")
    $downlabel3 = GUICtrlCreateLabel("Download" & @CRLF & "DownloadName", 850, 50, 350, 100, $ss_center)
    GUICtrlSetFont(-1, 30, 700, 0, "Segeo UI", 4)
    GUICtrlSetBkColor(-1, 3825)
    GUICtrlSetColor(-1, 16777215)
    _guictrl_setonhover(-1, "_Hover", "_Hover_Leave")
    $downgr2 = GUICtrlCreateGraphic(0, 25, 1270, 250)
    GUICtrlSetState(-1, $gui_disable)
    GUICtrlSetGraphic(-1, $gui_gr_color, 0, 2368548)
    GUICtrlSetGraphic(-1, $gui_gr_rect, 0, 0, 1270, 250)
    GUISetState(@SW_SHOW, $downgui)
EndFunc

While Switch Case

Case $downgui
    Switch $nmsg[0]
        Case $downlabel1
            _download()
        Case $downlabel2
            _download()
        Case $downlabel3
            _download()
    EndSwitch

Download Array

Func _download()
Local $downarrayread[3] = [IniRead(@ScriptDir & "\Files\data\Config.cfg", "links", "link_1", Default), IniRead(@ScriptDir & "\Files\data\Config.cfg", "links", "link_2", Default), IniRead(@ScriptDir & "\Files\data\Config.cfg", "links", "link_3", Default)]
EndFunc

INI

[links]
link_1=
link_2=
link_3=

Have I gone about this the right way to start with? Or am I do something wrong? All help appreciated

Link to comment
Share on other sites

  • Moderators

You were warned to lay off the topic, and changing things in the script does not change the reason why you want something to be done.

If you decide to say f**k it again, and post on the subject anyway, you'll take a permanent vacation.

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.

Link to comment
Share on other sites

  • Developers

Assume the point is pretty clear now or else indeed a three-strike will come into play.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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