Jump to content

Monolog Modeless Transparent Message Box Auto Fade Out - any UDFs?


Go to solution Solved by FireFox,

Recommended Posts

Does anyone know of any existing pieces of code or UDFs that could achieve the following without me having to rewrite this from scratch? I'm looking for a way to display transparent overlay messages on the screen that would automatically fade out after 5 seconds or after any keyboard-mouse activity. Further, it would be nice if I could click on a tray and see a window with a log of all previously displayed messages (in case I was away from the computer and want to check if any messages popped up which I might have missed).

 

The design and user interface experience comes from:

http://www.azarask.in/blog/post/monolog_boxes_and_transparent_messages/

http://humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages/

 

 

It’s simply a large and translucent message that’s displayed over the contents of your screen. They fade away when the user takes any action (like typing or moving the mouse). In practice, the message is both noticeable yet unobtrusive. And because the message is transparent, you can see what’s beneath...

 

60236944.gif

Edited by robertcollier4
Link to comment
Share on other sites

  • Moderators

robertcollier4,

While FireFox is busy, have you seen my Notify UDF? Although not exactly what you are looking for it might be suitable with a bit of modification - and I am also feeling friendly and ready to do it! ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Solution

Here you go :

 

#include <WindowsConstants.au3>
#include <StaticConstants.au3>

#region GUI
Global $hGUI_Main = GUICreate("")

Global $hGUI_Child = GUICreate("MyGUI", 400, 70, -1, -1, $WS_POPUP, $WS_EX_TOPMOST, $hGUI_Main)
GUISetBkColor(0x000000, $hGUI_Child)

Local $iMyLabel = GUICtrlCreateLabel("Good news Dave, I can do that.", 0, 0, 400, 70, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetColor($iMyLabel, 0xFFFFFF)
GUICtrlSetFont($iMyLabel, 17)

_GuiRoundCorners($hGUI_Child, 0, 0, 7, 7)

WinSetTrans($hGUI_Child, "", 0)
GUISetState(@SW_SHOW, $hGUI_Child)
#endregion

For $i = 0 To 150 Step 8
    WinSetTrans($hGUI_Child, "", $i)
    Sleep(10)
Next

AdlibRegister("_Exit", 5000)

While 1
    Sleep(1000)
WEnd

Func _GuiRoundCorners($hWnd, $iLeftRect, $iTopRect, $iWidthEllipse, $iHeightEllipse)
    Local $aPos = 0, $aRet = 0

    $aPos = WinGetPos($hWnd)

    $aRet = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $iLeftRect, "long", $iTopRect, "long", $aPos[2], "long", $aPos[3], "long", $iWidthEllipse, "long", $iHeightEllipse)
    If Not @error And $aRet[0] Then
        $aRet = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $aRet[0], "int", 1)
        If Not @error And $aRet[0] Then Return 1
    EndIf

    Return 0
EndFunc   ;==>_GuiRoundCorners

Func _Exit()
    AdlibUnRegister("_Exit")

    For $i = 150 To 0 Step -4
        WinSetTrans($hGUI_Child, "", $i)
        Sleep(10)
    Next

    GUIDelete($hGUI_Main)

    Exit
EndFunc
Edit: Added indents.

Note: Don't forget to take a look at Melba's UDF, you should find some good inspirations ;)

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Fantastic, thanks guys!!

Melba's UDF seems exactly the kind of thing I was looking for except that it does not allow for a transparent background, the notification seems to have a small border around the edge, and the notification box cannot be rounded.

With Firefox's code, it looks exactly the way I wanted (and as described in Aza Raskin's article). Thanks!

Edited by robertcollier4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...