DownloadFile(UrlToFile, SaveFileAs, Overwrite :=True, UseProgressBar :=True){;Check if the file already exists and if we must not overwrite itIf(!Overwrite &&FileExist(SaveFileAs))Return;Check if the user wants a progressbarIf(UseProgressBar){;Initialize the WinHttpRequest Object WebRequest :=ComObjCreate("WinHttp.WinHttpRequest.5.1");Download the headers WebRequest.Open("HEAD", UrlToFile) WebRequest.Send();Store the header which holds the file size in a variable: FinalSize := WebRequest.GetResponseHeader("Content-Length");Create the progressbar and the timerProgress, H80,, Downloading...,%UrlToFile% circleObj := CreateCircleProgress(450,60)SetTimer, __UpdateProgressBar,100};Download the fileUrlDownloadToFile,%UrlToFile%,%SaveFileAs%;Remove the timer and the progressbar because the download has finishedIf(UseProgressBar){Progress, OffSetTimer, __UpdateProgressBar, Off DestroyCircleProgress(circleObj)}Return

hbm := CreateDIBSection(this.W,this.W), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm) pPen:=Gdip_CreatePen("0x"this.BarColor,this.BarThickness)if(pPen =0){; GDI+ is not started up - start it up now and shut it down in __Delete() automatically. pToken := Gdip_Startup() pPen:=Gdip_CreatePen("0x"this.BarColor,this.BarThickness); call it again (with GDI+ started up now)} G := Gdip_GraphicsFromHDC(hdc), Gdip_SetSmoothingMode(G,4)

hbm := CreateDIBSection(this.W,this.W), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm) pPen:=Gdip_CreatePen("0x"this.BarColor,this.BarThickness)if(pPen =0){; GDI+ is not started up - start it up now and shut it down in __Delete() automatically pToken := Gdip_Startup() pPen:=Gdip_CreatePen("0x"this.BarColor,this.BarThickness); call it again (with GDI+ started up now)} G := Gdip_GraphicsFromHDC(hdc), Gdip_SetSmoothingMode(G,4)

This line causes an error of Call to nonexistent function:hbm := CreateDIBSection(this.W, this.W), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm)It does not seem like this line should occur before a pToken := Gdip_Startup().

Works fine if I forgo the auto detect and insert a pToken := Gdip_Startup().

I'm glad you like it guys Nice example fischgeek!Ferry, yes, you need Gdip_All.ahk, as FanaticGuru said.FanaticGuru, I don't get such errors...Bruttosozialprodukt, it seems I hijacked your thread I'm sorry do you want me to stop posting?

In v1.03 (see updated second post of this thread) I added option to disable click through style, and did some minor drawing modifications...

@Learning one - That's awesome. I like that you changed the click-through style - though, I did like that I can click through it. I made some mods to my clock and it stays in the bottom left, but still allows me to click through. Also, thanks for the class implementation. Nice work!

I do have a couple questions though about the capability if anyone can answer them...

1) Is there a physical window for this that would make it move-able? Usually in Gui's I do +ToolWindow -Caption and add a gLabel to a control with PostMessage, 0xA1, 2,,, A so that I can drag it around with a left click and drag. It would be nice to be able to do that with this. I'm assuming without wrapping this in some kind of gui it's not possible.

2) I cannot for the life of me figure out the color code is it hex with a transparency attached to it? What's the format here?

My mind is going crazy with all the possibilities and ideas I have planned for this.

@Bruttosozialprodukt: lol As joedf suggested, I would like to put the following text in CircleProgressClass comments: "Credits: Bruttosozialprodukt, Learning one. This code is public domain." Is that OK with you?

Learning one wrote:As joedf suggested, I would like to put the following text in CircleProgressClass comments: "Credits: Bruttosozialprodukt, Learning one. This code is public domain." Is that OK with you?