PDA

View Full Version : Solved: Kudos to Mvidas - IE Progress Bar questions



stanl
10-23-2005, 10:18 AM
Don't know if this is the correct forum, but wanted to thank mvidas for posting the IE Progress Bar code. It is a very convenient tool. I did some experimenting and found that I could set background color with:


'use Writeln instead of innerHTML
.Document.Body.Writeln _
"<BODY bgcolor='#00FF00' SCROLL='NO'><CENTER><FONT FACE='arial black' SIZE=2>" & vbLf & _
"<DIV id='vHead' ALIGN='Left'></DIV>" & vbLf & _
"<DIV id='vBar' ALIGN='Left'></DIV>" & vbLf & _
"</FONT></CENTER></BODY>"



Stan

mvidas
10-24-2005, 09:03 AM
Glad to help, Stan! Any HTML code can be used to modify that, so there are many ways to change the appearance. I had made some other ways using div widths and window widths to allow the user to change the size of the window, but it did slow it down a little more so I decided to post it as is.

If you need any help customizing it a specific way and can't figure out how, let me know!

stanl
10-25-2005, 01:15 PM
Glad to help, Stan! If you need any help customizing it a specific way and can't figure out how, let me know!

Thank you for the offer. I managed a DLL call to remove the title. I would like 3 things (1) a way to include asciii 151 [solid block] as the meter character - I tried &#151 and got strange results (2) to center the meter (3) to create the window as 'always on top'

TIA- Stan

mvidas
10-26-2005, 09:23 AM
Thank you for the offer. I managed a DLL call to remove the title. I would like 3 things (1) a way to include asciii 151 [solid block] as the meter character - I tried &#151 and got strange results (2) to center the meter (3) to create the window as 'always on top'

Hi Stan,

1) Instead of using — (did you include the ; ?) you could also just trying using Chr(151), though when I used that I did not get a solid block but instead a double hyphen (could be my font). In my window's font, the "|" followed by "." looked the best, though it obviously depends on your system and your taste.

2) For the alignment, change the div alignment in the StartIE function:' "<DIV id='vBar' ALIGN='Left'></DIV>" & vbLf & _
"<DIV id='vBar' ALIGN='Center'></DIV>" & vbLf & _

3) Setting it 'always on top' is easily possible, though not in VBScript (that I know of at least).
If you're doing this in VBA/VB, you'll need an API call to "SetWindowPos" in 'user32'. Include the following at the top of your module:Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal _
hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Longand in the StartIE function, include this line underneath .Visible = True: .Visible = True
SetWindowPos .hWnd, -1, 0, 0, 0, 0, 3That is a great idea, btw, and I've included the 'always on top' functionality in my vba version. Now I just need to find a non-api way, I don't think it's possible but I've been proven wrong many times :)

Let me know if you need anything further!

stanl
10-26-2005, 01:31 PM
Thank you again. I think you are right that the character to control the progress bar may require a certain charset selection. Got the 'always on top' working. My 2nd question may not have been stated very well - I was looking at centering the progress window in the center of the screen. I had read somewhere that using -1 for top and left would center regardless of the screen resolution.

Stan

mvidas
10-26-2005, 01:43 PM
I had never heard the -1 thing, and after just trying it, I also could not get it to work.

However, if you add this API to the top of the module:Private Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As LongAnd change the .left and .top in the StartIE function to: .Left = CLng(Trim(GetSystemMetrics(0))) / 2 - Int(.Width / 2)
.Top = CLng(Trim(GetSystemMetrics(1))) / 2 - Int(.Height / 2)That should take care of it!

stanl
10-27-2005, 02:43 AM
It sure did! Thank you!

mvidas
10-27-2005, 10:23 AM
Let me know if you need any thing else!
Also, you can close this by going to Thread Tools at the top of the thread and choosing "Mark Thread Solved", though you can still add to it later if you need to.
Matt