stuka Posted September 21, 2007 Share Posted September 21, 2007 (edited) . Edited August 23, 2009 by stuka Link to comment Share on other sites More sharing options...
rover Posted September 21, 2007 Share Posted September 21, 2007 Hi JacKit look at this posted code example by Paulie Transparent and click through tray popup message hope the code i posted worked out enjoy. I see fascists... Link to comment Share on other sites More sharing options...
rover Posted September 21, 2007 Share Posted September 21, 2007 see also Notify Window, a nice way to notify events Toast, GUITray got me thinking... I see fascists... Link to comment Share on other sites More sharing options...
rover Posted September 21, 2007 Share Posted September 21, 2007 (edited) not the best 'popup' window code on the forum, but it's simple, smooth and it worksfades in as it slides in from rightslides and fades back to right on closingsemi-transparent and click throughablecompensates for taskbar height.Edit: added variables for width and heightexpandcollapse popup#include <GUIConstants.au3> Opt("WinTitleMatchMode", 4) HotKeySet ("{PAUSE}", "TogglePause") Global $Paused = 0 ; Default is unpaused (0=off 1=on) Local $GUIToaster, $text1 = "Tool Status" Local $GUIToaster, $text2 = "Scan Paused" Local $Pos, $i Local $GuiW = 100 , $GuiH = 35 ; GuiCreate Width & Height While 1 ; Main Message Loop $msg = GUIGetMsg() If $msg = -3 Then Exit WEnd Func TogglePause() ; hotkey pause function $Paused = NOT $Paused ;changes $Paused from 0 to 1 or from 1 to 0 If $paused And Not WinExists("Tray Popup","") Then _HorzToaster() While $Paused ; while $Paused = 1 Sleep(10); idle around (pause) WEnd For $i = 100 to 1 Step -1 WinSetTrans($GUIToaster, "", $i*1.5) WinMove("Tray Popup","", $Pos[2]-$i, $Pos[3]) Sleep(0) ; fast slide-out to right Next GUIDelete($GUIToaster) EndIf EndFunc ; TogglePause Func _HorzToaster() ; incorporating code from Danny35d $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] + $GuiH) Else $Pos[3] -= $GuiH EndIf $GUIToaster = GUICreate ("Tray Popup", $GuiW, $GuiH, $Pos[2]-100, $Pos[3], _ $WS_POPUP, BitOR ($WS_EX_TRANSPARENT, $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0xFFFF00, $GUIToaster) $label1 = GUICtrlCreateLabel($text1, 0, 0, 100, 15,$SS_CENTER) GUICtrlSetFont(-1,11,800,1,"Arial") $label2 = GUICtrlCreateLabel($text2, 0, 17, 100, 30,$SS_CENTER) GUICtrlSetFont(-1,11,800,1,"Arial") GUICtrlSetColor($label2, 0xFF0000) WinSetTrans($GUIToaster, "", 0) Sleep(20) GUISetState(@SW_SHOW,$GUIToaster) For $i = 1 to 100 WinSetTrans($GUIToaster, "", 1.5*$i) WinMove("Tray Popup","", $Pos[2]-$i, $Pos[3]) Sleep(1) ; slow slide-in from right Next EndFunc Edited September 22, 2007 by rover I see fascists... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now