Consulting

Results 1 to 8 of 8

Thread: Solved: Kudos to Mvidas - IE Progress Bar questions

  1. #1
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location

    Solved: Kudos to Mvidas - IE Progress Bar questions

    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:

    [vba]
    '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>"

    [/vba]

    Stan

  2. #2
    Knowledge Base Approver
    The King of Overkill!
    VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    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!

  3. #3
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Quote Originally Posted by mvidas
    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

  4. #4
    Knowledge Base Approver
    The King of Overkill! VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    Quote Originally Posted by stanl
    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:[vba]' "<DIV id='vBar' ALIGN='Left'></DIV>" & vbLf & _
    "<DIV id='vBar' ALIGN='Center'></DIV>" & vbLf & _[/vba]

    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:[vba]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 Long[/vba]and in the StartIE function, include this line underneath .Visible = True:[vba] .Visible = True
    SetWindowPos .hWnd, -1, 0, 0, 0, 0, 3[/vba]That 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!

  5. #5
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    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

  6. #6
    Knowledge Base Approver
    The King of Overkill! VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    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:[vba]Private Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As Long[/vba]And change the .left and .top in the StartIE function to:[vba] .Left = CLng(Trim(GetSystemMetrics(0))) / 2 - Int(.Width / 2)
    .Top = CLng(Trim(GetSystemMetrics(1))) / 2 - Int(.Height / 2)[/vba]That should take care of it!

  7. #7
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    It sure did! Thank you!

  8. #8
    Knowledge Base Approver
    The King of Overkill! VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •