Sign in to follow this  
Followers 0
Membrane

Help with my RSS Systray notification

8 posts in this topic

Through browsing the forums for the last couple of days I have managed to create a script that parses an xml feed and displays a popup "Toast" if a new item is added to the xml (Rss feed).

The only problem is, once a popup has been made, although the popup then disappears from view there is still a window for the popup showing in task manager -> applications; subsequently further notifications through the day (i.e additional popups), add extra windows in the task manager. It appears to have no real adverse effect but its a little niggle I would like to know how to resolve, and more importantly why it happened.

CODE
#include <GUIConstants.au3>

#include <Color.au3>

#include "rss-parser.au3"

Opt("GuiOnEventMode",1)

Dim $Label

Dim $move, $Xpos, $Ypos, $TrayWnd, $Xexit, $Yexit

Dim $iStartColor = 0x0000ff, $iEndColor = 0xffffff

Dim $iSize = -1, $iWeight = -1, $iAttribute = 4, $iFontName = -1

Dim $Clicked = 0

Dim $iWinWidth = 160, $iWinHeight = 160

Dim $ret

_SetPopupBackground(0x3399ff, 0xffffff) ;over-rides the colour defined in the dim above.

$UrltoParse = "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml"

;========== Test

$NewsTitle = _RSSGetInfo($UrltoParse, "<title>", "</title>", 1)

$LastCheckedNews = $NewsTitle[1] ;Sets the last checked flag to be the newest news item parsed from _RSSGetInfo

Call ("StartCheck")

Func StartCheck()

while 1

If $NewsTitle[1] = $LastCheckedNews Then ;Nothing has changed

Sleep(5000) ;Poll Interval

$NewsTitle = _RSSGetInfo($UrltoParse, "<title>", "</title>", 1) ; Get the current news feed again and restart

Call ("StartCheck")

Else

Sleep(5000)

$Ret = _Popup("MyPopup","NBS Announcment" & @crlf & " " & @crlf &$NewsTitle[1], 425000)

$NewsTitle = _RSSGetInfo($UrltoParse, "<title>", "</title>", 1)

$NewsUrl = _RSSGetInfo($UrltoParse, "<link>", "</link>", 1)

$LastCheckedNews = $NewsTitle[1]

if $Ret = 0 Then

$Result = "Time Out - Toast was not clicked in 12 hours, restarting poller"

ElseIf $Ret = -1 Then

$Result = "Exit was clicked"

Else

$Result = "Toast was clicked, lets open a browser!"

ShellExecute("iexplore", "h" & $NewsUrl[1])

EndIf

Call ("StartCheck")

EndIf

WEnd

EndFunc

Exit

;========= End Test

;===============================================================================

;

; Function Name: _SetPopupSize()

; Description: Set the size of the Popup Window

;

; Parameter(s): $WinWidth - Popup window width

; $WinHeight - Popup window height

;

; Requirement(s): None

; Return Value(s): None

;

; Author(s): GioVit <gvitale@cantv.net>

;

;===============================================================================

Func _SetPopupSize($WinWidth, $WinHeight)

$iWinWidth = $winWidth

$iWinHeight = $WinHeight

EndFunc

;===============================================================================

;

; Function Name: _SetPopupFont()

; Description: Set the Attributes of the font the Hyperlink Label

;

; Parameter(s): $Size - Font size

; $Weight - Font weight

; $Attibutes - Font Attributes

; $FontName - Self explanatory

;

; Requirement(s): None

; Return Value(s): None

;

; Author(s): GioVit <gvitale@cantv.net>

;

;===============================================================================

Func _SetPopupFont($Size, $Weight= - 1, $Attribute = 4, $FontName = -1)

$iSize = $Size

$iWeight = $Weight

$Attribute = Bitor($Attribute, 4)

$iAttribute = $Attribute

$iFontName = $FontName

EndFunc

;===============================================================================

;

; Function Name: _SetPopupBackround()

; Description: Set the Popup Window gradient colors

;

; Parameter(s): $StartColor - Popup window width

; $EndColor - Popup window height

;

; Requirement(s): None

; Return Value(s): None

;

; Author(s): GioVit <gvitale@cantv.net>

;

;===============================================================================

Func _SetPopupBackground($StartColor, $EndColor)

$iStartColor = $StartColor

$iEndColor = $EndColor

EndFunc

;===============================================================================

;

; Function Name: _Popup()

; Description: Display a sliding popup window from the taskbar displaying a Clickable Control Label

;

; Parameter(s): $Title - A window Title (Not Shown)

; $Message - The Clickable text displayed in the window

; $Timeout - [optional] Timeout in miliseconds. After the timeout has elapsed the popup window will be automatically closed.

;

; Requirement(s): None

; Return Value(s): -1 = Exit Button was Clicked

; 0 = Timeout elapsed

; 1 = Message was Clicked

;

; Author(s): GioVit <gvitale@cantv.net>

;

;===============================================================================

Func _Popup($Title, $Message, $Timeout = 1)

$OldEventMode = AutoItSetOption("GuiOnEventMode",1)

$PreviousMode = AutoItSetOption("WinTitleMatchMode", 4)

$TrayWnd = WinGetPos("classname=Shell_TrayWnd")

AutoItSetOption("WinTitleMatchMode", $PreviousMode)

$pos = ControlGetPos("Program Manager", "", "SysListView321")

$x = $pos[0]

$y = $pos[1]

$w = $pos[2]

$h = $pos[3]

If $TrayWnd[1] > 0 Then

$move = "Up"

$Xpos = @DesktopWidth - $iWinWidth - 10

$Ypos = $TrayWnd[1]

$Xexit = 4

$Yexit = 4

Elseif $TrayWnd[0] > 0 Then

$move = "Left"

$Xpos = $TrayWnd[0]

$Ypos = @DesktopHeight - $iWinHeight - 10

$Xexit = 4

$Yexit = 4

ElseIf $TrayWnd[2] = @DesktopWidth Then

$move = "Down"

$Xpos = @DesktopWidth - $iWinWidth - 10

$Ypos = $TrayWnd[1] + $TrayWnd[3] - $iWinHeight

$Xexit = 4

$Yexit = $iWinHeight - 19

ElseIf $TrayWnd[3] = @DesktopHeight Then

$move = "Right"

$Xpos = $TrayWnd[0] + $TrayWnd[2] - $iWinWidth

$Ypos = @DesktopHeight - $iWinHeight - 10

$Xexit = $iWinWidth - 19

$Yexit = 4

EndIf

$handle = GUICreate($Title, $iWinWidth, $iWinHeight, $Xpos, $Ypos, $WS_POPUPWINDOW,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST);$WS_SIZEBOX + $WS_POPUPWINDOW)

_GUICtrlCreateGradient($iStartColor, $iEndColor, 1, 1, $iWinWidth, $iWinHeight,"H")

$Label = _GuiCtrlCreateHyperlink($Message, 5, 24, $iWinWidth - 10, $iWinHeight - 48, 0x000000, 'Click Here for the latest announcment', BitOR($GUI_SS_DEFAULT_LABEL, $SS_CENTER))

GuiCtrlSetOnEvent($Label,"_Label")

$EXIT = GUICtrlCreatePic ("exit.jpg",$Xexit, $Yexit,15,15,0x0100 ) ; GUICtrlCreateLabel ("Exit Text",$Xexit, $Yexit,15,15,0x0100 ) ; &

GUICtrlSetTip(-1, "Exit")

GuiCtrlSetOnEvent($Exit,"_Exit")

GUISetState(@SW_SHOW)

ShowPopup($Title, $move)

$i = 1

$Clicked = 0 ; This line ensures subsequent popups do not dissapear as the clicked flag is not reset in any function .... should tidy up really!

if $Timeout > 0 Then

while $i*10 < $Timeout

Sleep(10)

$i += 1

if $Clicked Then ExitLoop

WEnd

Else

While 1

if $Clicked Then ExitLoop;

WEnd

EndIf

HidePopup($Title, $move)

AutoItSetOption("GuiOnEventMode", $OldEventMode)

Return $Clicked

EndFunc

Func ShowPopup($Title, $move)

Select

Case $move = "Down"

GUIMove($Title, 0, $iWinHeight)

Case $move = "Up"

GUIMove($Title, 0, -$iWinHeight)

Case $move = "Left"

GUIMove($Title, -$iWinWidth, 0)

Case $move = "Right"

GUIMove($Title, $iWinWidth, 0)

EndSelect

EndFunc

Func HidePopup($Title, $move)

$Pxy = WinGetPos($Title)

Select

Case $move = "Down"

GUIMove($Title, 0, -$Pxy[1]-$Pxy[3], 400, False)

Case $move = "Up"

GUIMove($Title, 0, @DesktopHeight-$Pxy[1], 400, False)

Case $move = "Left"

GUIMove($Title, @DesktopWidth - $Pxy[0], 0, 400, False)

Case $move = "Right"

GUIMove($Title, -$Pxy[0] - $Pxy[2], 0, 400, False)

EndSelect

EndFunc

Func GUIMove($Title, $Dx=0, $Dy=0, $Time=700, $Showing = True)

Dim $Incx, $Incy, $IncTime, $Offsetx, $Offsety

$Incx = $Dx/($Time/15)

$Incy = $Dy/($Time/15)

$IncTrans = 249/($Time/15)

$Pxy = WinGetPos($Title)

$i = 1

While 1

if $Showing Then

WinSetTrans($Title, "", $IncTrans*$i)

Else

WinSetTrans($Title, "", 249 - $IncTrans*$i)

EndIf

WinMove($Title,"", $Pxy[0]+$Incx*$i, $Pxy[1]+$Incy*$i)

Sleep(15)

if abs($Incx*$i) >= Abs($Dx) and Abs($Incy*$i) >= Abs($Dy) then ExitLoop

$i += 1

WEnd

EndFunc

Func _Exit()

$Clicked = -1

EndFunc

Func _Label()

;MsgBox(0,"Info", "Click")

$Clicked = 1

Return 1

EndFunc

;===============================================================================

; Others Authors Code

;===============================================================================

;===============================================================================

;

; Function Name: _GuiCtrlCreateHyperlink()

; Description: Creates a label that acts as a hyperlink

;

; Parameter(s): $s_Text - Label text

; $i_Left - Label left coord

; [$i_Top] - Label top coord

; [$i_Width] - Label width

; [$i_Height] - Label height

; [$i_Color] - Text Color

; [$s_ToolTip] - Hyperlink ToolTip

; [$i_Style] - Label style

; [$i_ExStyle] - Label extended style

;

; Requirement(s): None

; Return Value(s): Control ID

;

; Author(s): Saunders <krawlie@hotmail.com>

;

;===============================================================================

Func _GuiCtrlCreateHyperlink($s_Text, $i_Left, $i_Top, $i_Width = -1, $i_Height = -1, $i_Color = 0x0000ff, $s_ToolTip = '', $i_Style = -1, $i_ExStyle = -1)

Local $i_CtrlID

$i_CtrlID = GUICtrlCreateLabel($s_Text, $i_Left, $i_Top, $i_Width, $i_Height, $i_Style, $i_ExStyle)

If $i_CtrlID <> 0 Then

GUICtrlSetFont (-1, $iSize, $iWeight, $iAttribute, $iFontName)

GUICtrlSetImage (-1, "shell32.dll",22)

GuiCtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

GUICtrlSetColor(-1, $i_Color)

GUICtrlSetCursor(-1, 0)

If $s_ToolTip <> '' Then

GUICtrlSetTip(-1, $s_ToolTip)

EndIf

EndIf

Return $i_CtrlID

EndFunc;==>_GuiCtrlCreateHyperlink

Func _GUICtrlCreateGradient($nStartColor, $nEndColor, $nX, $nY, $nWidth = 255, $nHeight = 20,$s_type="V")

Local $colorR = _ColorGetRed($nStartColor)

Local $colorG = _ColorGetGreen($nStartColor)

Local $colorB = _ColorGetBlue($nStartColor)

Local $nStepR,$nStepG,$nStepB

GuiCtrlCreateGraphic($nX, $nY, $nWidth, $nHeight)

If(StringUpper($s_type) == "V") Then

$nStepR = (_ColorGetRed($nEndColor) - $colorR) / $nWidth

$nStepG = (_ColorGetGreen($nEndColor) - $colorG) / $nWidth

$nStepB = (_ColorGetBlue($nEndColor) - $colorB) / $nWidth

For $i = 0 To $nWidth

$sColor = "0x" & StringFormat("%02X%02X%02X", $colorR+$nStepR*$i, $colorG+$nStepG*$i, $colorB+$nStepB*$i)

GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)

GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)

GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $nHeight)

Next

ElseIf(StringUpper($s_type) == "H") Then

$nStepR = (_ColorGetRed($nEndColor) - $colorR) / $nHeight

$nStepG = (_ColorGetGreen($nEndColor) - $colorG) / $nHeight

$nStepB = (_ColorGetBlue($nEndColor) - $colorB) / $nHeight

For $i = 0 To $nHeight

$sColor = "0x" & StringFormat("%02X%02X%02X", $colorR+$nStepR*$i, $colorG+$nStepG*$i, $colorB+$nStepB*$i)

GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)

GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)

GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nWidth, $i)

Next

EndIf

GUICtrlSetState(-1, $GUI_DISABLE)

EndFunc

And the RSS-parser.au3 (again found on the forum)

CODE
#include-once

#region _RSS

; RSS Reader

; Created By: Frostfel

#include <INet.au3>

#include <Array.au3>

; ============================================================================

; Function: _RSSGetInfo($RSS, $RSS_InfoS, $RSS_InfoE[, $RSS_Info_ = 1])

; Description: Gets RSS Info

; Parameter(s): $RSS = RSS Feed Example: "http://feed.com/index.xml"

; $RSS_InfoS = String to find for info start Example: <title>

; $RSS_InfoE = String to find for info end Example: </title>

; $RSS_Info_Start = [optional] <info>/</info> To start at

; Some RSS feeds will have page titles

; you dont want Defualt = 0

; Requirement(s): None

; Return Value(s): On Success - Returns RSS Info in Array Starting at 1

; On Failure - Returns 0

; @Error = 1 - Failed to get RSS Feed

; Author(s): Frostfel

; ============================================================================

Func _RSSGetInfo($RSS, $RSS_InfoS, $RSS_InfoE, $RSS_Info_Start = 0)

$RSSFile = _INetGetSource($RSS)

If @Error Then

SetError(1)

Return -1

EndIf

Dim $InfoSearchS = 1

Dim $Info[1000]

Dim $InfoNumA

$InfoNum = $RSS_Info_Start

While $InfoSearchS <> 6

$InfoNum += 1

$InfoNumA += 1

$InfoSearchS = StringInStr($RSSFile, $RSS_InfoS, 0, $InfoNum)

$InfoSearchE = StringInStr($RSSFile, $RSS_InfoE, 0, $InfoNum)

$InfoSearchS += 6

$InfoSS = StringTrimLeft($RSSFile, $InfoSearchS)

$InfoSearchE -= 1

$InfoSE_Len = StringLen(StringTrimLeft($RSSFile, $InfoSearchE))

$InfoSE = StringTrimRight($InfoSS, $InfoSE_Len)

_ArrayInsert($Info, $InfoNumA, $InfoSE)

WEnd

Return $Info

EndFunc

#endregion

In order to speed up testing, if you have your own webserver, you may wish to use your own RSS feed (as i did), so you can make changes and invoke the popup toast at will.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Pls consider implementing a basic function that demonstrates your problem and is reasonably self-contained.

for example , use an inputbox to populate your toast window. Presumably, the rss feed is not the reason the toast window

continues to replicate / won't go away.

$i = 0 
Do 
  $foo = Inputbox("blah")
  _CallToast($foo)
  $i +=1
Until $i = 10

Give me that, and I'll take a look.

P.S. Just remembered: Valik made a RefreshSystemTray script that might be what you're running into -- if you mouseover the systemtray area, do the windows disappear then??

Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Hi

From your example then.

$ix = 0 
Do 
  $foo = Inputbox("Title","Enter Your Toast Text")
  _Popup("Title",$foo, 425000)
  $ix +=1
  MsgBox(0, "Testing", "IX = " & $ix)
Until $ix = 4

exitoÝ÷ Øz0z÷«Ê°YgyçmêÞ²Ú¶¬r¸©µ«-«l­éÞ­«^²Ø^iËnj[hjËi¢©N­g¨ºÚ'µèO¢©Ë¶·¡ZØhºm+"²z-¶jë¡ûazènW¦ë-rXíëhjËh®Ø^{­rº,±©ÝÊ°YlyëajÖ¥¶.azÚ²Ø(zÆ°k$Ú²C¨¯­¦bq«b¢{,,jw§¶¼jY^v«¨µ8­ê®¢×è­æÚ²ÛajØZ²Þ¾*.²¦­çEºYB¡×ºÚ"µÍÚ[ÛYH   ÑÕRPÛÛÝ[Ë]LÉÝÂÚ[ÛYH  ÐÛÛÜ]LÉÝÂÜ
    ][ÝÑÝZSÛ][[ÙI][ÝËJB[H    ÌÍÓX[[H  ÌÍÛ[ÝK  ÌÍÖÜË  ÌÍÖÜË  ÌÍÕ^UÛ  ÌÍÖ^]    ÌÍÖY^][H ÌÍÚTÝÛÛÜH    ÌÍÚQ[ÛÛÜH[H   ÌÍÚTÚ^HHLK  ÌÍÚUÙZYÚHLK    ÌÍÚP]X]HH
    ÌÍÚQÛ[YHHLB[H   ÌÍÐÛXÚÙYH[H   ÌÍÚUÚ[ÚYHM ÌÍÚUÚ[ZYÚHM[H  ÌÍÜ]ÔÙ]ÜXÚÙÜÝ[
ÌÎNYHÛÝYÈHÛÛÝY[Y[H[HXÝKÏOOOOOOOOOHÝÌÍÚ^HÈ    ÌÍÙÛÈH[]Þ
    ][ÝÕ]I][ÝË  ][ÝÑ[[ÝØÝ^ ][ÝÊBÔÜ
    ][ÝÕ]I][ÝË  ÌÍÙÛË
L
B   ÌÍÚ^
ÏLBÙÐÞ
    ][ÝÕÝ[É][ÝË   ][ÝÒVH    ][ÝÈ  [È ÌÍÚ^
B[[ ÌÍÚ^H
^]ÏOOOOOOOOH[ÝÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÔÙ]ÜÚ^J
BÈØÜ[ÛÙ]HÚ^HÙHÜÚ[ÝÂÂÈ[Y]ÊN    ÌÍÕÚ[ÚYHÜÚ[ÝÈÚYÈ ÌÍÕÚ[ZYÚHÜÚ[ÝÈZYÚÂÈ]Z[Y[
ÊNÛBÈ][YJÊNÛBÂÈ]]ÜÊNÚ[Õ] ÙÝ][PØ[] ÝÂÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÔÙ]ÜÚ^J   ÌÍÕÚ[ÚY    ÌÍÕÚ[ZYÚ
B   ÌÍÚUÚ[ÚYH  ÌÍÝÚ[ÚY    ÌÍÚUÚ[ZYÚH ÌÍÕÚ[ZYÚ[[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÔÙ]ÜÛ

BÈØÜ[ÛÙ]H]X]ÈÙHÛH[ÈX[ÂÈ[Y]ÊN    ÌÍÔÚ^HHÛÚ^BÈ ÌÍÕÙZYÚHÛÙZYÚÈ ÌÍÐ]X]ÈHÛ]X]ÂÈ   ÌÍÑÛ[YHHÙ[^[]ÜBÂÈ]Z[Y[
ÊNÛBÈ][YJÊNÛBÂÈ]]ÜÊNÚ[Õ] ÙÝ][PØ[] ÝÂÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÔÙ]ÜÛ
    ÌÍÔÚ^K  ÌÍÕÙZYÚHHK ÌÍÐ]X]HH
    ÌÍÑÛ[YHHLJB ÌÍÚTÚ^HH    ÌÍÔÚ^B  ÌÍÚUÙZYÚH  ÌÍÕÙZYÚ    ÌÍÐ]X]HH]Ü  ÌÍÐ]X]K
B   ÌÍÚP]X]HH    ÌÍÐ]X]B  ÌÍÚQÛ[YHH   ÌÍÑÛ[YB[[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÔÙ]ÜXÚÜÝ[

BÈØÜ[ÛÙ]HÜÚ[ÝÈÜYY[ÛÛÜÂÂÈ[Y]ÊN  ÌÍÔÝÛÛÜHÜÚ[ÝÈÚYÈ   ÌÍÑ[ÛÛÜHÜÚ[ÝÈZYÚÂÈ]Z[Y[
ÊNÛBÈ][YJÊNÛBÂÈ]]ÜÊNÚ[Õ] ÙÝ][PØ[] ÝÂÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÔÙ]ÜXÚÙÜÝ[
    ÌÍÔÝÛÛÜ  ÌÍÑ[ÛÛÜB  ÌÍÚTÝÛÛÜH    ÌÍÔÝÛÛÜ  ÌÍÚQ[ÛÛÜH ÌÍÑ[ÛÛÜ[[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÔÜ

BÈØÜ[ÛÜ^HHÛY[ÈÜÚ[ÝÈÛHHÚØÜ^Z[ÈHÛXÚØXHÛÛÛX[ÂÈ[Y]ÊN   ÌÍÕ]HHHÚ[ÝÈ]H
ÝÚÝÛBÈ ÌÍÓYÜØYÙHHHÛXÚØXH^Ü^YY[HÚ[ÝÂÈ ÌÍÕ[Y[Ý]HÛÜ[Û[H[Y[Ý][Z[ÙXÛÛËYH[Y[Ý]È[ÙYHÜÚ[ÝÈÚ[H]]ÛX]XØ[HÛÜÙYÂÈ]Z[Y[
ÊNÛBÈ][YJÊNLHH^]]ÛØÈÛXÚÙYÈH[Y[Ý][ÙYÈHHYÜØYÙHØÈÛXÚÙYÂÈ]]ÜÊNÚ[Õ]  ÙÝ][PØ[] ÝÂÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÔÜ
    ÌÍÕ]K    ÌÍÓYÜØYÙK ÌÍÕ[Y[Ý]HJBIÌÍÓÛ][[ÙHH]]Ò]Ù]Ü[Û    ][ÝÑÝZSÛ][[ÙI][ÝËJB  ÌÍÔ][ÝÓ[ÙHH]]Ò]Ù]Ü[Û  ][ÝÕÚ[]SX]Ú[ÙI][ÝË
B   ÌÍÕ^UÛHÚ[Ù]ÜÊ   ][ÝØÛÜÛ[YOTÚ[Õ^UÛ   ][ÝÊB]]Ò]Ù]Ü[Û    ][ÝÕÚ[]SX]Ú[ÙI][ÝË   ÌÍÔ][ÝÓ[ÙJH   ÌÍÜÜÈHÛÛÛÙ]ÜÊ    ][ÝÔÙÜ[HX[YÙ][ÝË ][ÝÉ][ÝË    ][ÝÔÞÓÝY]ÌÌI][ÝÊB  ÌÍÞH ÌÍÜÜÖÌB   ÌÍÞHH    ÌÍÜÜÖÌWB  ÌÍÝÈH   ÌÍÜÜÖÌB   ÌÍÚH ÌÍÜÜÖÌ×BY    ÌÍÕ^UÛÌWH  ÝÈ[   ÌÍÛ[ÝHH ][ÝÕ  ][Ý  ÌÍÖÜÈHÚÝÜÚYH   ÌÍÚUÚ[ÚYHL ÌÍÖÜÈH ÌÍÕ^UÛÌWB  ÌÍÖ^]H
    ÌÍÖY^]H
[ÙZY   ÌÍÕ^UÛÌH   ÝÈ[   ÌÍÛ[ÝHH ][ÝÓY ][Ý  ÌÍÖÜÈH ÌÍÕ^UÛÌB   ÌÍÖÜÈHÚÝÜZYÚH  ÌÍÚUÚ[ZYÚHL    ÌÍÖ^]H
    ÌÍÖY^]H
[ÙRY   ÌÍÕ^UÛÌHHÚÝÜÚY[    ÌÍÛ[ÝHH ][ÝÑÝÛ][Ý    ÌÍÖÜÈHÚÝÜÚYH   ÌÍÚUÚ[ÚYHL ÌÍÖÜÈH ÌÍÕ^UÛÌWH
È  ÌÍÕ^UÛÌ×HH    ÌÍÚUÚ[ZYÚ  ÌÍÖ^]H
    ÌÍÖY^]H  ÌÍÚUÚ[ZYÚHNB[ÙRY  ÌÍÕ^UÛÌ×HHÚÝÜZYÚ[ ÌÍÛ[ÝHH ][ÝÔYÚ   ][Ý  ÌÍÖÜÈH ÌÍÕ^UÛÌH
È  ÌÍÕ^UÛÌHH  ÌÍÚUÚ[ÚY   ÌÍÖÜÈHÚÝÜZYÚH  ÌÍÚUÚ[ZYÚHL    ÌÍÖ^]H   ÌÍÚUÚ[ÚYHNB    ÌÍÖY^]H
[Y  ÌÍÚ[HHÕRPÜX]J  ÌÍÕ]K    ÌÍÚUÚ[ÚY   ÌÍÚUÚ[ZYÚ  ÌÍÖÜË  ÌÍÖÜË  ÌÍÕÔ×ÔÔTÒSÕË  ÌÍÕÔ×ÑVÕÓÓÒSÕÊÉÌÍÕÔ×ÑVÕÔSÔÕ
NÉÌÍÕÔ×ÔÒVPÖ
È  ÌÍÕÔ×ÔÔTÒSÕÊBÑÕRPÝÜX]QÜYY[
    ÌÍÚTÝÛÛÜ ÌÍÚQ[ÛÛÜKK    ÌÍÚUÚ[ÚY   ÌÍÚUÚ[ZYÚ  ][ÝÒ  ][ÝÊB ÌÍÓX[HÑÝZPÝÜX]R[Ê   ÌÍÓYÜØYÙK
K   ÌÍÚUÚ[ÚYHL ÌÍÚUÚ[ZYÚH
    ÌÎNÐÛXÚÈHÜH]Ý[Ý[ÛY[   ÌÎNË]Ô  ÌÍÑÕRWÔÔ×ÑQUSÓPS   ÌÍÔÔ×ÐÑSTJBÝZPÝÙ]Û][
    ÌÍÓX[    ][Ý×ÓX[  ][ÝÊB ÌÍÑVUHÕRPÝÜX]TXÈ
    ][ÝÙ^]É][ÝË    ÌÍÖ^]    ÌÍÖY^]MKMKL
HÈÕRPÝÜX]SX[
    ][ÝÑ^]^   ][ÝË  ÌÍÖ^]    ÌÍÖY^]MKMKL
HÈ [ÂÕRPÝÙ]
LK  ][ÝÑ^]    ][ÝÊBÝZPÝÙ]Û][
    ÌÍÑ^]    ][Ý×Ñ^]  ][ÝÊBÕRTÙ]Ý]JÕ×ÔÒÕÊBÚÝÔÜ
    ÌÍÕ]K    ÌÍÛ[ÝJB ÌÍÚHHBIÌÍÐÛXÚÙYHÈÈ[H[ÝÈÝXÙ]Y[ÜÈÈÝÜØXÈHÛXÚÙYYÈÈÝÙ][[H[Ý[ÛÚÝ[YHX[IÌÌÎÂY  ÌÍÕ[Y[Ý]    ÝÈ[BHÚ[H ÌÍÚJL    È  ÌÍÕ[Y[Ý]BBTÛY
L
B   ÌÍÚH
ÏHBBBZY    ÌÍÐÛXÚÙY[^]ÛÜBBBBÑ[[ÙBÚ[HBBBZY   ÌÍÐÛXÚÙY[^]ÛÜÂBBBBÑ[[YYTÜ
    ÌÍÕ]K    ÌÍÛ[ÝJB]]Ò]Ù]Ü[Û    ][ÝÑÝZSÛ][[ÙI][ÝË    ÌÍÓÛ][[ÙJB]    ÌÍÐÛXÚÙY[[Â[ÈÚÝÔÜ
    ÌÍÕ]K    ÌÍÛ[ÝJBÙ[XÝØÙH  ÌÍÛ[ÝHH ][ÝÑÝÛ][ÝÂÕRS[ÝJ    ÌÍÕ]K    ÌÍÚUÚ[ZYÚ
BØÙH  ÌÍÛ[ÝHH ][ÝÕ  ][ÝÂÕRS[ÝJ  ÌÍÕ]KIÌÍÚUÚ[ZYÚ
BØÙH  ÌÍÛ[ÝHH ][ÝÓY ][ÝÂÕRS[ÝJ  ÌÍÕ]KIÌÍÚUÚ[ÚY
BØÙH  ÌÍÛ[ÝHH ][ÝÔYÚ   ][ÝÂÕRS[ÝJ  ÌÍÕ]K    ÌÍÚUÚ[ÚY
B[Ù[XÝ[[Â[ÈYTÜ
    ÌÍÕ]K    ÌÍÛ[ÝJB ÌÍÔHHÚ[Ù]ÜÊ  ÌÍÕ]JBÙ[XÝØÙH    ÌÍÛ[ÝHH ][ÝÑÝÛ][ÝÂÕRS[ÝJ    ÌÍÕ]KIÌÍÔVÌWKIÌÍÔVÌ×K
[ÙJBØÙH  ÌÍÛ[ÝHH ][ÝÕ  ][ÝÂÕRS[ÝJ  ÌÍÕ]KÚÝÜZYÚIÌÍÔVÌWK
[ÙJBØÙH  ÌÍÛ[ÝHH ][ÝÓY ][ÝÂÕRS[ÝJ  ÌÍÕ]KÚÝÜÚYH  ÌÍÔVÌK
[ÙJBØÙH  ÌÍÛ[ÝHH ][ÝÔYÚ   ][ÝÂÕRS[ÝJ  ÌÍÕ]KIÌÍÔVÌHH    ÌÍÔVÌK
[ÙJB[Ù[XÝ[[Â[ÈÕRS[ÝJ ÌÍÕ]K    ÌÍÑL ÌÍÑOL    ÌÍÕ[YOMÌ    ÌÍÔÚÝÚ[ÈHYJB[H   ÌÍÒ[Þ   ÌÍÒ[ÞK  ÌÍÒ[Õ[YK    ÌÍÓÙÙ] ÌÍÓÙÙ]B    ÌÍÒ[ÞH  ÌÍÑÊ    ÌÍÕ[YKÌMJB  ÌÍÒ[ÞHH ÌÍÑKÊ   ÌÍÕ[YKÌMJB  ÌÍÒ[Õ[ÈHKÊ    ÌÍÕ[YKÌMJB  ÌÍÔHHÚ[Ù]ÜÊ  ÌÍÕ]JB   ÌÍÚHHBÚ[HBY ÌÍÔÚÝÚ[È[Ú[Ù][Ê   ÌÍÕ]K    ][ÝÉ][ÝË    ÌÍÒ[Õ[ÊÌÍÚJB[ÙBÚ[Ù][Ê   ÌÍÕ]K    ][ÝÉ][ÝËHH  ÌÍÒ[Õ[ÊÌÍÚJB[YÚ[[ÝJ   ÌÍÕ]K    ][ÝÉ][ÝË    ÌÍÔVÌJÉÌÍÒ[Þ
ÌÍÚK ÌÍÔVÌWJÉÌÍÒ[ÞJÌÍÚJBÛY
MJBYXÊ ÌÍÒ[Þ
ÌÍÚJH    ÝÏHXÊ    ÌÍÑ
H[XÊ   ÌÍÒ[ÞJÌÍÚJH  ÝÏHXÊ    ÌÍÑJH[^]ÛÜ ÌÍÚH
ÏHBÑ[[[Â[ÈÑ^]

B   ÌÍÐÛXÚÙYHLB[[Â[ÈÓX[

BÓÙÐÞ
    ][ÝÒ[É][ÝË ][ÝÐÛXÚÉ][ÝÊB    ÌÍÐÛXÚÙYHB]B[[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÈÝÈ]]ÜÈÛÙBÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑÝZPÝÜX]R[Ê
BÈØÜ[ÛÜX]ÈHX[]XÝÈÈH[ÂÂÈ[Y]ÊN   ÌÍÜ×Õ^HX[^È   ÌÍÚWÓYHX[YÛÛÜÈÉÌÍÚWÕÜHHX[ÜÛÛÜÈÉÌÍÚWÕÚYHHX[ÚYÈÉÌÍÚWÒZYÚHHX[ZYÚÈÉÌÍÚWÐÛÛÜHH^ÛÛÜÈÉÌÍÜ×ÕÛÛHH[ÈÛÛÈÉÌÍÚWÔÝ[WHHX[Ý[BÈÉÌÍÚWÑ^Ý[WHHX[^[YÝ[BÂÈ]Z[Y[
ÊNÛBÈ][YJÊNÛÛÛQÂÈ]]ÜÊNØ][È ÚÜ]ÛYPÝXZ[ÛÛIÝÂÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑÝZPÝÜX]R[Ê   ÌÍÜ×Õ^ ÌÍÚWÓY  ÌÍÚWÕÜ ÌÍÚWÕÚYHLK ÌÍÚWÒZYÚHLK    ÌÍÚWÐÛÛÜH    ÌÍÜ×ÕÛÛH ÌÎNÉÌÎNË  ÌÍÚWÔÝ[HHLK    ÌÍÚWÑ^Ý[HHLJBØØ[ ÌÍÚWÐÝQ    ÌÍÚWÐÝQHÕRPÝÜX]SX[
    ÌÍÜ×Õ^ ÌÍÚWÓY  ÌÍÚWÕÜ ÌÍÚWÕÚY    ÌÍÚWÒZYÚ   ÌÍÚWÔÝ[K   ÌÍÚWÑ^Ý[JBY    ÌÍÚWÐÝQ    ÉÝÈ[ÕRPÝÙ]Û
LK  ÌÍÚTÚ^K ÌÍÚUÙZYÚ   ÌÍÚP]X]K ÌÍÚQÛ[YJBÕRPÝÙ][XYÙH
LK  ][ÝÜÚ[Ì ][ÝËBÝZPÝÙ]ÐÛÛÜLK  ÌÍÑÕRWÐÐÓÓÔÕSÔTS
BÕRPÝÙ]ÛÛÜLK  ÌÍÚWÐÛÛÜBÕRPÝÙ]ÝÛÜLK
BY  ÌÍÜ×ÕÛÛ  ÉÝÈ  ÌÎNÉÌÎNÈ[ÕRPÝÙ]
LK  ÌÍÜ×ÕÛÛ
B[Y[Y]  ÌÍÚWÐÝQ[[ÎÏOIÝ×ÑÝZPÝÜX]R[Â[ÈÑÕRPÝÜX]QÜYY[
    ÌÍÛÝÛÛÜ  ÌÍÛ[ÛÛÜ   ÌÍÛ  ÌÍÛK ÌÍÛÚYHMK    ÌÍÛZYÚH ÌÍÜ×ÝOI][ÝÕ][ÝÊBØØ[  ÌÍØÛÛÜHÐÛÛÜÙ]Y
    ÌÍÛÝÛÛÜBØØ[    ÌÍØÛÛÜÈHÐÛÛÜÙ]ÜY[  ÌÍÛÝÛÛÜBØØ[    ÌÍØÛÛÜHÐÛÛÜÙ]YJ  ÌÍÛÝÛÛÜBØØ[    ÌÍÛÝ    ÌÍÛÝË  ÌÍÛÝÝZPÝÜX]QÜXÊ    ÌÍÛ  ÌÍÛK ÌÍÛÚY   ÌÍÛZYÚ
BYÝ[Õ ÌÍÜ×ÝJHOH  ][ÝÕ][ÝÊH[  ÌÍÛÝH
ÐÛÛÜÙ]Y
    ÌÍÛ[ÛÛÜHH ÌÍØÛÛÜHÈ ÌÍÛÚY   ÌÍÛÝÈH
ÐÛÛÜÙ]ÜY[ ÌÍÛ[ÛÛÜHH ÌÍØÛÛÜÊHÈ   ÌÍÛÚY   ÌÍÛÝH
ÐÛÛÜÙ]YJ   ÌÍÛ[ÛÛÜHH ÌÍØÛÛÜHÈ ÌÍÛÚYÜ ÌÍÚHHÈ  ÌÍÛÚY   ÌÍÜÐÛÛÜH ][ÝÌ  ][ÝÈ  [ÈÝ[ÑÜX]
    ][ÝÉL L   L   ][ÝË  ÌÍØÛÛÜÉÌÍÛÝÌÍÚK   ÌÍØÛÛÜÊÉÌÍÛÝÊÌÍÚK   ÌÍØÛÛÜÉÌÍÛÝÌÍÚJBÕRPÝÙ]ÜXÊLK  ÌÍÑÕRWÑÔÐÓÓÔ  ÌÍÜÐÛÛÜBÕRPÝÙ]ÜXÊLK ÌÍÑÕRWÑÔÓSÕK    ÌÍÚK
BÕRPÝÙ]ÜXÊLK   ÌÍÑÕRWÑÔÓSK  ÌÍÚK ÌÍÛZYÚ
B^[ÙRYÝ[Õ    ÌÍÜ×ÝJHOH  ][ÝÒ  ][ÝÊH[    ÌÍÛÝH
ÐÛÛÜÙ]Y
    ÌÍÛ[ÛÛÜHH ÌÍØÛÛÜHÈ ÌÍÛZYÚ  ÌÍÛÝÈH
ÐÛÛÜÙ]ÜY[ ÌÍÛ[ÛÛÜHH ÌÍØÛÛÜÊHÈ   ÌÍÛZYÚ  ÌÍÛÝH
ÐÛÛÜÙ]YJ   ÌÍÛ[ÛÛÜHH ÌÍØÛÛÜHÈ ÌÍÛZYÚÜ    ÌÍÚHHÈ  ÌÍÛZYÚ  ÌÍÜÐÛÛÜH ][ÝÌ  ][ÝÈ  [ÈÝ[ÑÜX]
    ][ÝÉL L   L   ][ÝË  ÌÍØÛÛÜÉÌÍÛÝÌÍÚK   ÌÍØÛÛÜÊÉÌÍÛÝÊÌÍÚK   ÌÍØÛÛÜÉÌÍÛÝÌÍÚJBÕRPÝÙ]ÜXÊLK  ÌÍÑÕRWÑÔÐÓÓÔ  ÌÍÜÐÛÛÜBÕRPÝÙ]ÜXÊLK ÌÍÑÕRWÑÔÓSÕK    ÌÍÚJBÕRPÝÙ]ÜXÊLK    ÌÍÑÕRWÑÔÓSK  ÌÍÛÚY   ÌÍÚJB^[YÕRPÝÙ]Ý]JLK  ÌÍÑÕRWÑTÐPJB[[

Please let me know if there is anything else you need, im still quite new to all this!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I did a couple of quick tests...The toast lasts as long as it's timeout. The next line

in the script is not executed until the timeout is over.

I am not sure how you eliminated the timeout length as a possible reason for

the undesired behavior you see, or I don't understand the undesired behavior clearly.

addendum: nice job with the gradient colors...

Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

I did a couple of quick tests...The toast lasts as long as it's timeout. The next line

in the script is not executed until the timeout is over.

I am not sure how you eliminated the timeout length as a possible reason for

the undesired behavior you see, or I don't understand the undesired behavior clearly.

addendum: nice job with the gradient colors...

My problem seems to arrise when you click the toast (its hyperlinked to a url of your choice) or if you click the exit icon.. although the desired action is taken (the browser loads, or the toast retracts), according to task manager the window is still running (thus it appears to just hide from view on retraction.)

Look in your task manager (application tab) after 4 or 5 sucessive "toasts".

Share this post


Link to post
Share on other sites

My problem seems to arrise when you click the toast (its hyperlinked to a url of your choice) or if you click the exit icon.. although the desired action is taken (the browser loads, or the toast retracts), according to task manager the window is still running (thus it appears to just hide from view on retraction.)

Look in your task manager (application tab) after 4 or 5 sucessive "toasts".

As the test function does not exhibit this behavior, your issue is somewhere else. Where do you tell the GUI to exit? Are you waiting for a return from the browser for the script to execute that code? Place a msgbox() or other debug indicator directly before the line that should kill the gui...Does it get executed?


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Sorry if my description is not that clear, here is a test example that should hightlight it exactly. Hopefully taskmanager will open for you (leave the last "toast" open) and you will see there is an entry for every previous toast. (Be sure to go to the application tab in task manager if it does not open there by default).

#include <GUIConstants.au3>
#include <Color.au3>

Opt("GuiOnEventMode",1)
Dim $Label
Dim $move, $Xpos, $Ypos, $TrayWnd, $Xexit, $Yexit
Dim $iStartColor = 0x0000ff, $iEndColor = 0xffffff
Dim $iSize = -1, $iWeight = -1, $iAttribute = 4, $iFontName = -1
Dim $Clicked = 0
Dim $iWinWidth = 160, $iWinHeight = 160
Dim $ret

_SetPopupBackground(0x3399ff, 0xffffff) ;over-rides the colour defined in the dim above.

$ix = 0 
Do 
  _Popup("Title " & $ix, "This is toast " & $ix, 150)
  $ix +=1

Until $ix = 5
ShellExecute("Taskmgr")
  _Popup("Title " & $ix, "This is toast " & $ix & @CRLF & " Check the applications window for multiple spawns", 453200)  



exit

Func _SetPopupSize($WinWidth, $WinHeight)
    $iWinWidth = $winWidth
    $iWinHeight = $WinHeight
EndFunc


Func _SetPopupFont($Size, $Weight= - 1, $Attribute = 4, $FontName = -1)
    $iSize = $Size
    $iWeight = $Weight
    $Attribute = Bitor($Attribute, 4)
    $iAttribute = $Attribute
    $iFontName = $FontName
EndFunc


Func _SetPopupBackground($StartColor, $EndColor)
    $iStartColor = $StartColor
    $iEndColor = $EndColor
EndFunc

Func _Popup($Title, $Message, $Timeout = 1)
    $OldEventMode = AutoItSetOption("GuiOnEventMode",1)
    $PreviousMode = AutoItSetOption("WinTitleMatchMode", 4)
    $TrayWnd = WinGetPos("classname=Shell_TrayWnd")
    AutoItSetOption("WinTitleMatchMode", $PreviousMode)    
    $pos = ControlGetPos("Program Manager", "", "SysListView321")
    $x = $pos[0]
    $y = $pos[1]
    $w = $pos[2]
    $h = $pos[3]
    
    If $TrayWnd[1] > 0 Then
        $move = "Up"
        $Xpos = @DesktopWidth - $iWinWidth - 10
        $Ypos = $TrayWnd[1]
        $Xexit = 4
        $Yexit = 4
    Elseif $TrayWnd[0] > 0 Then
        $move = "Left"
        $Xpos = $TrayWnd[0]
        $Ypos = @DesktopHeight - $iWinHeight - 10
        $Xexit = 4
        $Yexit = 4
    ElseIf $TrayWnd[2] = @DesktopWidth Then
        $move = "Down"
        $Xpos = @DesktopWidth - $iWinWidth - 10
        $Ypos = $TrayWnd[1] + $TrayWnd[3] - $iWinHeight
        $Xexit = 4
        $Yexit = $iWinHeight - 19
    ElseIf $TrayWnd[3] = @DesktopHeight Then
        $move = "Right"
        $Xpos = $TrayWnd[0] + $TrayWnd[2] - $iWinWidth
        $Ypos = @DesktopHeight - $iWinHeight - 10
        $Xexit = $iWinWidth - 19
        $Yexit = 4
    EndIf
            
    $handle = GUICreate($Title, $iWinWidth, $iWinHeight, $Xpos, $Ypos, $WS_POPUPWINDOW,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST);$WS_SIZEBOX + $WS_POPUPWINDOW)
    _GUICtrlCreateGradient($iStartColor, $iEndColor, 1, 1, $iWinWidth, $iWinHeight,"H")
    $Label = _GuiCtrlCreateHyperlink($Message, 5, 24, $iWinWidth - 10, $iWinHeight - 48, 0x000000, 'Click Here for the latest announcment', BitOR($GUI_SS_DEFAULT_LABEL, $SS_CENTER))
    GuiCtrlSetOnEvent($Label,"_Label")

    $EXIT =  GUICtrlCreatePic ("exit.jpg",$Xexit, $Yexit,15,15,0x0100 ) 

    GUICtrlSetTip(-1, "Exit")
    GuiCtrlSetOnEvent($Exit,"_Exit")

    GUISetState(@SW_SHOW)
    ShowPopup($Title, $move)
    $i = 1
    $Clicked = 0 ; This line ensures subsequent popups do not dissapear as the clicked flag is not reset in any function .... should tidy up really!
    if $Timeout > 0 Then
            while $i*10 < $Timeout
            Sleep(10)
            $i += 1
            if $Clicked Then ExitLoop
                
        WEnd
    Else
        While 1
            if $Clicked Then ExitLoop;
                
        WEnd
    EndIf
    HidePopup($Title, $move)
    AutoItSetOption("GuiOnEventMode", $OldEventMode)
    Return $Clicked
EndFunc

Func ShowPopup($Title, $move)
    Select
    Case $move = "Down"
        GUIMove($Title, 0, $iWinHeight)
    Case $move = "Up"
        GUIMove($Title, 0, -$iWinHeight)
    Case $move = "Left"
        GUIMove($Title, -$iWinWidth, 0)
    Case $move = "Right"
        GUIMove($Title, $iWinWidth, 0)
    EndSelect
    
EndFunc

Func HidePopup($Title, $move)
    $Pxy = WinGetPos($Title)
    Select
    Case $move = "Down"
        GUIMove($Title, 0, -$Pxy[1]-$Pxy[3], 400, False)
    Case $move = "Up"
        GUIMove($Title, 0, @DesktopHeight-$Pxy[1], 400, False)
    Case $move = "Left"
        GUIMove($Title, @DesktopWidth - $Pxy[0], 0, 400, False)
    Case $move = "Right"
        GUIMove($Title, -$Pxy[0] - $Pxy[2], 0, 400, False)
    EndSelect
EndFunc

Func GUIMove($Title, $Dx=0, $Dy=0, $Time=700, $Showing = True)
Dim $Incx, $Incy, $IncTime, $Offsetx, $Offsety
    $Incx = $Dx/($Time/15)
    $Incy = $Dy/($Time/15)
    $IncTrans = 249/($Time/15)
    $Pxy = WinGetPos($Title)
    $i = 1
    While 1
        if $Showing Then
            WinSetTrans($Title, "", $IncTrans*$i)
        Else
            WinSetTrans($Title, "", 249 - $IncTrans*$i)
        EndIf    
        WinMove($Title,"", $Pxy[0]+$Incx*$i, $Pxy[1]+$Incy*$i)
        Sleep(15)
        if abs($Incx*$i) >= Abs($Dx) and Abs($Incy*$i) >= Abs($Dy) then ExitLoop
        $i += 1
        
    WEnd
EndFunc
Func _Exit()
    $Clicked = -1
    Return -1
EndFunc

Func _Label()
;MsgBox(0,"Info", "Click")
    $Clicked = 1
    Return 1
EndFunc




Func _GuiCtrlCreateHyperlink($s_Text, $i_Left, $i_Top, $i_Width = -1, $i_Height = -1, $i_Color = 0x0000ff, $s_ToolTip = '', $i_Style = -1, $i_ExStyle = -1)
    Local $i_CtrlID
    $i_CtrlID = GUICtrlCreateLabel($s_Text, $i_Left, $i_Top, $i_Width, $i_Height, $i_Style, $i_ExStyle)
    If $i_CtrlID <> 0 Then
        GUICtrlSetFont (-1, $iSize, $iWeight, $iAttribute, $iFontName)
        GUICtrlSetImage (-1, "shell32.dll",22)
        GuiCtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        GUICtrlSetColor(-1, $i_Color)
        GUICtrlSetCursor(-1, 0)
        If $s_ToolTip <> '' Then
            GUICtrlSetTip(-1, $s_ToolTip)
        EndIf
    EndIf
    Return $i_CtrlID
EndFunc;==>_GuiCtrlCreateHyperlink

Func _GUICtrlCreateGradient($nStartColor, $nEndColor, $nX, $nY, $nWidth = 255, $nHeight = 20,$s_type="V")
   Local $colorR = _ColorGetRed($nStartColor)
   Local $colorG = _ColorGetGreen($nStartColor)
   Local $colorB = _ColorGetBlue($nStartColor)

   Local $nStepR,$nStepG,$nStepB

   GuiCtrlCreateGraphic($nX, $nY, $nWidth, $nHeight)
    If(StringUpper($s_type) == "V") Then
        $nStepR = (_ColorGetRed($nEndColor) - $colorR) / $nWidth
        $nStepG = (_ColorGetGreen($nEndColor) - $colorG) / $nWidth
        $nStepB = (_ColorGetBlue($nEndColor) - $colorB) / $nWidth
        For $i = 0 To $nWidth
            $sColor = "0x" & StringFormat("%02X%02X%02X", $colorR+$nStepR*$i, $colorG+$nStepG*$i, $colorB+$nStepB*$i)
                GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
            GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
            GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $nHeight)
        Next
    ElseIf(StringUpper($s_type) == "H") Then
        $nStepR = (_ColorGetRed($nEndColor) - $colorR) / $nHeight
        $nStepG = (_ColorGetGreen($nEndColor) - $colorG) / $nHeight
        $nStepB = (_ColorGetBlue($nEndColor) - $colorB) / $nHeight
        For $i = 0 To $nHeight
            $sColor = "0x" & StringFormat("%02X%02X%02X", $colorR+$nStepR*$i, $colorG+$nStepG*$i, $colorB+$nStepB*$i)
                GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
            GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
            GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nWidth, $i)
        Next

    EndIf
    GUICtrlSetState(-1, $GUI_DISABLE)
EndFunc

Share this post


Link to post
Share on other sites

taskmanager will open for you (leave the last "toast" open) and you will see there is an entry for every previous toast. (Be sure to go to the application tab in task manager if it does not open there by default).

my tasklist doesn't show 'extra' toasts.... I'm running xppsp2....

Have tested your script exactly in both compiled and uncompiled versions....

Your problem lies elsewhere....


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

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  
Followers 0