Jump to content
Sign in to follow this  
Crash

Pop ups above taskbar near the clock

Recommended Posts

Crash

What is the script to make a tiny square pop up above the taskbar near the clock. I mean just like when someone signs in Windows Live Messenger, you'll get a pop up as in the picture below:post-53187-12637309732096_thumb.gif


JPGRARMouse Lock | My website | Thanks so much for your help! ❤️

Share this post


Link to post
Share on other sites
Mat

A GUI. You can get the position by using

WinGetPos("[class:Shell_TrayWnd]")

And then get the side something like this:

Func _TaskBarGetSide ()
   Local $aPos = WinGetPos("[class:Shell_TrayWnd]")
   If $aPos[0] < 10 Then
      If $aPos[2] > 200 Then Return "Left"
      Return "Top"
   EndIf
   If $aPos[3] > 200 Then Return "Right"
   Return "Bottom"
EndFunc ; ==> _TaskBarGetSide

No idea how well it works (if at all), I wrote it quite a while ago as part of this UDF. As for the GUI, you will need to then mess around with styles and background images, and where you want to put it.

Share this post


Link to post
Share on other sites
Melba23

Crash,

Here is one I wrote a while ago: :D

#include <WindowsConstants.au3>
#Include <WinAPI.au3>

; Create Toast window
Global $hGUI = GUICreate("", 200, 100, @DesktopWidth - 210, @DesktopHeight - 130, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
Global $hLabel = GUICtrlCreateLabel("Click to close", 1, 1, 198, 198)

; Slide in Toast - but keep focus on current window
_WinAnimate($hGUI, 0x00040008)
$hCurrWnd = _WinAPI_GetForegroundWindow()
GUISetState(@SW_SHOW, $hGUI)
WinActivate($hCurrWnd, "")

; Wait for click from Toast
While 1

    Local $aMsg = GUIGetMsg(1)

    If $aMsg[1] = $hGUI And $aMsg[0] = $hLabel Then ExitLoop

WEnd

; Slide out window
_WinAnimate($hGUI, 0x00050004)

Exit

; --------------

; Gary Frost's WinAnimate function

Func _WinAnimate($h_gui, $i_mode, $i_duration = 1000)

    If @OSVersion = "WIN_XP" OR @OSVersion = "WIN_2000" Or @OSVersion = "WIN_VISTA" Then

        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $h_gui, "int", $i_duration, "long", $i_mode)

        Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError')
        If $ai_gle[0] <> 0 Then
            Return SetError(1, 0, 0)
        EndIf
        Return 1

    Else

        Return SetError(2, 0, 0)

    EndIf
EndFunc;==> _WinAnimate()

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Mat

Here is one I wrote a while ago: :D

Nice :huggles: Now you just need to find out where the taskbar is rather than assuming that its at the bottom...

Share this post


Link to post
Share on other sites
Melba23

Mat,

Do you want to see the full UDF? :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Mat

$hGUI = _TrayPopup_Create(300, 100)
GUISetBkColor(0xFF00FF)
GUICtrlCreateLabel("Testing testing 123!!", 2, 2, 296, 96)
GUICtrlSetFont(-1, 28, 700)

_TrayPopup_SlideIn($hGUI)
GUISetState()

Sleep(1000)

_TrayPopup_SlideOut($hGUI)

Func _TrayPopup_Create($nWidth, $nHeight, $nOffset = 4)
    Local $aPos = WinGetPos("[class:Shell_TrayWnd]"), $y, $x
    Switch _TaskBarGetSide()
        Case "Bottom"
            $y = $aPos[1] - $nHeight - $nOffset
            $x = @DesktopWidth - $nWidth - $nOffset
        Case "Left"
            $y = @DesktopHeight - $nHeight - $nOffset
            $x = $aPos[2] + $nOffset
        Case "Top"
            $y = $aPos[3] + $nOffset
            $x = @DesktopWidth - $nWidth - $nOffset
        Case "Right"
            $y = @DesktopHeight - $nHeight - $nOffset
            $x = $aPos[0] - $nWidth - $nOffset
    EndSwitch
    ConsoleWrite($x & ", " & $y & @CRLF & _TaskBarGetSide() & @CRLF)
    Return GUICreate("TrayPopupWnd", $nWidth, $nHeight, $x, $y, -2147483648, 136)
EndFunc   ;==>_TrayPopup_Create

Func _TaskBarGetSide()
    Local $aPos = WinGetPos("[class:Shell_TrayWnd]")
    If $aPos[0] < 10 Then
        If $aPos[2] > 200 Then Return "Bottom"
        Return "Right"
    EndIf
    If $aPos[3] > 200 Then Return "Left"
    Return "Top"
EndFunc   ;==>_TaskBarGetSide

; Gary Frost's WinAnimate function
; 0x00040001 ; slide in from left
; 0x00050002 ; slide out to left
; 0x00040002 ; slide in from right
; 0x00050001 ; slide out to right
; 0x00040004 ; slide-in from top
; 0x00050008 ; slide-out to top
; 0x00040008 ; slide-in from bottom
; 0x00050004 ; slide-out to bottom

Func _TrayPopup_SlideIn($h_gui, $i_duration = 1000)
    Local $i_mode
    Switch _TaskBarGetSide()
        Case "Bottom"
            $i_mode = 0x00040008
        Case "Left"
            $i_mode = 0x00040001
        Case "Top"
            $i_mode = 0x00040004
        Case "Right"
            $i_mode = 0x00040002
    EndSwitch
    If @OSVersion = "WIN_XP" Or @OSVersion = "WIN_2000" Or @OSVersion = "WIN_VISTA" Then
        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $h_gui, "int", $i_duration, "long", $i_mode)

        Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError')
        If $ai_gle[0] <> 0 Then
            Return SetError(1, 0, 0)
        EndIf
        Return 1
    Else
        Return SetError(2, 0, 0)
    EndIf
EndFunc   ;==>_TrayPopup_SlideIn

Func _TrayPopup_SlideOut($h_gui, $i_duration = 1000)
    Local $i_mode
    Switch _TaskBarGetSide()
        Case "Bottom"
            $i_mode = 0x00050004
        Case "Left"
            $i_mode = 0x00050002
        Case "Top"
            $i_mode = 0x00050008
        Case "Right"
            $i_mode = 0x00050001
    EndSwitch
    If @OSVersion = "WIN_XP" Or @OSVersion = "WIN_2000" Or @OSVersion = "WIN_VISTA" Then
        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $h_gui, "int", $i_duration, "long", $i_mode)

        Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError')
        If $ai_gle[0] <> 0 Then
            Return SetError(1, 0, 0)
        EndIf
        Return 1
    Else
        Return SetError(2, 0, 0)
    EndIf
EndFunc   ;==>_TrayPopup_SlideOut

:D

Share this post


Link to post
Share on other sites
Melba23

Mat,

Pretty snazzy. Look in the Examples forum in a little while. :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.