File_Extract(_File, _DestDir = "", _SourceDir = "") { global 7zip, DownloadsDir If Not _SourceDir and Not FileExist(_File) _SourceDir := DownloadsDir If _SourceDir _File := _SourceDir . "\" . _File FileCreateDir, %_DestDir% RunWait, %7zip% x %_File% -aos, %_DestDir%, Hide return true } File_Download(url, save, msg = 0x1100, sleep = 250) { iconId := TrayIcon_Set("Downloading", "Downloading " . save . "...") total := HttpQueryInfo(url, 5) SetTimer, _dlprocess, %sleep% UrlDownloadToFile, %url%, %save% Sleep,% sleep * 4 SetTimer, _dlprocess, Off TrayIcon_Unset(iconId) Return FileExist(save) _dlprocess: FileGetSize, current, %save%, K Process, Exist PostMessage, msg, current * 1024, total,, ahk_pid %ErrorLevel% Return } File_Download_SetCounter(wParam, lParam) { progress := Round(wParam / lParam * 100) wParam //= 1024 lParam //= 1024 Progress, %progress%,, Downloading %wParam%kb of %lParam%kb..., %progress%`% - Downloading... }