Jump to content
Sign in to follow this  

Sliding Notification Not Working in XP Classic

Recommended Posts


I'm using this code:

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

; hotkey pause function
HotKeySet("!p", "pause")

Global $Paused ;Default is unpaused (0=off 1=on)
Global $Paused = 0 ; Default is unpaused (0=off 1=on)
Local $GUIToaster, $text1 = "the"
Local $GUIToaster, $text2 = "slider"
Local $Pos, $i

While 1

; hotkey pause function
Func pause()
    Opt("WinTitleMatchMode", 4)
    $Paused = Not $Paused ;changes $Paused from 0 to 1 or from 1 to 0
    If $Paused And Not WinExists("slider", "") Then
        While $Paused ; while $Paused = 1
            Sleep(10); idle around (pause)
        For $i = 100 To 1 Step -1
            WinSetTrans($GUIToaster, "", $i * 1.5)
            WinMove("slider", "", $Pos[2] - $i, $Pos[3] - 30)
            Sleep(0) ; fast slide-out to right

EndFunc   ;==>TogglePause

Func _HorzToaster() ; incorporating code from Danny35d
    Opt("WinTitleMatchMode", 4)
    $Pos = WinGetPos("classname=Shell_TrayWnd")
    If $Pos[2] <> @DesktopWidth Then $Pos[2] = @DesktopWidth - $Pos[2]
    If $Pos[3] <> @DesktopHeight Then
        $Pos[3] = @DesktopHeight - ($Pos[3] + 11)
        $Pos[3] -= 32
    $GUIToaster = GUICreate("slider", 100, 40, $Pos[2] - 100, $Pos[3], _
    GUISetBkColor(0xFFFFFF, $GUIToaster)
    $label1 = GUICtrlCreateLabel($text1, 0, 0, 100, 15, $SS_CENTER)
    GUICtrlSetFont(-1, 11, 800, 1, "Arial")
    GUICtrlSetColor($label1, 0x000000)
    $label2 = GUICtrlCreateLabel($text2, 0, 17, 100, 30, $SS_CENTER)
    GUICtrlSetFont(-1, 11, 800, 1, "Arial")
    GUICtrlSetColor($label2, 0x000000)
    WinSetTrans($GUIToaster, "", 0)
    GUISetState(@SW_SHOW, $GUIToaster)
    For $i = 1 To 100
        WinSetTrans($GUIToaster, "", 1.5 * $i)
        WinMove("slider", "", $Pos[2] - $i, $Pos[3] - 30)
        Sleep(0) ; fast slide-in from right
EndFunc   ;==>_HorzToaster

It works great on the default theme of Windows XP whereby when you press 'Alt+p', a notification slides-in above the system tray(clock). But on the Classic theme, I can only see a quick flash on the left bottom side of my screen. Can anyone help me see what the problem is? Thank you.

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.