Monday, August 20, 2007

QM Quickling: OnScreenDisplay

OnScreenDisplay("Opening FireFox" -1 0 0 "Arial Black" 30 0xff 4 "FF_Start" 0x343434 )


So, this one has been floating around in the forums for a while and I thought I'd give my slants on it.


When I'm starting a program or a process that might take more than 1 second, I like to give a visual confirmation that it actually did start. For instance:





So, here's how the parameters break out:

  1. your text. you can also use a string variable instead. OnScreenDisplay(strText)
  2. the time the display stay on screen. the default is 0 (5 seconds) or -1 for indefinite.
  3. the X Y coordinates of where to put the top left corner of the box. 0 0 is the middle of the screen.
  4. the font name (mine is "Arial Black"). I get mine from the font drop-down list in Word.
  5. font size (mine is 30).
  6. font colour in hex. I use Pixie but you can try http://www.free-webmaster-tools.com/colorpicker.htm to do it online but I don't know how safe the site is.
  7. flags. Note: you can add the numbers together to have it activate more than one state (i.e. 6 is number 2 and number 4).
    • 1 - nontransparent. The background in transparent or not (not supported on Win98/Me).
    • 2 - synchronous. The macro pauses till the text disappears (see #2 above).
    • 4 - the user can click to hide the window.
  8. you can create an easy handle for the display window. For example, clo win("FF_Start")
  9. background colour in hex
  10. wrapwidth. this will create a multi-line display box with this number as the width (I didn't use it here); very handy for string variable texts.

Here is another format I use for a differ process.
OnScreenDisplay("Removing Dups...please wait" 0 0 0 "" 18 292929 4 "Rmv_Dps")

Ok, so now you have 5 days to put this into your code or I will mail you macros back to you in a box....one function at a time.

No comments: