mesale0077

Tray balloon udf

5 posts in this topic

#1 ·  Posted (edited)

Tray balloon
 
sanaldosya.org_1403984353__trayballon.jp

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

; AutoIt Version: 3.3.11.6 Beta
; Author:         mesale0077
;
;Trayballoon udf
;For thank you UEZ Perforator v1.0 build 2014-05-30 beta - perforate your GUI easily http://www.autoitscript.com/forum/topic/149107-perforator-v10-build-2014-05-30-beta-perforate-your-gui-easily/
;SysTray_UDF.au3 http://www.autoitscript.com/forum/topic/13704-systray-udf/
; ----------------------------------------------------------------------------
#NoTrayIcon
#RequireAdmin
#include <WinAPI.au3>
#include <GuiConstants.au3>
#include "SysTray_UDF.au3"
Opt("TrayIconHide", 0)

global $Array1[4] = [0.7, 0.4, 0.6, 0.7]
 for $kmn=1 to 4
Trayballoon("", "By mesale0077" & @CRLF & @CRLF & "Tray balloon" & @CRLF & @CRLF & "Tray ballon example",$kmn);,0x404040)
sleep(200)
next
Func Trayballoon($TBTitle, $TBText,$kki=1,$setcolor=0xFFFFFF, $display_Time = 2500)
    $index = _SysTrayIconIndex(@AutoItExe)
    $pos = _SysTrayIconPos($index)
    $aPixelArray_1 = Call("_PixelCoordinates" & $kki)
    $aSize_1 = StringSplit($aPixelArray_1[0], ",", 2)
     $fScale_2= $Array1[$kki-1]
        $iW_1 = $aSize_1[0] * $fScale_2
    $iH_1 = $aSize_1[1] * $fScale_2
    $TBgui = GUICreate($TBTitle, $iW_1, $iH_1, $pos[0] -140, $pos[1] - 210, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
   GUISetBkColor($setcolor)
    $Status = GUICtrlCreateLabel($TBText, -1, 50, $iW_1, $iH_1, $SS_CENTER)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $hRegion = _WinAPI_GuiImageHole_1(HWnd($TBgui), $aPixelArray_1, 0, 0, $iW_1, $iH_1, $fScale_2, False)
    WinSetTrans($TBgui, "", 0)
    GUISetState(@SW_SHOW)
    GUI_Fader($TBgui)
    Sleep($display_Time)
    GUI_Fader($TBgui, False, 2)
EndFunc   
Func GUI_Fader($hGUI, $bFadeIn = True, $iSpeed = 1, $iSleep = 10)
    Local $i
    Switch $bFadeIn
        Case True
            For $i = 0x00 To 0xFF Step $iSpeed
                WinSetTrans($hGUI, "", $i)
                Sleep($iSleep)
            Next
        Case False
            For $i = 0xFF to 0x00 Step - $iSpeed
                WinSetTrans($hGUI, "", $i)
                Sleep($iSleep)
            Next
    EndSwitch
EndFunc

Func _WinAPI_GuiImageHole_1($hWnd, $aPixelArray_11, $iX, $iY, $iWidth, $iHeight, $fScale = 1, $bCorrection = True)
    Local $size = WinGetPos(HWnd($hWnd))
    Local $iHwndWidth = $size[2]
    Local $iHwndHeight = $size[3]
    If $bCorrection Then
        $iX += _WinAPI_GetSystemMetrics(7)
        $iY += _WinAPI_GetSystemMetrics(8) + _WinAPI_GetSystemMetrics($SM_CYSIZE) + 1
    EndIf
    Local $aM_Mask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', 0, 'long', 0)
    $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', $iX, 'long', $iHwndHeight)
    DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2)
    $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', $iHwndWidth, 'long', $iY)
    DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2)
    $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', $iX + $iWidth, 'long', 0, 'long', $iHwndWidth + 30, 'long', $iHwndHeight)
    DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2)
    $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', $iY + $iHeight, 'long', $iHwndWidth, 'long', $iHwndHeight)
    DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2)
    Local $i, $aBlock, $aRet, $hDLL = DllOpen('gdi32.dll')
    For $i = 1 To UBound($aPixelArray_11) - 1
        $aBlock = StringSplit($aPixelArray_11[$i], ',', 2)
        $aRet = DllCall($hDLL, 'long', 'CreateRectRgn', 'long', $iX + $aBlock[0] * $fScale, 'long', $iY + $aBlock[1] * $fScale, 'long', $iX + $aBlock[2] * $fScale, 'long', $iY + $aBlock[3] * $fScale)
        DllCall($hDLL, 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aRet[0], 'long', $aM_Mask[0], 'int', 2)
        _WinAPI_DeleteObject($aRet[0])
    Next
    DllClose($hDLL)
    DllCall('user32.dll', 'long', 'SetWindowRgn', 'hwnd', $hWnd, 'long', $aM_Mask[0], 'int', 1)
    Return $aM_Mask[0]
EndFunc   ;==>_WinAPI_GuiImageHole_1

Func _PixelCoordinates1()

;Code below was generated by Perforator v1.0 build 2014-05-30 beta
    #region pixel coordinates
    Local $aPixelArray_3[354] = [ _
        "300,301","82,12,213,244","131,3,160,12","120,4,131,12","160,4,172,12","112,5,120,12","172,5,180,12","106,6,112,12","180,6,187,12","101,7,106,12","187,7,192,12","96,8,101,12","192,8,197,12","92,9,96,12","197,9,202,12","89,10,92,12","202,10,206,12","85,11,89,12","206,11,209,12","41,33,82,229","74,15,82,33","79,13,82,15","213,30,253,231","213,14,219,30","213,13,216,14","77,14,79,15","219,15,222,30","67,18,74,33","71,16,74,18","222,16,225,30","69,17,71,18","225,18,230,30","225,17,227,18","63,20,67,33","65,19,67,20","230,19,232,30","232,20,234,30","59,22,63,33","61,21,63,22","234,21,236,30","236,22,238,30","55,24,59,33","57,23,59,24","238,23,240,30","240,24,242,30","52,26,55,33","53,25,55,26","242,25,244,30","244,26,246,30","49,28,52,33","50,27,52,28","246,27,248,30","248,28,249,30","46,30,49,33","47,29,49,30","249,29,251,30","44,31,46,33","253,53,280,147","253,33,257,53","253,31,254,33","43,32,44,33","254,32,256,33","17,58,41,151","36,37,41,58","40,34,41,37","257,35,260,53","257,34,259,35","39,35,40,37","38,36,39,37","260,37,263,53","260,36,261,37","32,41,36,58","35,38,36,41","263,39,265,53","263,38,264,39","34,39,35,41","33,40,34,41","265,41,268,53","265,40,266,41","29,44,32,58","31,42,32,44","268,43,270,53","268,42,269,43","30,43,31,44","270,45,272,53","270,44,271,45","26,47,29,58","28,45,29,47","27,46,28,47","272,46,273,53","273,47,274,53","24,49,26,58","25,48,26,49","274,48,275,53","275,49,276,53","22,52,24,58","23,50,24,52","276,50,277,53","277,51,278,53","278,52,279,53","20,54,22,58","21,53,22,54","280,68,290,133","280,56,282,68","280,55,281,56","19,56,20,58","18,57,19,58","282,57,283,68","283,60,285,68","283,59,284,60","8,75,17,138","15,61,17,75","16,60,17,61","285,61,286,68","13,65,15,75","14,63,15,65","286,63,287,68","287,64,288,68","288,66,289,68","11,68,13,75","12,67,13,68","10,70,11,75","290,79,295,123","290,70,291,79","291,72,292,79","9,73,10,75","292,74,293,79","293,76,294,79","4,87,8,128","7,77,8,87","6,80,7,87","295,86,297,116","295,82,296,86","5,83,6,87","2,96,4,120","3,91,4,96","297,91,298,111", _
        "1,107,2,109","295,116,296,119","3,120,4,124","290,123,293,127","293,123,294,125","290,127,292,129","5,128,8,131","290,129,291,131","6,131,8,134","280,133,286,139","286,133,288,136","288,133,289,135","7,134,8,136","286,136,287,138","10,138,17,142","9,138,10,140","280,139,284,142","284,139,285,141","11,142,17,143","280,142,282,144","282,142,283,143","12,143,17,145","280,144,281,146","13,145,17,146","14,146,17,147","15,147,17,149","253,160,266,223","253,147,267,158","267,147,274,153","274,147,277,150","277,147,279,148","277,148,278,149","16,149,17,150","274,150,276,151","21,151,41,155","18,151,21,152","274,151,275,152","19,152,21,153","20,153,21,154","267,153,271,155","271,153,272,154","25,155,41,158","22,155,25,156","267,155,270,156","23,156,25,157","267,156,268,157","266,163,280,206","271,158,275,163","272,157,274,158","23,166,41,206","28,158,41,161","26,158,28,159","253,158,265,160","27,159,28,160","269,160,271,163","270,159,271,160","275,159,276,163","276,160,277,163","29,161,41,166","266,161,269,163","277,161,279,163","25,162,28,166","28,163,29,166","24,164,25,166","280,169,284,197","280,164,281,169","281,165,282,169","282,167,283,169","20,174,23,198","22,168,23,174","21,171,22,174","284,176,286,188","284,172,285,176","19,178,20,194","284,188,285,193","280,197,283,200","21,198,23,201","280,200,282,202","22,201,23,204","280,202,281,204","26,206,41,212","24,206,26,208","266,206,274,215","274,206,278,209","278,206,279,208","25,208,26,210","274,209,276,212","276,209,277,211","28,212,41,215","27,212,28,213","274,212,275,213","30,215,41,218","29,215,30,216","266,215,270,219","270,215,272,217","272,215,273,216","270,217,271,218","32,218,41,220","31,218,32,219","266,219,268,221","268,219,269,220","34,220,41,222","33,220,34,221","266,221,267,222","35,222,41,223","36,223,41,224","253,223,259,228","259,223,262,226","262,223,264,224","37,224,41,225","262,224,263,225","38,225,41,226","39,226,41,227","259,226,261,227","40,227,41,228","253,228,256,230","256,228,257,229","49,229,82,235","42,229,49,230","44,230,49,231","253,230,254,231","45,231,49,232","213,231,232,239","232,231,243,236","243,231,248,234","248,231,252,232","46,232,49,233","248,232,250,233","48,233,49,234","243,234,246,235","56,235,82,239","51,235,56,236","52,236,56,237","232,236,236,238","236,236,239,237","54,237,56,238", _
        "61,239,82,242","57,239,61,240","213,239,220,242","220,239,223,241","223,239,227,240","59,240,61,241","66,242,82,244","64,242,66,243","213,242,217,243","213,243,214,244","97,244,163,253","71,244,97,246","68,244,71,245","169,244,199,256","163,244,169,250","199,244,206,248","206,244,210,246","210,244,212,245","77,246,97,248","74,246,77,247","206,246,208,247","80,248,97,249","199,248,202,251","202,248,204,250","204,248,205,249","84,249,97,250","87,250,97,251","163,250,164,252","166,250,169,251","92,251,97,252","164,251,165,252","167,251,169,253","199,251,201,253","114,253,143,255","104,253,114,254","143,253,155,254","168,253,169,254","199,253,200,254","173,256,197,262","170,256,173,257","197,256,198,259","171,257,173,259","172,259,173,260","177,262,197,267","174,262,177,263","175,263,177,265","176,265,177,266","180,267,197,271","178,267,180,268","179,268,180,270","190,271,198,280","197,268,198,271","182,271,190,273","181,271,182,272","198,272,199,286","183,273,190,274","184,274,190,275","185,275,190,276","199,275,200,286","186,276,190,277","187,277,190,278","200,277,201,287","189,278,190,279","201,280,203,287","201,279,202,280","191,280,198,281","192,281,198,282","194,282,198,283","203,282,204,288","195,283,198,284","204,283,205,289","197,284,198,285","205,284,206,290","206,286,207,290","202,287,203,288","207,287,208,291","208,288,209,291","209,289,210,292","210,290,211,292","211,291,212,293","212,292,213,293"]
    #endregion
    Return $aPixelArray_3
EndFunc   ;==>_PixelCoordinate()
Func _PixelCoordinates2()

    #region pixel coordinates
    Local $sPixelRect
        $sPixelRect &= "640,607;222,0,226,1;231,0,233,1;253,0,256,1;260,0,263,1;344,0,348,1;352,0,355,1;375,0,377,1;382,0,386,1;219,1,222,2;227,1,228,2;258,1,259,2;263,1,266,2;341,1,344,2;349,1,350,2;380,1,381,2;386,1,388,2;217,2,219,3;223,2,224,3;262,2,263,3;266,2,269,3;338,2,341,3;345,2,346,3;384,2,385,3;389,2,391,3;214,3,216,4;220,3,221,4;265,3,266,4;269,3,271,4;336,3,338,4;341,3,342,4;387,3,388,4;391,3,393,4;212,4,214,5;217,4,218,5;267,4,268,5;271,4,273,5;333,4,335,5;390,4,391,5;394,4,395,5;210,5,212,6;273,5,275,6;331,5,333,6;336,5,337,6;392,5,393,6;396,5,397,6;208,6,210,7;212,6,213,7;275,6,276,7;329,6,331,7;398,6,399,7;206,7,208,8;210,7,211,8;276,7,278,8;328,7,329,8;399,7,401,8;204,8,206,9;208,8,209,9;278,8,279,9;326,8,327,9;398,8,399,9;401,8,402,9;203,9,204,10;206,9,207,10;277,9,278,10;280,9,281,10;324,9,326,10;403,9,404,10;201,10,203,11;281,10,282,11;323,10,324,11;326,10,327,11;404,10,405,11;200,11,201,12;282,11,283,12;321,11,322,12;324,11,325,12;405,11,407,12;198,12,199,13;201,12,202,13;281,12,282,13;283,12,285,13;320,12,321,13;404,12,405,13;407,12,408,13;197,13,198,14;285,13,286,14;318,13,320,14;321,13,322,14;408,13,409,14;195,14,197,15;198,14,199,15;144,80,407,335;215,21,269,80;236,14,250,21;286,14,287,15;317,14,318,15;336,21,392,80;358,14,371,21;409,14,410,15;194,15,195,16;227,16,236,21;231,15,236,16;250,15,255,21;287,15,288,16;316,15,317,16;352,15,358,21;371,15,377,21;410,15,411,16;193,16,194,17;255,16,259,21;288,16,289,17;314,16,316,17;317,16,318,17;348,16,352,21;377,16,381,21;409,16,410,17;411,16,412,17;192,17,193,18;194,17,195,18;221,18,227,21;224,17,227,18;259,17,262,21;289,17,290,18;313,17,314,18;343,18,348,21;345,17,348,18;381,17,384,21;410,17,411,18;412,17,413,18;191,18,192,19;193,18,194,19;262,18,264,21;290,18,291,19;312,18,313,19;384,18,387,21;411,18,412,19;413,18,414,19;189,19,190,20;219,19,221,21;264,19,266,21;291,19,292,20;311,19,312,20;340,19,343,21;387,19,389,21;412,19,413,20;414,19,415,20;188,20,189,21;217,20,219,21;266,20,268,21;292,20,293,21;310,20,311,21;"
        $sPixelRect &= "312,20,313,21;338,20,340,21;389,20,391,21;415,20,416,21;187,21,188,22;309,21,310,22;311,21,312,22;186,22,187,23;197,34,215,80;210,24,215,34;213,22,215,24;269,37,285,80;269,25,275,37;269,22,271,25;293,22,294,23;308,22,309,23;310,22,311,23;318,35,336,80;331,24,336,35;334,22,336,24;392,37,408,80;392,25,398,37;392,22,394,25;416,22,417,23;185,23,186,24;211,23,213,24;271,23,272,25;294,23,295,24;307,23,308,24;309,23,310,24;333,23,334,24;394,23,395,25;417,23,418,24;184,24,185,25;272,24,274,25;293,24,294,25;295,24,296,25;306,24,307,25;308,24,309,25;395,24,397,25;416,24,417,25;418,24,419,25;183,25,184,26;205,27,210,34;208,25,210,27;296,25,297,27;305,25,306,26;327,27,331,35;328,26,331,27;330,25,331,26;182,26,183,27;207,26,208,27;275,28,278,37;275,26,276,28;304,26,305,27;398,28,401,37;398,26,399,28;419,26,420,27;276,27,277,28;295,27,296,28;297,27,298,28;303,27,304,28;305,27,306,28;399,27,400,28;418,27,419,28;420,27,421,28;181,28,182,29;202,30,205,34;203,29,205,30;204,28,205,29;298,28,299,30;302,28,303,29;304,28,305,29;324,29,327,35;325,28,327,29;180,29,181,30;278,31,281,37;278,29,279,31;301,29,302,30;401,31,404,37;401,29,402,31;419,29,420,30;421,29,422,30;179,30,180,31;181,30,182,31;279,30,280,31;297,30,298,31;299,30,301,31;322,31,324,35;323,30,324,31;402,30,403,31;178,31,179,32;180,31,181,32;200,31,202,34;420,31,421,32;422,31,423,32;177,32,178,33;198,33,200,34;199,32,200,33;320,33,322,35;321,32,322,33;281,34,283,37;281,33,282,34;404,34,406,37;404,33,405,34;421,33,422,34;423,33,424,35;176,34,177,35;319,34,320,35;175,35,176,36;177,35,178,36;186,48,197,80;193,38,197,48;195,36,197,38;196,35,197,36;283,35,284,37;422,35,423,36;424,35,425,37;174,36,175,38;307,48,318,80;314,39,318,48;316,37,318,39;317,36,318,37;406,36,407,37;194,37,195,38;461,37,475,38;173,38,174,39;285,52,292,80;285,42,288,52;285,38,286,42;315,38,316,39;423,38,424,39;425,38,426,41;454,38,461,39;475,38,481,39;172,39,173,41;450,39,454,40;465,39,471,40;481,39,486,40;190,42,193,48;191,41,193,42;192,40,193,41;"
        $sPixelRect &= "286,40,287,42;311,43,314,48;312,41,314,43;313,40,314,41;408,46,411,64;408,42,410,46;408,40,409,42;446,40,449,41;455,40,457,41;478,40,480,41;486,40,489,41;131,41,148,42;171,41,172,42;426,41,427,45;443,41,446,42;450,41,452,42;484,41,485,42;489,41,492,42;126,42,130,43;149,42,152,43;170,42,171,44;424,42,425,43;440,42,443,43;487,42,488,43;492,42,494,43;123,43,126,44;132,43,134,44;146,43,147,44;153,43,155,44;188,45,190,48;189,43,190,45;437,43,440,44;443,43,444,44;494,43,496,44;120,44,123,45;127,44,128,45;151,44,152,45;156,44,158,45;169,44,170,46;171,44,172,45;288,46,290,52;288,44,289,46;309,45,311,48;310,44,311,45;435,44,437,45;493,44,494,45;497,44,498,45;118,45,120,46;154,45,155,46;158,45,160,46;427,45,428,49;433,45,435,46;495,45,496,46;498,45,500,46;116,46,118,47;121,46,122,47;160,46,162,47;168,46,169,47;170,46,171,47;187,46,188,48;431,46,433,47;497,46,498,47;500,46,502,47;114,47,116,48;162,47,163,48;308,47,309,48;425,47,426,49;429,47,430,48;433,47,434,48;499,47,500,48;502,47,503,48;113,48,114,49;164,48,165,49;167,48,168,49;169,48,170,49;428,48,429,49;501,48,502,49;504,48,505,49;111,49,113,50;165,49,166,50;180,59,186,80;183,53,186,59;184,51,186,53;185,49,186,51;290,49,291,52;429,49,430,50;506,49,507,51;505,49,506,50;110,50,111,51;164,50,165,51;166,50,167,51;168,50,169,51;300,59,307,80;304,53,307,59;305,51,307,53;306,50,307,51;427,50,428,51;504,50,505,51;507,50,508,51;108,51,110,52;111,51,112,52;508,51,509,52;107,52,108,53;509,52,510,53;106,53,107,54;411,53,412,56;508,53,509,54;510,53,511,54;105,54,106,55;107,54,108,55;292,62,296,80;292,57,294,62;292,54,293,57;302,56,304,59;303,54,304,56;407,154,575,315;426,68,504,154;460,54,476,68;512,54,513,55;103,55,105,56;181,56,183,59;182,55,183,56;450,56,460,68;454,55,460,56;476,56,484,68;476,55,481,56;513,55,514,56;102,56,103,57;514,56,515,57;101,57,102,58;54,121,144,241;116,66,144,121;131,58,148,66;137,57,143,58;301,57,302,59;442,59,450,68;447,57,450,59;484,58,489,68;484,57,487,58;515,57,516,58;100,58,101,60;445,58,447,59;"
        $sPixelRect &= "516,58,517,59;125,60,131,66;128,59,131,60;144,66,161,80;148,60,153,66;148,59,151,60;489,60,493,68;489,59,491,60;517,59,518,61;99,60,100,61;294,60,295,62;296,64,300,80;298,62,300,64;299,60,300,62;438,61,442,68;440,60,442,61;98,61,99,62;121,62,125,66;123,61,125,62;153,62,156,66;153,61,155,62;177,66,180,80;178,63,180,66;179,61,180,63;493,62,497,68;493,61,495,62;97,62,98,63;99,62,100,63;434,63,438,68;436,62,438,63;519,62,520,63;96,63,97,64;118,64,121,66;120,63,121,64;156,63,158,66;297,63,298,64;497,64,499,68;497,63,498,64;518,63,519,64;520,63,521,64;158,64,159,66;408,64,410,69;430,65,434,68;432,64,434,65;521,64,522,65;95,65,96,66;117,65,118,66;159,65,160,66;499,65,501,68;94,66,95,67;96,66,97,67;427,67,430,68;429,66,430,67;501,66,502,68;522,66,523,67;106,78,116,105;112,69,116,78;114,67,116,69;161,69,164,80;161,67,162,69;502,67,503,68;521,67,522,68;523,67,524,69;93,68,94,69;113,68,114,69;162,68,163,69;92,69,93,71;175,71,177,80;176,69,177,71;408,69,409,74;407,82,426,154;420,72,426,82;423,70,426,72;425,69,426,70;504,88,516,124;504,74,509,88;504,70,506,74;504,69,505,70;524,69,525,70;109,73,112,78;111,70,112,73;525,70,526,72;91,71,92,73;164,73,167,80;164,71,165,73;422,71,423,72;110,72,111,73;165,72,166,73;506,72,507,74;524,72,525,73;526,72,527,74;90,73,91,76;416,75,420,82;418,74,420,75;419,73,420,74;507,73,508,74;92,74,93,75;167,76,169,80;167,74,168,76;173,77,175,80;174,74,175,77;525,74,526,75;527,74,528,76;107,76,109,78;108,75,109,76;89,76,90,79;91,76,92,77;412,78,416,82;414,77,416,78;415,76,416,77;509,79,512,88;509,76,510,79;526,76,527,77;528,76,529,78;169,77,170,80;510,77,511,79;170,78,171,80;529,78,530,81;88,79,89,83;171,79,172,80;409,80,412,82;411,79,412,80;527,79,528,80;104,84,106,99;105,80,106,84;408,81,409,82;512,83,514,88;512,81,513,83;528,81,529,82;530,81,531,83;87,83,88,99;89,84,90,87;529,84,530,85;531,84,532,87;514,85,515,88;532,87,533,91;530,88,531,89;103,90,104,91;533,91,534,98;516,97,518,114;516,92,517,97;531,92,532,94;89,96,90,98;74,98,87,99;534,98,535,113;"
        $sPixelRect &= "67,99,74,100;105,99,106,103;63,100,67,101;76,100,87,101;59,101,63,102;68,101,70,102;532,101,533,110;56,102,59,103;63,102,64,103;54,103,56,104;60,103,61,104;51,104,53,105;49,105,51,106;54,105,55,106;110,105,116,115;107,105,110,108;47,106,49,107;45,107,47,108;49,107,50,108;43,108,45,109;47,108,48,109;109,108,110,112;108,108,109,110;42,109,43,110;45,109,46,110;40,110,41,111;38,111,40,112;37,112,38,113;40,112,41,113;546,112,565,113;36,113,37,114;533,113,534,117;541,113,545,114;565,113,570,114;34,114,36,115;37,114,38,115;516,114,517,120;537,114,540,115;546,114,548,115;549,114,550,115;560,114,562,115;563,114,564,115;570,114,574,115;33,115,34,116;72,115,90,121;112,115,116,119;111,115,112,117;534,115,537,116;541,115,543,116;568,115,569,116;574,115,577,116;32,116,33,117;67,116,72,121;90,116,96,121;538,116,539,117;572,116,573,117;577,116,579,117;31,117,32,118;33,117,34,118;61,118,67,121;64,117,67,118;96,117,99,121;575,117,576,118;580,117,582,118;29,118,31,119;99,118,103,121;531,118,533,119;578,118,579,119;582,118,584,119;28,119,29,120;58,119,61,121;103,119,107,121;113,119,116,121;584,119,586,120;27,120,28,121;56,120,58,121;107,120,111,121;586,120,587,121;26,121,27,122;588,121,589,122;25,122,26,123;23,151,54,217;44,127,54,151;50,123,54,127;52,122,54,123;589,122,591,123;24,123,25,124;588,123,589,124;591,123,592,124;23,124,24,125;48,124,50,127;504,124,512,136;512,124,515,128;592,124,594,125;22,125,23,126;45,126,48,127;47,125,48,126;594,125,595,126;21,126,22,127;595,126,596,127;20,127,21,128;594,127,595,128;596,127,598,128;37,133,44,151;42,129,44,133;43,128,44,129;512,128,514,131;542,130,569,154;553,128,558,130;598,128,599,129;19,129,20,130;545,129,553,130;558,129,565,130;599,129,600,130;18,130,19,131;40,130,42,133;600,130,601,131;17,131,18,132;19,131,20,132;38,132,40,133;39,131,40,132;512,131,513,133;532,134,542,154;539,131,542,134;569,134,579,154;569,131,572,134;601,131,602,132;16,132,17,133;536,132,539,134;572,132,575,134;602,132,603,133;534,133,536,134;575,133,577,134;"
        $sPixelRect &= "603,133,604,134;15,134,16,135;32,138,37,151;35,135,37,138;36,134,37,135;604,134,605,135;14,135,15,136;16,135,17,136;525,139,532,154;529,136,532,139;531,135,532,136;575,154,584,270;579,139,586,154;579,136,582,139;579,135,581,136;605,135,606,136;13,136,14,138;33,137,35,138;34,136,35,137;504,136,509,145;509,136,511,139;526,138,529,139;528,137,529,138;582,137,584,139;606,137,607,138;12,138,13,139;584,138,585,139;607,138,608,139;11,139,12,141;28,143,32,151;30,141,32,143;31,139,32,141;509,139,510,142;606,139,607,140;608,139,609,140;520,143,525,154;522,141,525,143;524,140,525,141;584,156,600,183;586,144,592,156;586,141,589,144;586,140,588,141;10,141,11,142;12,141,13,142;609,141,610,142;29,142,30,143;521,142,522,143;589,142,590,144;608,142,609,143;610,142,611,143;9,143,10,144;590,143,591,144;8,144,9,146;516,146,520,154;517,145,520,146;519,144,520,145;611,144,612,145;26,146,28,151;27,145,28,146;504,145,507,151;507,145,508,148;592,148,595,156;592,145,593,148;612,145,613,147;7,146,8,148;593,146,594,148;513,148,516,154;515,147,516,148;613,147,614,149;6,148,7,150;8,148,9,149;24,149,26,151;25,148,26,149;511,150,513,154;512,149,513,150;595,151,597,156;595,149,596,151;614,149,615,151;5,150,6,152;504,151,506,154;508,152,511,154;510,151,511,152;4,152,5,155;597,152,598,156;613,152,614,153;615,152,616,154;15,172,23,199;19,159,23,172;21,155,23,159;22,153,23,155;507,153,508,154;584,154,586,156;598,154,599,156;616,154,617,157;3,155,4,157;5,155,6,156;614,155,615,156;2,157,3,160;20,157,21,159;4,158,5,159;615,158,616,159;617,158,618,162;600,162,602,177;600,159,601,162;1,160,2,163;3,161,4,162;17,165,19,172;18,162,19,165;618,162,619,177;0,164,1,167;2,164,3,165;616,164,617,168;1,168,2,170;16,168,17,172;0,172,1,176;616,172,617,175;600,177,601,180;617,177,618,182;14,179,15,193;615,180,616,181;616,182,617,185;584,183,595,192;595,183,598,187;598,183,599,185;615,185,616,188;595,187,597,189;614,188,615,190;595,189,596,190;612,189,613,190;613,190,614,192;611,191,612,192;584,192,591,197;"
        $sPixelRect &= "591,192,593,195;593,192,594,193;612,192,613,194;610,193,611,194;611,194,612,196;591,195,592,196;609,195,610,196;0,196,1,199;610,196,611,197;584,197,588,201;588,197,590,198;611,197,613,198;588,198,589,199;613,198,615,199;17,199,23,206;16,199,17,203;615,199,617,200;614,200,615,201;617,200,619,201;1,201,2,203;584,201,586,203;586,201,587,202;619,201,620,202;620,202,622,203;584,203,585,204;619,203,620,204;622,203,623,204;0,204,1,207;623,204,624,205;622,205,623,206;624,205,626,206;2,206,3,207;19,206,23,210;18,206,19,208;584,214,610,267;584,207,590,214;584,206,586,207;626,206,627,207;1,207,2,210;627,207,628,208;590,209,598,214;590,208,594,209;628,208,629,209;3,209,4,210;629,209,630,210;2,210,3,213;21,210,23,214;20,210,21,212;598,210,601,214;630,210,631,211;601,211,604,214;631,211,632,212;604,212,606,214;632,212,633,214;3,213,4,215;606,213,608,214;5,214,6,215;22,214,23,216;633,214,634,215;4,215,5,217;610,226,623,253;610,217,615,226;610,215,612,217;632,215,633,216;634,215,635,216;6,216,7,217;612,216,613,217;635,216,636,218;5,217,6,219;35,217,54,230;28,217,35,224;25,217,28,220;24,217,25,219;7,218,8,219;615,220,618,226;615,218,616,220;634,218,635,219;636,218,637,219;6,219,7,221;616,219,617,220;8,220,9,221;27,220,28,222;26,220,27,221;637,220,638,221;7,221,8,223;618,222,620,226;618,221,619,222;638,222,639,223;8,223,9,224;620,223,621,226;9,224,10,226;31,224,35,227;30,224,31,226;29,224,30,225;637,224,638,225;639,224,640,226;621,225,622,226;10,226,11,227;11,227,12,228;32,227,35,228;638,227,639,228;34,228,35,229;623,235,626,244;623,228,624,235;12,229,13,230;14,229,15,230;13,230,14,231;15,230,16,231;43,230,54,236;37,230,43,232;36,230,37,231;639,230,640,232;14,231,15,232;624,231,625,235;15,232,16,233;40,232,43,234;39,232,40,233;16,233,17,234;42,234,43,235;17,235,18,236;18,236,19,237;47,236,54,238;45,236,47,237;19,237,20,238;20,238,21,239;51,238,54,240;49,238,51,239;21,239,23,240;23,240,24,241;25,240,26,241;53,240,54,241;24,241,25,242;89,241,144,250;67,241,89,246;58,241,67,243;"
        $sPixelRect &= "55,241,58,242;25,242,26,243;26,243,27,244;64,243,67,245;61,243,64,244;27,244,29,245;623,244,625,248;29,245,30,246;30,246,32,247;33,246,34,247;76,246,89,248;71,246,76,247;32,247,33,248;639,247,640,249;33,248,35,249;81,248,89,249;623,248,624,251;35,249,36,250;36,250,38,251;40,250,41,251;101,250,122,251;38,251,40,252;42,251,43,252;111,281,144,355;135,258,144,281;141,252,144,258;143,251,144,252;638,251,639,252;40,252,42,253;44,252,45,253;42,253,44,254;139,254,141,258;140,253,141,254;610,253,619,259;619,253,622,255;639,253,640,256;44,254,46,255;46,255,48,256;51,255,52,256;137,256,139,258;138,255,139,256;619,255,621,256;48,256,51,257;54,256,55,257;619,256,620,258;638,256,639,258;51,257,53,258;57,257,58,258;136,257,137,258;53,258,56,259;60,258,61,259;637,258,638,260;56,259,59,260;128,264,135,281;132,260,135,264;134,259,135,260;610,259,616,262;616,259,618,260;635,259,636,260;59,260,63,261;67,260,69,261;616,260,617,261;636,260,637,262;63,261,66,262;72,261,73,262;130,262,132,264;131,261,132,262;67,262,71,263;77,262,79,263;610,262,614,264;614,262,615,263;635,262,636,263;71,263,76,264;84,263,86,264;129,263,130,264;76,264,82,265;93,264,97,265;610,264,613,265;632,264,633,265;634,264,635,265;82,265,90,266;122,269,128,281;126,266,128,269;127,265,128,266;610,265,611,266;633,265,634,266;91,266,104,267;102,267,103,268;104,267,105,268;123,268,126,269;125,267,126,268;584,267,599,271;599,267,606,269;606,267,608,268;632,267,633,268;101,268,102,269;103,268,104,269;629,268,630,269;631,268,632,269;100,269,101,270;599,269,603,270;628,269,629,270;630,269,631,270;99,270,100,271;118,273,122,281;120,271,122,273;121,270,122,271;582,270,584,271;627,270,628,271;629,270,630,271;575,287,586,314;575,276,579,287;575,272,577,276;575,271,576,272;626,271,627,272;628,271,629,272;98,272,99,273;119,272,120,273;625,272,626,273;627,272,628,273;97,273,98,274;99,273,100,274;624,273,625,274;626,273,627,274;96,274,97,275;577,274,578,276;623,274,624,275;625,274,626,275;115,277,118,281;116,276,118,277;"
        $sPixelRect &= "117,275,118,276;624,275,625,276;95,276,96,277;623,276,624,277;94,277,95,278;96,277,97,278;579,280,582,287;579,277,580,280;619,277,620,278;621,277,623,278;93,278,94,280;113,279,115,281;114,278,115,279;620,278,621,279;580,279,581,280;618,279,620,280;92,280,93,281;94,280,95,281;112,280,113,281;617,280,618,281;91,281,92,283;615,281,617,282;582,283,584,287;582,282,583,283;609,282,610,283;613,282,615,283;90,283,91,284;92,283,93,284;98,304,111,335;106,288,111,304;109,284,111,288;110,283,111,284;606,283,607,284;611,283,613,284;601,284,603,285;608,284,610,285;89,285,90,286;108,285,109,288;584,285,585,287;600,285,601,286;604,285,607,286;88,286,89,288;603,286,604,291;602,286,603,287;107,287,108,288;87,288,88,290;601,288,602,289;586,296,589,305;586,289,587,296;86,290,87,292;88,290,89,291;102,295,106,304;104,291,106,295;105,290,106,291;604,291,605,298;85,292,86,294;587,292,588,296;602,292,603,294;103,293,104,295;84,295,85,297;86,295,87,296;83,297,84,299;85,297,86,298;100,299,102,304;101,297,102,299;605,299,606,303;82,300,83,303;84,300,85,301;99,302,100,304;81,303,82,307;604,303,605,310;83,304,84,305;586,305,588,309;80,307,81,313;602,307,603,309;82,308,83,309;96,312,98,328;97,308,98,312;586,309,587,312;603,310,604,314;601,312,602,313;79,313,80,327;575,314,583,320;583,314,585,316;602,314,603,317;81,315,82,325;423,315,488,380;404,335,423,355;407,315,423,335;488,315,509,348;509,315,513,329;513,315,514,322;536,315,565,335;523,315,536,324;518,315,523,318;517,315,518,317;516,315,517,316;565,315,575,329;583,316,584,318;601,317,602,319;520,318,523,321;519,318,520,319;599,318,600,319;575,320,580,324;580,320,582,321;598,320,599,321;600,320,601,321;522,321,523,323;521,321,522,322;580,321,581,322;597,322,598,323;599,322,600,323;528,324,536,329;525,324,528,326;524,324,525,325;575,324,578,326;578,324,579,325;596,324,597,325;598,324,599,325;597,325,598,327;527,326,528,328;526,326,527,327;575,326,577,327;80,327,81,333;575,327,576,328;596,327,597,328;97,328,98,332;595,328,596,330;509,329,512,336;"
        $sPixelRect &= "531,329,536,332;530,329,531,331;529,329,530,330;565,329,571,332;571,329,573,330;571,330,572,331;592,330,593,331;594,330,595,331;82,331,83,332;593,331,594,332;534,332,536,334;533,332,534,333;565,332,569,333;592,332,593,333;81,333,82,337;565,333,567,334;591,334,592,335;83,335,84,336;103,335,111,345;100,335,103,340;99,335,100,338;149,335,237,378;144,335,149,376;237,335,273,357;273,335,287,343;287,335,292,337;292,335,293,336;316,335,374,388;298,335,316,363;295,335,298,346;294,335,295,338;374,335,397,361;397,335,404,351;545,335,556,338;541,335,545,337;538,335,541,336;556,335,560,337;560,335,563,336;590,335,591,336;509,336,511,341;589,336,590,337;82,337,83,340;287,337,290,339;290,337,291,338;588,337,589,338;84,338,85,339;587,338,588,339;287,339,289,340;586,339,587,340;83,340,84,342;101,340,103,342;287,340,288,341;584,340,586,341;85,341,86,342;509,341,510,345;581,341,582,342;583,341,584,342;102,342,103,343;582,342,583,343;84,343,85,344;273,343,282,348;282,343,285,345;285,343,286,344;578,343,579,344;581,343,582,344;579,344,581,345;85,345,86,347;106,345,111,349;104,345,106,347;282,345,284,346;575,345,576,346;578,345,579,346;282,346,283,347;296,346,298,354;525,346,526,349;573,346,574,347;576,346,577,347;86,347,87,348;105,347,106,348;526,347,527,348;571,347,572,348;574,347,576,348;273,348,279,351;279,348,281,349;488,348,503,362;503,348,507,354;507,348,508,351;528,348,529,349;572,348,574,349;87,349,88,350;108,349,111,352;107,349,108,351;279,349,280,350;524,349,525,353;529,349,531,350;534,349,535,350;566,349,567,350;570,349,572,350;531,350,533,351;537,350,538,351;563,350,564,351;568,350,570,351;88,351,89,352;90,351,91,352;273,351,277,353;277,351,278,352;397,351,400,355;400,351,401,353;403,351,404,353;522,351,523,352;534,351,536,352;541,351,542,352;559,351,560,352;565,351,567,352;89,352,90,354;110,352,111,354;109,352,110,353;536,352,540,353;549,352,551,353;561,352,564,353;273,353,275,355;275,353,276,354;523,353,524,355;540,353,546,354;555,353,561,354;90,354,91,355;"
        $sPixelRect &= "92,354,93,355;297,354,298,359;503,354,505,358;505,354,506,356;521,354,522,355;546,354,555,355;91,355,92,356;124,355,144,366;116,355,124,360;113,355,116,357;112,355,113,356;273,355,274,356;397,355,399,357;411,355,423,367;407,355,411,360;406,355,407,358;405,355,406,356;522,356,523,358;92,357,93,358;94,357,95,358;115,357,116,359;114,357,115,358;237,357,260,367;260,357,268,361;268,357,271,359;271,357,272,358;397,357,398,359;520,357,521,358;93,358,94,359;95,358,96,359;503,358,504,360;521,358,522,361;94,359,95,360;268,359,269,360;95,360,96,361;120,360,124,363;119,360,120,362;118,360,119,361;408,360,411,362;260,361,266,363;266,361,267,362;374,361,390,373;390,361,395,365;395,361,396,363;520,361,521,363;96,362,97,363;410,362,411,365;409,362,410,363;488,362,498,370;498,362,502,364;97,363,98,364;123,363,124,365;122,363,123,364;260,363,263,365;263,363,264,364;304,363,316,375;300,363,304,368;299,363,300,366;519,363,520,365;98,364,99,365;498,364,500,367;500,364,501,365;517,364,518,365;99,365,100,366;260,365,261,366;390,365,394,367;518,365,519,367;100,366,101,367;133,366,144,371;128,366,133,368;126,366,128,367;516,366,517,367;101,367,102,368;237,367,251,372;251,367,256,369;256,367,258,368;390,367,392,370;392,367,393,368;415,367,423,372;413,367,415,370;412,367,413,368;498,367,499,368;517,367,518,369;102,368,103,369;131,368,133,370;129,368,131,369;282,369,284,370;283,368,284,369;302,368,304,372;301,368,302,370;103,369,104,370;251,369,255,370;285,369,286,370;516,369,517,371;104,370,105,371;251,370,253,371;280,370,282,371;284,370,285,373;390,370,391,371;414,370,415,371;488,370,494,374;494,370,496,372;496,370,497,371;105,371,107,372;137,371,144,373;135,371,137,372;277,371,278,372;279,371,280,372;515,371,516,372;107,372,108,373;109,372,110,373;237,372,245,375;245,372,249,373;278,372,279,373;303,372,304,374;418,372,423,376;417,372,418,374;416,372,417,373;494,372,495,373;514,372,515,374;108,373,109,374;141,373,144,375;139,373,141,374;245,373,247,374;277,373,278,374;285,373,286,375;"
        $sPixelRect &= "374,373,384,380;384,373,387,377;387,373,389,374;512,373,513,374;109,374,110,375;273,374,274,375;275,374,277,375;287,374,288,375;387,374,388,375;488,374,492,376;492,374,493,375;513,374,514,375;110,375,112,376;113,375,114,376;237,375,240,377;240,375,242,376;274,375,275,376;286,375,287,377;308,375,316,381;305,375,308,377;112,376,113,377;146,376,149,377;273,376,274,377;288,376,289,377;421,376,423,378;419,376,421,377;488,376,490,378;490,376,491,377;512,376,513,377;113,377,114,378;116,377,117,378;271,377,273,378;287,377,288,379;307,377,308,379;306,377,307,378;384,377,386,378;511,377,512,378;114,378,116,379;183,378,204,385;163,378,183,382;155,378,163,380;152,378,155,379;204,378,223,382;223,378,231,380;231,378,234,379;267,378,268,379;270,378,271,379;289,378,290,379;384,378,385,379;422,378,423,379;488,378,489,379;510,378,511,379;116,379,117,380;119,379,120,380;268,379,270,380;288,379,289,381;402,379,403,380;117,380,119,381;159,380,163,381;223,380,227,381;264,380,265,381;267,380,268,381;374,380,381,383;381,380,383,381;448,380,463,391;432,380,448,386;427,380,432,383;424,380,427,381;463,380,479,386;479,380,485,382;485,380,487,381;509,380,510,381;119,381,121,382;262,381,263,382;265,381,267,382;289,381,290,382;311,381,316,384;310,381,311,383;309,381,310,382;381,381,382,382;402,381,403,383;404,381,405,382;426,381,427,382;506,381,507,382;508,381,509,382;121,382,122,383;174,382,183,384;168,382,174,383;204,382,213,384;213,382,219,383;263,382,265,383;403,382,404,383;479,382,482,384;482,382,484,383;505,382,506,383;507,382,508,383;123,383,124,384;262,383,263,384;290,383,291,384;292,383,293,384;374,383,378,385;378,383,379,384;399,383,400,384;401,383,402,384;404,383,405,384;430,383,432,385;429,383,430,384;506,383,507,384;124,384,126,385;128,384,129,385;260,384,261,385;291,384,292,385;314,384,316,386;312,384,314,385;400,384,401,385;405,384,406,385;479,384,481,385;505,384,506,385;126,385,128,386;130,385,131,386;258,385,260,386;374,385,377,386;399,385,400,386;406,385,407,386;504,385,505,386;"
        $sPixelRect &= "128,386,130,387;256,386,258,387;292,386,293,387;315,386,316,387;374,386,375,387;398,386,399,387;407,386,408,387;440,386,448,389;437,386,440,388;434,386,437,387;463,386,474,388;474,386,477,387;503,386,504,387;130,387,132,388;254,387,256,388;293,387,294,388;295,387,296,388;502,387,503,388;132,388,134,389;137,388,138,389;248,388,249,389;252,388,254,389;294,388,295,389;337,388,352,396;323,388,337,392;320,388,323,390;318,388,320,389;352,388,366,392;366,388,370,390;370,388,372,389;397,388,398,389;409,388,410,389;463,388,468,390;468,388,471,389;501,388,502,389;134,389,136,390;249,389,252,390;295,389,296,390;396,389,397,390;410,389,411,390;412,389,413,390;443,389,448,390;498,389,499,390;500,389,501,390;137,390,139,391;142,390,143,391;243,390,244,391;247,390,249,391;296,390,297,391;321,390,323,391;366,390,368,391;395,390,396,391;411,390,412,391;413,390,414,391;499,390,500,391;139,391,142,392;145,391,146,392;240,391,241,392;245,391,247,392;394,391,395,392;412,391,413,392;498,391,499,392;142,392,144,393;148,392,149,393;237,392,238,393;242,392,244,393;297,392,298,393;329,392,337,394;326,392,329,393;352,392,361,394;361,392,364,393;393,392,394,393;413,392,414,393;496,392,498,393;145,393,147,394;234,393,235,394;239,393,242,394;298,393,299,394;392,393,393,394;414,393,416,394;417,393,418,394;495,393,496,394;148,394,151,395;155,394,156,395;230,394,231,395;236,394,239,395;299,394,300,395;332,394,337,395;352,394,357,395;390,394,392,395;416,394,417,395;494,394,495,395;151,395,154,396;159,395,160,396;226,395,227,396;232,395,235,396;300,395,302,396;387,395,388,396;389,395,390,396;417,395,418,396;420,395,421,396;492,395,494,396;155,396,158,397;164,396,165,397;222,396,223,397;229,396,232,397;302,396,303,397;304,396,305,397;388,396,389,397;419,396,420,397;488,396,489,397;491,396,492,397;159,397,163,398;169,397,171,398;216,397,217,398;224,397,228,398;303,397,304,398;387,397,388,398;420,397,422,398;489,397,491,398;163,398,168,399;177,398,179,399;208,398,210,399;219,398,224,399;304,398,305,399;"
        $sPixelRect &= "385,398,387,399;422,398,423,399;488,398,489,399;168,399,175,400;212,399,218,400;305,399,306,400;308,399,309,400;384,399,385,400;424,399,425,400;428,399,429,400;486,399,487,400;176,400,188,401;200,400,211,401;306,400,308,401;382,400,384,401;426,400,427,401;430,400,431,401;480,400,481,401;484,400,485,401;189,401,198,402;308,401,309,402;311,401,312,402;378,401,379,402;381,401,382,402;427,401,430,402;477,401,478,402;481,401,483,402;309,402,311,403;376,402,377,403;379,402,381,403;430,402,432,403;436,402,437,403;474,402,475,403;479,402,481,403;311,403,312,404;374,403,375,404;377,403,379,404;432,403,435,404;439,403,440,404;471,403,472,404;476,403,479,404;313,404,314,405;372,404,373,405;375,404,377,405;435,404,438,405;444,404,445,405;466,404,467,405;473,404,476,405;315,405,316,406;319,405,320,406;373,405,375,406;439,405,443,406;453,405,459,406;468,405,472,406;216,406,233,407;317,406,319,407;322,406,323,407;367,406,368,407;371,406,373,407;443,406,450,407;461,406,468,407;210,407,216,408;233,407,240,408;319,407,321,408;325,407,326,408;364,407,365,408;368,407,371,408;451,407,460,408;205,408,209,409;218,408,220,409;221,408,232,409;240,408,245,409;321,408,324,409;328,408,329,409;360,408,361,409;365,408,368,409;201,409,205,410;210,409,213,410;237,409,239,410;245,409,248,410;324,409,327,410;333,409,334,410;355,409,356,410;362,409,365,410;198,410,201,411;206,410,207,411;243,410,244,411;249,410,251,411;328,410,332,411;342,410,347,411;358,410,362,411;195,411,198,412;202,411,203,412;247,411,248,412;252,411,254,412;332,411,339,412;350,411,357,412;193,412,195,413;250,412,251,413;254,412,256,413;340,412,349,413;191,413,193,414;253,413,254,414;257,413,259,414;189,414,190,415;193,414,194,415;259,414,261,415;187,415,189,416;191,415,192,416;261,415,262,416;185,416,187,417;189,416,190,417;263,416,264,417;184,417,185,418;187,417,188,418;264,417,266,418;182,418,184,419;263,418,264,419;266,418,267,419;181,419,182,420;268,419,269,420;179,420,181,421;182,420,183,421;269,420,270,421;178,421,179,422;"
        $sPixelRect &= "270,421,271,422;177,422,178,423;269,422,270,423;271,422,272,423;176,423,177,424;200,427,250,476;215,423,235,427;272,423,274,424;175,424,176,425;177,424,178,425;210,424,215,427;235,424,240,427;274,424,275,425;174,425,175,426;206,425,210,427;240,425,244,427;173,426,174,427;175,426,176,427;202,426,206,427;244,426,247,427;172,427,173,428;174,427,175,428;276,427,277,428;171,428,172,429;185,437,200,467;196,429,200,437;198,428,200,429;250,437,265,466;250,429,254,437;250,428,252,429;277,428,278,429;170,429,171,430;278,429,279,430;192,431,196,437;194,430,196,431;254,431,257,437;254,430,256,431;277,430,278,431;279,430,280,431;169,431,170,432;280,431,281,433;168,432,169,433;170,432,171,433;189,433,192,437;191,432,192,433;257,433,260,437;257,432,259,433;281,433,282,434;167,434,168,435;187,435,189,437;188,434,189,435;260,434,261,437;282,434,283,436;166,435,167,437;168,435,169,436;261,435,263,437;186,436,187,437;263,436,264,437;283,436,284,438;165,437,166,439;167,437,168,438;179,447,185,457;182,441,185,447;183,439,185,441;184,438,185,439;284,438,285,440;164,439,165,442;265,445,270,458;265,440,267,445;265,439,266,440;267,441,268,445;283,441,284,442;285,441,286,444;163,442,164,446;180,444,182,447;181,442,182,444;268,443,269,445;286,444,287,450;284,445,285,446;162,446,163,458;164,447,165,450;270,449,271,455;287,450,288,453;286,453,287,460;164,454,165,457;181,457,185,462;180,457,181,460;163,458,164,462;265,458,269,461;284,458,285,459;165,460,166,461;285,460,286,463;265,461,267,464;267,461,268,462;164,462,165,464;183,462,185,465;182,462,183,463;166,463,167,464;284,463,285,465;265,464,266,465;165,465,166,467;184,465,185,466;250,466,260,471;260,466,263,468;263,466,264,467;283,466,284,467;166,467,167,468;191,467,200,472;187,467,191,469;186,467,187,468;260,468,262,469;282,468,283,469;167,469,168,470;188,469,191,470;260,469,261,470;168,470,169,472;190,470,191,471;279,470,280,471;281,470,282,471;250,471,257,473;257,471,258,472;280,471,281,472;169,472,170,473;171,472,172,473;194,472,200,474;"
        $sPixelRect &= "193,472,194,473;170,473,171,474;250,473,253,475;253,473,255,474;279,473,280,474;198,474,200,476;196,474,198,475;276,474,277,475;278,474,279,475;171,475,172,476;250,475,251,476;277,475,278,476;172,476,173,477;217,476,232,481;207,476,217,479;203,476,207,478;201,476,203,477;232,476,243,479;243,476,249,477;276,476,277,477;173,477,174,478;243,477,246,478;275,477,276,478;174,478,175,479;274,478,275,479;175,479,176,480;211,479,217,480;232,479,239,480;271,479,272,480;273,479,274,480;176,480,177,481;272,480,273,481;177,481,178,482;271,481,272,482;179,482,180,483;270,482,271,483;180,483,181,484;268,483,270,484;181,484,183,485;184,484,185,485;267,484,268,485;183,485,184,486;186,485,187,486;265,485,267,486;184,486,186,487;261,486,262,487;264,486,265,487;186,487,187,488;259,487,260,488;262,487,264,488;188,488,189,489;257,488,258,489;260,488,262,489;189,489,191,490;194,489,195,490;258,489,260,490;191,490,193,491;252,490,253,491;256,490,258,491;194,491,196,492;249,491,250,492;253,491,256,492;196,492,199,493;203,492,204,493;246,492,247,493;251,492,253,493;199,493,202,494;207,493,208,494;241,493,243,494;248,493,250,494;202,494,206,495;212,494,213,495;214,494,215,495;234,494,235,495;236,494,237,495;244,494,247,495;206,495,211,496;239,495,243,496;211,496,220,497;229,496,238,497;220,497,229,498;272,504,282,505;265,505,271,506;283,505,289,506;260,506,264,507;273,506,281,507;290,506,294,507;257,507,260,508;266,507,267,508;287,507,289,508;294,507,297,508;255,508,257,509;261,508,262,509;292,508,293,509;297,508,300,509;252,509,254,510;258,509,259,510;295,509,296,510;300,509,302,510;250,510,252,511;255,510,256,511;298,510,299,511;302,510,304,511;249,511,250,512;304,511,306,512;247,512,248,513;303,512,304,513;306,512,307,513;245,513,247,514;308,513,309,514;244,514,245,515;247,514,248,515;309,514,310,515;243,515,244,516;308,515,309,516;310,515,312,516;241,516,243,517;244,516,245,517;312,516,313,517;240,517,241,518;313,517,314,518;239,518,240,519;312,518,313,519;314,518,315,519;238,519,239,520;"
        $sPixelRect &= "313,519,314,520;315,519,316,520;237,520,238,521;314,520,315,521;316,520,317,521;236,521,237,522;259,524,295,557;270,521,284,524;315,521,316,522;317,521,318,522;265,522,270,524;284,522,289,524;318,522,319,523;235,523,236,524;262,523,265,524;289,523,292,524;234,524,235,525;319,524,320,525;233,525,234,527;249,531,259,550;255,526,259,531;257,525,259,526;295,531,305,550;295,526,299,531;295,525,297,526;318,525,319,526;320,525,321,526;321,526,322,528;232,527,233,529;234,527,235,528;252,528,255,531;254,527,255,528;299,528,302,531;299,527,301,528;322,528,323,530;231,529,232,531;233,529,234,530;250,530,252,531;251,529,252,530;302,529,303,531;303,530,304,531;323,530,324,533;230,531,231,534;246,536,249,546;247,534,249,536;248,532,249,534;305,535,308,546;305,532,306,535;306,533,307,535;324,533,325,538;229,534,230,547;322,534,323,535;231,535,232,536;308,538,309,543;325,538,326,543;245,539,246,542;324,544,325,548;231,545,232,546;247,546,249,548;305,546,307,548;322,546,323,548;230,548,231,550;248,548,249,549;305,548,306,549;323,548,324,551;232,549,233,550;231,550,232,552;253,550,259,554;251,550,253,552;250,550,251,551;295,550,301,554;301,550,303,552;303,550,304,551;322,551,323,553;252,552,253,553;301,552,302,553;320,552,321,553;232,553,233,554;321,553,322,555;257,554,259,556;255,554,257,555;295,554,298,556;298,554,299,555;319,554,320,555;233,555,234,556;235,555,236,556;320,555,321,556;234,556,235,557;295,556,296,557;268,557,286,560;264,557,268,559;261,557,264,558;286,557,290,559;290,557,293,558;319,557,320,558;235,558,236,559;316,558,317,559;318,558,319,559;236,559,237,560;238,559,239,560;317,559,318,560;237,560,238,561;239,560,240,561;316,560,317,561;238,561,239,562;240,561,241,562;315,561,316,562;239,562,240,563;241,562,242,563;312,562,313,563;314,562,315,563;240,563,241,564;311,563,312,564;313,563,314,564;241,564,242,565;312,564,313,565;242,565,243,566;245,565,246,566;311,565,312,566;243,566,245,567;310,566,311,567;245,567,246,568;248,567,249,568;305,567,306,568;308,567,309,568;"
        $sPixelRect &= "246,568,248,569;250,568,251,569;306,568,308,569;338,568,351,569;248,569,250,570;252,569,253,570;305,569,306,570;334,569,338,570;352,569,355,570;250,570,252,571;254,570,255,571;299,570,300,571;303,570,304,571;331,570,334,571;339,570,341,571;348,570,350,571;355,570,358,571;252,571,254,572;257,571,258,572;300,571,302,572;330,571,331,572;334,571,335,572;358,571,360,572;254,572,256,573;260,572,261,573;293,572,294,573;298,572,300,573;328,572,329,573;332,572,333,573;360,572,361,573;256,573,259,574;264,573,266,574;289,573,290,574;295,573,298,574;326,573,328,574;362,573,363,574;260,574,263,575;271,574,276,575;278,574,283,575;291,574,295,575;325,574,326,575;363,574,364,575;263,575,269,576;286,575,291,576;324,575,325,576;362,575,363,576;364,575,365,576;269,576,285,577;323,576,324,577;325,576,326,577;363,576,364,577;322,577,323,578;366,577,367,578;321,578,322,579;323,578,324,579;367,578,368,579;320,579,321,580;322,579,323,580;366,579,367,580;368,579,369,580;319,580,320,582;369,580,370,582;318,582,319,584;368,582,369,583;370,582,371,584;317,585,318,593;319,585,320,587;340,585,349,593;336,586,340,591;339,585,340,586;349,586,353,591;349,585,351,586;369,585,370,587;371,585,372,593;334,588,336,590;335,587,336,588;353,588,355,590;353,587,354,588;335,590,336,591;353,590,354,591;319,591,320,592;337,591,340,592;349,591,352,592;369,591,370,592;318,593,319,595;370,593,371,595;320,594,321,595;368,594,369,595;319,596,320,597;321,596,322,597;369,596,370,597;368,598,369,599;321,599,322,600;367,599,368,600;322,600,323,601;364,600,365,601;366,600,367,601;323,601,324,602;365,601,366,602;324,602,325,603;327,602,328,603;364,602,365,603;325,603,327,604;363,603,364,604;327,604,328,605;361,604,362,605;328,605,330,606;333,605,334,606;355,605,356,606;359,605,361,606;330,606,333,607;335,606,338,607;351,606,354,607;356,606,359,607"
    #endregion
    Local $aPixelRect = StringSplit($sPixelRect, ";", 2)
    Return $aPixelRect
EndFunc   ;==>_PixelCoordinates()


Func _PixelCoordinates3()
    #region pixel coordinates
    Local $sPixelRect
        $sPixelRect &= "425,349;184,0,194,1;230,0,242,1;176,1,181,2;244,1,249,2;166,2,173,3;253,2,259,3;162,3,166,4;259,3,263,4;155,4,156,5;157,4,160,5;265,4,269,5;150,5,154,6;271,5,276,6;146,6,149,7;98,29,327,254;186,7,239,29;204,6,221,7;276,6,279,7;141,7,144,8;280,7,284,8;137,8,140,9;169,9,186,29;176,8,186,9;239,9,256,29;239,8,249,9;285,8,287,9;115,9,116,10;133,9,136,10;289,9,293,10;129,10,132,11;157,11,169,29;163,10,169,11;256,11,268,29;256,10,262,11;293,10,296,11;126,11,128,12;297,11,298,12;122,12,125,13;147,13,157,29;151,12,157,13;268,13,278,29;268,12,274,13;300,12,303,13;120,13,122,14;303,13,305,14;116,14,119,15;139,15,147,29;143,14,147,15;278,15,286,29;278,14,282,15;306,14,309,15;114,15,116,16;309,15,312,16;111,16,113,17;131,17,139,29;134,16,139,17;286,17,294,29;286,16,291,17;312,16,314,17;93,17,94,18;108,17,110,18;315,17,317,18;106,18,107,19;124,19,131,29;128,18,131,19;294,19,301,29;294,18,297,19;318,18,319,19;102,19,105,20;320,19,322,20;100,20,102,21;118,21,124,29;121,20,124,21;301,21,307,29;301,20,304,21;322,20,324,21;98,21,100,22;325,21,327,22;95,22,98,23;112,23,118,29;115,22,118,23;307,23,313,29;307,22,310,23;328,22,330,23;94,23,95,24;330,23,332,24;90,24,93,25;107,25,112,29;110,24,112,25;313,25,318,29;313,24,315,25;332,24,334,25;89,25,91,26;334,25,336,26;336,26,338,27;337,25,338,26;87,26,88,27;105,26,107,29;318,26,320,29;85,27,86,28;102,27,105,29;320,27,323,29;340,27,341,29;339,27,340,28;350,27,351,28;80,29,83,30;81,28,82,29;83,28,85,29;100,28,102,29;323,28,325,29;342,28,343,30;341,28,342,29;32,76,98,207;81,37,98,76;93,31,98,37;95,30,98,31;97,29,98,30;327,76,393,207;327,37,344,76;327,30,330,37;327,29,328,30;343,29,344,30;79,30,81,31;344,30,346,31;346,31,348,32;347,30,348,31;77,31,79,32;330,32,334,37;330,31,332,32;75,32,77,33;89,33,93,37;91,32,93,33;348,32,350,33;72,33,73,35;74,33,75,34;334,34,338,37;334,33,336,34;350,33,352,34;356,33,357,34;65,34,66,35;87,34,89,37;352,34,353,35;70,35,72,36;85,35,87,37;338,35,340,37;353,35,355,36;68,36,70,37;83,36,85,37;340,36,342,37;"
        $sPixelRect &= "355,36,357,37;67,37,68,38;357,37,358,38;65,38,67,39;68,45,81,76;78,39,81,45;79,38,81,39;344,45,357,76;344,39,347,45;344,38,346,39;358,38,361,39;64,39,65,40;361,39,362,41;360,39,361,40;62,40,64,41;74,41,78,45;76,40,78,41;347,41,351,45;347,40,349,41;362,40,363,41;61,41,62,42;363,41,364,42;364,42,366,43;365,41,366,42;59,42,61,43;72,42,74,45;351,42,353,45;52,43,53,44;58,43,59,44;69,44,72,45;71,43,72,44;353,43,354,45;367,43,368,45;366,43,367,44;56,44,58,45;354,44,356,45;368,44,369,45;374,44,375,45;52,45,53,46;55,45,56,46;369,45,370,46;54,46,55,47;58,52,68,76;65,47,68,52;66,46,68,47;357,52,367,76;357,47,360,52;357,46,359,47;371,46,372,48;370,46,371,47;52,47,54,48;46,48,47,49;51,48,52,49;62,49,65,52;63,48,65,49;360,49,363,52;360,48,362,49;373,48,374,49;382,48,383,49;50,49,51,50;374,49,375,50;48,50,50,51;60,50,62,52;363,50,365,52;375,50,376,51;47,51,48,52;59,51,60,52;365,51,366,52;377,51,378,52;46,52,47,53;378,52,379,53;44,53,46,54;50,58,58,76;55,54,58,58;56,53,58,54;367,58,375,76;367,54,370,58;367,53,369,54;380,53,381,55;379,53,380,54;382,53,383,54;41,54,42,55;44,54,45,55;42,55,44,56;52,56,55,58;54,55,55,56;370,55,371,58;381,55,383,56;34,56,35,57;41,56,42,57;371,56,373,58;383,56,384,57;40,57,41,58;51,57,52,58;373,57,374,58;384,57,385,58;390,57,391,58;39,58,40,59;385,58,386,59;38,59,39,60;44,63,50,76;48,60,50,63;49,59,50,60;375,62,380,76;375,59,376,62;386,59,387,60;36,60,38,61;376,60,377,62;387,60,388,61;36,61,37,62;46,61,48,63;377,61,379,62;388,61,389,62;35,62,36,63;45,62,46,63;389,62,390,63;34,63,35,64;380,66,384,76;380,63,381,66;390,63,391,64;33,64,34,65;40,67,44,76;42,65,44,67;43,64,44,65;381,64,382,66;391,64,392,65;32,65,33,66;382,65,383,66;392,65,393,66;31,66,32,67;41,66,42,67;393,66,394,67;30,67,31,68;384,69,387,76;384,67,385,69;394,67,395,68;26,68,27,69;29,68,30,69;37,70,40,76;38,69,40,70;39,68,40,69;385,68,386,69;395,68,396,69;28,70,29,71;387,71,389,76;387,70,388,71;396,70,397,71;26,71,28,72;35,72,37,76;36,71,37,72;397,71,398,72;26,72,27,73;389,73,391,76;"
        $sPixelRect &= "389,72,390,73;398,72,399,73;25,73,26,74;34,73,35,76;399,73,400,74;21,74,22,75;24,74,25,75;400,74,401,75;33,75,34,76;391,75,392,76;23,76,24,77;401,76,402,77;22,77,23,78;9,118,32,165;22,89,32,118;28,81,32,89;30,78,32,81;31,77,32,78;393,118,416,165;393,88,402,118;393,79,396,88;393,77,394,79;402,77,403,78;21,78,22,79;394,78,395,79;403,78,404,79;19,80,21,81;20,79,21,80;29,79,30,81;404,79,405,81;405,80,406,82;19,81,20,82;396,82,398,88;396,81,397,82;18,82,19,84;26,83,28,89;27,82,28,83;406,82,407,84;398,83,399,88;17,84,18,85;407,84,408,85;24,86,26,89;25,85,26,86;399,85,400,88;408,85,409,87;15,86,17,87;400,86,401,88;409,86,410,88;14,87,16,88;14,88,15,90;23,88,24,89;410,88,411,90;402,98,408,118;402,91,404,98;402,89,403,91;414,89,415,90;12,91,14,92;13,90,14,91;411,90,412,92;16,100,22,118;19,94,22,100;20,92,22,94;21,91,22,92;12,92,13,93;404,94,406,98;404,92,405,94;412,92,413,93;11,94,12,95;413,94,415,95;10,96,11,97;17,98,19,100;18,96,19,98;406,96,407,98;414,96,415,97;415,97,416,99;419,97,420,99;9,98,10,99;8,100,9,102;408,106,412,118;408,102,410,106;408,100,409,102;416,100,417,102;7,102,8,104;13,106,16,118;14,104,16,106;15,102,16,104;417,102,418,104;410,104,411,106;3,105,4,106;6,105,7,106;418,105,419,106;421,105,422,106;5,107,6,109;419,107,420,109;11,112,13,118;12,109,13,112;412,112,414,118;412,109,413,112;4,110,5,112;420,110,421,112;3,113,4,116;421,113,422,116;10,114,11,118;414,114,415,118;2,116,3,119;422,116,423,120;1,121,2,124;423,121,424,124;6,138,9,145;7,127,9,138;8,122,9,127;416,138,419,144;416,127,418,138;416,122,417,127;0,125,1,132;424,125,425,132;416,144,418,155;7,145,9,155;0,151,1,157;424,151,425,157;8,155,9,160;416,155,417,160;1,158,2,162;423,158,424,162;2,163,3,167;422,163,423,167;16,165,32,183;12,165,16,174;11,165,12,171;10,165,11,168;393,165,409,183;409,165,414,171;414,165,415,168;3,167,4,170;421,167,422,170;4,170,5,172;420,170,421,172;409,171,413,174;5,173,6,176;419,173,420,176;422,173,423,174;14,174,16,179;13,174,14,176;409,174,411,179;411,174,412,176;"
        $sPixelRect &= "6,176,7,178;418,176,419,178;7,179,8,181;15,179,16,181;409,179,410,181;417,179,418,181;8,181,9,183;416,181,417,183;420,182,421,183;9,183,10,185;21,183,32,192;18,183,21,187;17,183,18,185;393,183,403,194;403,183,407,187;407,183,408,185;415,183,416,185;422,183,423,184;10,185,11,187;414,185,415,187;11,187,12,189;19,187,21,189;403,187,406,189;413,187,414,189;12,189,13,191;20,189,21,190;403,189,405,190;412,189,413,191;403,190,404,192;13,191,14,192;411,191,412,193;25,192,32,198;22,192,25,194;14,193,15,194;410,193,411,194;14,195,16,196;15,194,16,195;24,194,25,196;23,194,24,195;393,194,399,199;399,194,401,197;401,194,402,195;409,194,410,196;410,195,411,196;16,196,17,197;408,196,409,197;399,197,400,198;17,198,18,199;28,198,32,202;27,198,28,201;26,198,27,199;407,198,408,199;18,199,19,200;393,199,397,202;397,199,398,201;406,199,407,200;19,201,20,202;405,201,406,202;20,202,21,203;30,202,32,205;29,202,30,203;393,202,395,205;395,202,396,203;404,202,405,203;21,203,22,205;403,203,404,205;22,205,23,206;31,205,32,206;393,205,394,206;402,205,403,206;23,206,24,207;401,206,402,207;24,207,25,209;57,207,98,230;41,207,57,217;36,207,41,211;34,207,36,209;33,207,34,208;327,207,368,230;368,207,384,217;384,207,390,210;390,207,392,208;400,207,401,209;406,207,407,208;390,208,391,209;25,209,26,210;35,209,36,210;399,209,400,210;26,210,27,211;384,210,388,212;388,210,389,211;398,210,399,211;27,211,28,212;39,211,41,215;38,211,39,213;37,211,38,212;397,211,398,212;28,212,29,213;384,212,386,215;386,212,387,213;396,212,397,213;29,213,30,215;394,214,397,215;395,213,396,214;30,214,31,215;31,215,32,217;40,215,41,216;384,215,385,216;393,215,395,216;393,216,394,217;48,217,57,223;44,217,48,219;43,217,44,218;368,217,378,222;378,217,381,219;381,217,382,218;391,217,393,218;397,217,398,218;33,218,34,219;391,218,392,219;34,219,35,221;46,219,48,221;45,219,46,220;378,219,380,220;35,220,36,221;378,220,379,221;36,221,37,222;47,221,48,222;388,221,389,222;37,222,39,223;368,222,375,225;375,222,377,223;386,222,387,223;"
        $sPixelRect &= "52,223,57,226;50,223,52,225;49,223,50,224;375,223,376,224;387,223,388,224;40,224,41,225;383,225,385,226;384,224,385,225;41,225,42,226;368,225,372,227;372,225,373,226;42,226,43,228;54,226,57,228;53,226,54,227;382,226,383,227;43,227,44,228;368,227,370,229;370,227,371,228;381,227,382,228;44,228,45,229;55,228,57,229;380,228,381,229;45,229,46,230;47,230,48,232;46,230,47,231;73,230,98,241;64,230,73,235;59,230,64,232;58,230,59,231;327,230,352,241;352,230,361,235;361,230,366,232;366,230,367,231;377,230,379,231;48,231,49,232;376,231,377,232;49,232,50,233;62,232,64,234;61,232,62,233;361,232,363,234;363,232,364,233;375,232,376,233;50,233,51,234;374,233,375,234;51,234,53,235;372,234,374,235;53,235,54,236;68,235,73,238;65,235,68,236;352,235,358,237;358,235,360,236;371,235,372,236;54,236,55,237;67,236,68,237;370,236,371,237;375,236,376,237;55,237,57,238;352,237,355,239;355,237,357,238;369,237,370,239;368,237,369,238;57,238,58,239;71,238,73,240;70,238,71,239;367,238,368,239;58,239,60,240;352,239,354,240;365,239,367,240;60,240,61,241;364,240,365,241;59,241,60,242;61,241,63,242;84,241,98,247;78,241,84,244;76,241,78,243;75,241,76,242;327,241,341,247;341,241,347,244;347,241,349,243;349,241,350,242;363,241,364,243;362,241,363,242;63,242,64,243;361,242,362,243;366,242,367,243;65,243,66,244;359,243,360,244;66,244,67,245;82,244,84,246;80,244,82,245;341,244,345,245;358,244,359,245;67,245,69,246;341,245,343,246;356,245,357,246;69,246,70,247;355,246,356,247;71,247,72,248;89,247,98,250;87,247,89,249;85,247,87,248;327,247,335,250;335,247,338,249;338,247,340,248;353,247,354,248;73,248,74,249;351,248,352,249;74,249,76,250;350,249,351,251;349,249,350,250;76,250,78,251;94,250,98,252;92,250,94,251;327,250,331,252;331,250,333,251;348,250,349,251;360,250,364,251;78,251,79,252;346,251,347,252;354,251,358,252;366,251,370,252;80,252,81,253;96,252,98,253;327,252,329,253;344,252,345,253;350,252,352,253;372,252,373,253;82,253,83,254;342,253,343,254;348,253,350,254;375,253,376,254;83,254,85,255;"
        $sPixelRect &= "191,254,234,276;140,254,191,268;116,254,140,261;106,254,116,257;103,254,106,256;101,254,103,255;234,254,289,267;289,254,312,260;312,254,322,256;322,254,324,255;340,254,342,255;346,254,347,255;377,254,378,255;379,254,380,256;382,254,383,255;86,255,87,256;338,255,339,256;340,255,341,256;344,255,345,256;380,255,381,257;88,256,89,257;312,256,317,258;317,256,319,257;336,256,337,257;342,256,344,257;350,258,374,280;357,256,367,258;90,257,91,258;111,257,116,259;108,257,111,258;334,257,336,258;337,257,338,258;341,257,342,258;352,257,357,258;367,257,371,258;382,257,383,258;387,257,388,258;92,258,94,259;312,258,314,259;331,258,333,259;340,258,341,259;383,258,384,259;386,258,387,259;94,259,96,260;113,259,116,260;329,259,331,260;334,259,335,260;343,263,350,276;346,260,350,263;348,259,350,260;374,263,381,276;374,260,378,263;374,259,376,260;384,259,385,260;97,260,99,261;289,260,302,263;302,260,306,262;306,260,309,261;327,260,328,261;338,260,339,262;385,260,386,262;99,261,101,262;126,261,140,264;122,261,126,263;119,261,122,262;324,261,326,262;333,261,334,262;344,262,346,263;345,261,346,262;378,261,379,263;101,262,103,263;321,262,324,263;327,262,328,263;337,262,338,264;379,262,380,263;386,262,387,263;104,263,106,264;289,263,296,265;296,263,299,264;319,263,321,264;106,264,108,265;132,264,140,266;129,264,132,265;317,264,319,265;336,264,337,266;341,266,343,272;342,264,343,266;381,266,383,273;381,264,382,266;387,264,388,266;109,265,111,266;289,265,293,266;314,265,316,266;112,266,114,267;136,266,140,267;311,266,314,267;388,266,389,272;115,267,117,268;234,267,266,272;266,267,277,270;277,267,285,268;308,267,310,268;335,267,336,272;118,268,120,269;165,268,191,273;153,268,165,271;148,268,153,270;144,268,148,269;277,268,281,269;305,268,307,269;120,269,123,270;302,269,304,270;390,269,391,271;124,270,126,271;266,270,272,271;299,270,301,271;127,271,130,272;159,271,165,272;295,271,298,272;131,272,134,273;234,272,254,274;254,272,260,273;291,272,294,273;342,272,343,274;390,272,391,273;"
        $sPixelRect &= "134,273,138,274;179,273,191,275;171,273,179,274;287,273,291,274;336,273,337,275;381,273,382,274;387,273,388,275;139,274,142,275;234,274,246,275;283,274,286,275;143,275,146,276;279,275,282,276;337,275,338,277;386,275,387,277;143,276,144,277;146,276,150,277;275,276,279,277;345,276,350,278;344,276,345,277;374,276,379,278;379,276,380,277;153,277,156,278;269,277,272,278;338,277,339,278;385,277,386,278;157,278,162,279;263,278,267,279;339,278,340,280;347,278,350,279;374,278,377,279;384,278,385,279;163,279,168,280;257,279,262,280;340,279,341,281;349,279,350,280;374,279,375,280;170,280,175,281;250,280,255,281;341,280,342,281;359,280,365,283;354,280,359,282;351,280,354,281;365,280,371,282;371,280,373,281;383,280,384,282;382,280,383,281;176,281,186,282;240,281,248,282;342,281,343,282;381,281,382,282;192,282,202,283;224,282,234,283;343,282,344,283;380,282,381,283;344,283,346,284;378,283,380,284;340,284,341,285;347,284,348,285;376,284,378,285;348,285,350,286;374,285,376,286;247,286,248,287;347,286,348,287;350,286,354,287;370,286,373,287;356,287,368,288;382,287,383,288;343,289,344,291;344,290,350,291;335,291,340,292;353,291,357,292;333,292,336,293;357,292,359,293;331,293,333,294;360,293,362,294;329,294,331,295;362,294,363,295;328,295,329,296;336,297,356,316;341,295,352,297;363,295,364,296;327,296,328,297;337,296,341,297;352,296,356,297;365,296,366,297;326,297,327,298;330,300,336,312;334,297,336,300;356,300,363,312;356,297,358,300;366,297,367,298;325,298,326,299;332,298,334,300;358,298,360,300;324,299,325,300;331,299,332,300;360,299,362,300;323,300,324,302;368,300,369,301;327,304,330,308;328,302,330,304;329,301,330,302;363,303,365,310;363,301,364,303;369,302,370,304;322,304,323,308;365,306,366,307;328,308,330,310;369,308,370,311;323,310,324,312;329,310,330,311;363,310,364,311;368,311,369,313;324,312,325,313;332,312,336,314;331,312,332,313;356,312,361,314;361,312,362,313;325,313,326,315;367,313,368,314;326,314,327,315;334,314,336,315;356,314,359,315;366,314,367,315;327,315,328,316;"
        $sPixelRect &= "365,315,366,316;322,316,323,317;328,316,329,317;340,316,353,317;364,316,365,317;329,317,330,318;362,317,363,318;365,317,366,318;325,318,326,319;331,318,332,319;360,318,361,319;333,319,335,320;358,319,360,320;336,320,338,321;354,320,357,321;340,321,353,322;329,323,332,324;323,324,326,325;336,324,338,325;319,325,322,326;340,325,342,326;317,326,319,327;342,326,344,327;316,327,317,328;344,327,346,328;314,328,316,329;321,329,340,344;324,328,338,329;346,328,347,329;313,329,314,330;347,329,348,330;312,330,313,332;316,332,321,341;319,330,321,332;340,332,345,341;340,330,342,332;348,330,349,331;317,331,319,332;342,331,344,332;349,331,350,333;311,332,312,333;314,336,316,337;315,333,316,336;345,335,347,338;345,333,346,335;310,334,311,338;350,335,351,338;315,337,316,340;345,338,346,340;311,340,312,341;349,340,350,342;318,341,321,343;317,341,318,342;340,341,344,342;312,342,313,343;340,342,342,343;348,342,349,343;313,343,314,344;320,343,321,344;340,343,341,344;347,343,348,344;314,344,315,345;330,344,331,346;323,344,330,345;331,344,338,345;346,344,347,345;315,345,317,346;344,345,346,346;312,346,313,347;317,346,319,347;342,346,344,347;319,347,321,348;340,347,342,348;312,348,313,349;322,348,325,349;336,348,340,349"
    #endregion
    Local $aPixelRect = StringSplit($sPixelRect, ";", 2)
    Return $aPixelRect
EndFunc   ;==>_PixelCoordinates()


Func _PixelCoordinates4()
    #region pixel coordinates
    Local $sPixelRect
        $sPixelRect &= "530,298;400,4,401,6;399,4,400,5;401,4,402,5;168,11,412,253;177,9,404,11;172,10,177,11;404,10,408,11;136,49,168,213;154,18,168,49;163,13,168,18;165,12,168,13;412,48,444,214;412,18,426,48;412,13,417,18;412,12,415,13;159,15,163,18;161,14,163,15;417,15,421,18;417,14,419,15;156,17,159,18;158,16,159,17;421,16,423,18;423,17,424,18;145,27,154,49;151,21,154,27;152,20,154,21;153,19,154,20;426,26,434,48;426,20,428,26;426,19,427,20;428,22,430,26;428,21,429,22;149,23,151,27;150,22,151,23;430,23,431,26;147,25,149,27;148,24,149,25;431,24,432,26;432,25,433,26;146,26,147,27;434,33,439,48;434,28,436,33;434,27,435,28;140,35,145,49;143,30,145,35;144,28,145,30;436,30,437,33;141,33,143,35;142,31,143,33;437,31,438,33;439,39,442,48;439,34,440,39;138,40,140,49;139,37,140,40;440,37,441,39;445,38,446,40;444,38,445,39;442,42,443,48;137,43,138,49;145,213,168,236;139,213,145,226;137,213,139,219;412,214,435,236;435,214,442,223;442,214,443,220;138,219,139,223;435,223,440,228;440,223,441,226;141,226,145,230;140,226,141,228;435,228,438,232;438,228,439,230;142,230,145,232;144,232,145,235;143,232,144,233;435,232,437,234;435,234,436,235;153,236,168,245;148,236,153,240;146,236,148,238;412,236,427,245;427,236,432,240;432,236,434,238;147,238,148,239;432,238,433,239;150,240,153,242;149,240,150,241;427,240,430,242;430,240,431,241;152,242,153,244;151,242,152,243;427,242,429,243;427,243,428,244;159,245,168,249;156,245,159,247;155,245,156,246;412,245,421,249;421,245,424,247;424,245,426,246;157,247,159,248;421,247,423,248;163,249,168,251;161,249,163,250;412,249,417,251;417,249,419,250;165,251,168,252;412,251,415,252;167,252,168,253;412,252,413,253;180,253,400,256;174,253,180,255;170,253,174,254;400,253,406,255;406,253,410,254;212,256,232,281;196,256,212,266;190,256,196,261;187,256,190,258;186,256,187,257;232,256,249,265;249,256,256,259;256,256,258,257;256,257,257,258;189,258,190,260;188,258,189,259;249,259,253,261;253,259,254,260;192,261,196,263;191,261,192,262;249,261,251,263;251,261,252,262;195,263,196,265;"
        $sPixelRect &= "194,263,195,264;249,263,250,264;232,265,243,271;243,265,247,267;247,265,248,266;202,266,212,272;198,266,202,268;197,266,198,267;243,267,245,269;245,267,246,268;200,268,202,270;199,268,200,269;243,269,244,270;201,270,202,271;232,271,239,274;239,271,241,273;241,271,242,272;206,272,212,275;203,272,206,273;205,273,206,274;232,274,237,276;237,274,238,275;208,275,212,277;207,275,208,276;232,276,235,278;235,276,236,277;210,277,212,279;209,277,210,278;232,278,234,279;211,279,212,280;232,279,233,280;219,281,225,287;214,281,219,283;213,281,214,282;225,281,230,283;230,281,231,282;217,283,219,285;216,283,217,284;225,283,227,285;227,283,228,284;218,285,219,286;225,285,226,286;221,287,223,289;220,287,221,288;223,287,224,288"
    #endregion
    Local $aPixelRect = StringSplit($sPixelRect, ";", 2)
    Return $aPixelRect
EndFunc   ;==>_PixelCoordinates()

 
link:

Trayballon_UDF.rar

Edited by mesale0077
1 person likes this

Share this post


Link to post
Share on other sites



Good UDF!very Beautiful!


董小姐,你微笑的时候很美,就像安河桥下,清澈的水...

Share this post


Link to post
Share on other sites

Nice example !

Thanks.


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
#include "SysTray_UDF.au3"
; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1 Beta
; Author:         Tuape
;
; Script Function:
;   Systray UDF - Functions for reading icon info from system tray / removing 
;   any icon.
;
; Last Update: 7/14/05
; Requirements: AutoIt3 Beta - tested on WindowsXP, might also work in win2000
;
; Functions:
; _SysTrayIconCount() - Get count of all systray icons
; _SysTrayIconTitles() - Get titles of all programs that have icon on systray
; _SysTrayIconProcesses() - Get list of all process names that have icon in systray (hidden or visible)
; _SysTrayIconPids() - Get list of all parent process id's that own an icon in systray (hidden or visible)
; _SysTrayIconRemove($index) - Remove icon (removes completely, not just hide)
; _SysTrayIconIndex($wintitle or $process) - Get icon index based on process name or wintitle
; _SysTrayIconTooltip($index) - Get tooltip text of an icon based on index
;
; Notes:
; Some systray icons are actually hidden, so _SysTrayIconCount will probably return more than you see on systray.
; Some icons don't have window title on them. However, _SysTrayIconPids() & _SysTrayIconProcesses
; do return correct (parent) pid or process name
; ----------------------------------------------------------------------------
;#NoTrayIcon

Const $TB_DELETEBUTTON  = 1046
Const $TB_GETBUTTON = 1047
Const $TB_BUTTONCOUNT = 1048
Const $TB_GETBUTTONTEXT = 1099
Const $TB_GETBUTTONINFO = 1089
Const $TB_HIDEBUTTON = 1028 ; WM_USER +4
Const $TB_GETITEMRECT = 1053
Const $TB_MOVEBUTTON = 1106 ; WM_USER +82
;Const $WM_GETTEXT = 13 ; Included in GUIConstants
Const $PROCESS_ALL_ACCESS = 2035711
Const $NO_TITLE = "---No title---" ; text that is used when icon window has no title




;===============================================================================
;
; Function Name:    _SysTrayIconTitles()
; Description:      Get list of all window titles that have systray icon
; Parameter(s):     None
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns an array with all window titles
;                   On Failure - TO BE DONE
; Author(s):        Tuape
;
;===============================================================================

Func _SysTrayIconTitles()
    Local $i
    Local $j
    Local $max = _SysTrayIconCount()
    Local $info[$max]
    Local $titles[$max]
    Local $var
    
    ; Get info (hwnd) of all icons
    For $i=0 to $max-1
        $info[$i] = _SysTrayIconHandle($i)
    Next

    ; Get window title text
    $var = WinList()
    For $i = 0 to $max-1
        For $j = 1 to $var[0][0]
            ;If $info[$i] = Dec($var[$j][1]) Then
            If $info[$i] = HWnd($var[$j][1]) Then
                If $var[$j][0] <> "" Then
                        $titles[$i] = $var[$j][0]
                Else
                        $titles[$i] = $NO_TITLE
                EndIf
            
            ExitLoop
        
            EndIf
        Next
    Next
    return $titles
EndFunc

;===============================================================================
;
; Function Name:    _SysTrayIconProcesses()
; Description:      Get list of all processes that have systray icon
; Parameter(s):     None
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns an array with all process names
;                   On Failure - TO BE DONE
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconProcesses()
    Local $i
    Local $j
    Local $pids = _SysTrayIconPids()
    Local $processes[UBound($pids)]
    Local $list
    ; List all processes
    $list = ProcessList()
    For $i = 0 to Ubound($pids)-1
        For $j = 1 To $list[0][0]
            If $pids[$i] = $list[$j][1] Then
                $processes[$i] = $list[$j][0]
                ExitLoop
            EndIf
        Next
    Next
    return $processes
EndFunc ;_SysTrayIconProcesses()


;===============================================================================
;
; Function Name:    _SysTrayIconPids()
; Description:      Get list of all processes id's that have systray icon
; Parameter(s):     None
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns an array with all process id's
;                   On Failure - TO BE DONE
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconPids()
Local $i
Local $titles = _SysTrayIconTitles()
Local $processes[UBound($titles)]
Local $ret
    
For $i=0 to Ubound($titles)-1
    If $titles[$i] <> $NO_TITLE Then
        $processes[$i] = WinGetProcess($titles[$i])
    Else
        ; Workaround for systray icons that have no title
        $ret = DLLCall("user32.dll","int","GetWindowThreadProcessId", "int", _SysTrayIconHandle($i), "int*", -1)
        If Not @error Then
            $processes[$i] = $ret[2]
                
        EndIf
            
        
    EndIf
Next
    
return $processes

    
EndFunc


;===============================================================================
;
; Function Name:    _SysTrayIconIndex($name, $mode=0)
; Description:      Get list of all processes id's that have systray icon
; Parameter(s):     $name = process name / window title text
;                   $mode 0 = get index by process name (default)
;                         1 = get index by window title
;                         2 = get index by icon's tooltip text
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns index of found icon
;                   On Failure - Returns -1 if icon for given process/wintitle 
;                                was not found.
;                              - Sets error to 1 and returns -1 in case of bad
;                                arguments
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconIndex($name, $mode=0)
    Local $index = -1
    Local $process
    Local $i
    If $mode < 0 or $mode > 2 or Not IsInt($mode) Then
        SetError(1)
        return -1
    EndIf
    
    If $mode = 0 Then
        $process = _SysTrayIconProcesses()
        
    Else
        $process = _SysTrayIconTitles()
    EndIf
    
    For $i = 0 to Ubound($process)-1
        If $process[$i] = $name Then 
            $index = $i
        EndIf
    Next
    
    return $index   
    
EndFunc

;===============================================================================
;
; Function Name:    _SysTrayIconPos($iIndex=0)
; Description:      Gets x & y position of systray icon
; Parameter(s):     $iIndex = icon index (Note: starting from 0)
;                   
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns x [0] and y [1] position of icon
;                   On Failure - Returns -1 if icon is hidden (Autohide on XP etc.)
;                                Sets error to 1 if some internal error happens
;                                
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconPos($iIndex=0)
;=========================================================
;   Create the struct _TBBUTTON
;   struct {
;   int         iBitmap; 
;    int         idCommand; 
;    BYTE     fsState; 
;    BYTE     fsStyle; 
;   
;   #ifdef _WIN64
;    BYTE     bReserved[6]     // padding for alignment
;   #elif defined(_WIN32)
;    BYTE     bReserved[2]     // padding for alignment
;   #endif
;    DWORD_PTR   dwData; 
;    INT_PTR          iString; 

;   }
;=========================================================
Local $str        = "int;int;byte;byte;byte[2];dword;int"
Dim $TBBUTTON   = DllStructCreate($str)
Dim $TBBUTTON2   = DllStructCreate($str)
Dim $ExtraData = DllStructCreate("dword[2]")
Dim $lpData
DIM $RECT


Local $pId
Local $text
Local $procHandle
Local $index = $iIndex
Local $bytesRead
Local $info
Local $pos[2]
Local $hidden = 0
Local $trayHwnd
Local $ret

$trayHwnd = _FindTrayToolbarWindow()
If $trayHwnd = -1 Then
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    SetError(1)
    Return -1
EndIf

$ret = DLLCall("user32.dll","int","GetWindowThreadProcessId", "hwnd", $trayHwnd, "int*", -1)
If Not @error Then
        $pId = $ret[2]
Else
    ConsoleWrite("Error: Could not find toolbar process id, " & @error & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    SetError(1)
    Return -1
EndIf
$procHandle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', $PROCESS_ALL_ACCESS, 'int', False, 'int', $pId)
If @error Then
    ConsoleWrite("Error: Could not read toolbar process memory, " & @error & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    SetError(1)
    return -1
EndIf

$lpData = DLLCall("kernel32.dll","int","VirtualAllocEx", "int", $procHandle[0], "int", 0, "int", DllStructGetSize ( $TBBUTTON ), "int", 0x1000, "int", 0x04)
If @error Then 
    ConsoleWrite(@CRLF & "VirtualAllocEx Error" & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    SetError(1)
    Return -1
Else
    DLLCall("user32.dll","int","SendMessage", "hwnd", $trayHwnd, "int", $TB_GETBUTTON, "int", $index, "ptr",$lpData[0])
    DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $procHandle[0], 'int', $lpData[0], 'ptr', DllStructGetPtr($TBBUTTON2), 'int', DllStructGetSize( $TBBUTTON), 'int', $bytesRead)
    DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $procHandle[0], 'int', DllStructGetData($TBBUTTON2,6), 'int', DllStructGetPtr($ExtraData), 'int', DllStructGetSize( $ExtraData), 'int', $bytesRead)

    $info =  DllStructGetData($ExtraData,1,1) 
    If Not BitAND(DllStructGetData($TBBUTTON2,3), 8) Then ; 8 = TBHIDDEN
    
    $str        = "int;int;int;int"
    $RECT   = DllStructCreate($str)

    DLLCall("user32.dll","int","SendMessage", "hwnd", $trayHwnd, "int", $TB_GETITEMRECT, "int", $index, "ptr",$lpData[0])
    DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $procHandle[0], 'int', $lpData[0], 'ptr', DllStructGetPtr($RECT), 'int', DllStructGetSize($RECT), 'int', $bytesRead)
    
    $ret = DLLCall("user32.dll","int","MapWindowPoints", "hwnd", $trayHwnd, "int", 0, 'ptr', DllStructGetPtr($RECT), "int",2)
    ConsoleWrite("Info: " & $info & "RECT[0](left): " & DllStructGetData($RECT,1) & "RECT[1](top): " & DllStructGetData($RECT,2) & "RECT[2](right): " & DllStructGetData($RECT,3) & "RECT[3](bottom): " & DllStructGetData($RECT,4) & @LF)
    
    ;MouseMove(DllStructGetData($RECT,1),DllStructGetData($RECT,2))
    ;Sleep(1000)
    ;MouseClick("left")
    $pos[0] = DllStructGetData($RECT,1)
    $pos[1] = DllStructGetData($RECT,2)
    $RECT = 0
    Else
        $hidden = 1
    EndIf
    
    DLLCall("kernel32.dll","int","VirtualFreeEx", "int", $procHandle[0], "ptr", $lpData[0], "int", 0, "int", 0x8000) ;DllStructGetSize ( $TBBUTTON ), "int", 0x8000)
EndIf

DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $procHandle[0])    
$TBBUTTON = 0
$TBBUTTON2 = 0
$ExtraData = 0

If $hidden <> 1 Then
    return $pos
Else
    Return -1
EndIf
EndFunc


;===============================================================================
;
; Function Name:    _SysTrayIconHandle($iIndex=0)
; Description:      Utility function. Gets hwnd of window associated with
;                   systray icon of given index
; Parameter(s):     $iIndex = icon index (Note: starting from 0)
;                   
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns hwnd of found icon
;                   On Failure - Returns -1 in error situations
;                                
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconHandle($iIndex=0)
;=========================================================
;   Create the struct _TBBUTTON
;   struct {
;   int         iBitmap; 
;    int         idCommand; 
;    BYTE     fsState; 
;    BYTE     fsStyle; 
;   
;   #ifdef _WIN64
;    BYTE     bReserved[6]     // padding for alignment
;   #elif defined(_WIN32)
;    BYTE     bReserved[2]     // padding for alignment
;   #endif
;    DWORD_PTR   dwData; 
;    INT_PTR          iString; 

;   }
;=========================================================
Local $str        = "int;int;byte;byte;byte[2];dword;int";char[128]"
Dim $TBBUTTON   = DllStructCreate($str)
Dim $TBBUTTON2   = DllStructCreate($str)
Dim $ExtraData = DllStructCreate("dword[2]")


Local $pId
Local $text
Local $procHandle
Local $index = $iIndex
Local $bytesRead
Local $info
Local $lpData
Local $trayHwnd


$trayHwnd = _FindTrayToolbarWindow()
If $trayHwnd = -1 Then
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    SetError(1)
    Return -1
EndIf

Local $ret = DLLCall("user32.dll","int","GetWindowThreadProcessId", "hwnd", $trayHwnd, "int*", -1)
If Not @error Then
        $pId = $ret[2]
Else
    ConsoleWrite("Error: Could not find toolbar process id, " & @error & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    Return -1
EndIf
$procHandle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', $PROCESS_ALL_ACCESS, 'int', False, 'int', $pId)
If @error Then
    ConsoleWrite("Error: Could not read toolbar process memory, " & @error & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    return -1
EndIf

$lpData = DLLCall("kernel32.dll","int","VirtualAllocEx", "int", $procHandle[0], "int", 0, "int", DllStructGetSize ( $TBBUTTON ), "int", 0x1000, "int", 0x04)
If @error Then 
    ConsoleWrite("VirtualAllocEx Error" & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    Return -1
Else
    DLLCall("user32.dll","int","SendMessage", "hwnd", $trayHwnd, "int", $TB_GETBUTTON, "int", $index, "ptr", $lpData[0]);e(hwnd, TB_GETBUTTON, index, (LPARAM)lpData);
    DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $procHandle[0], 'int', $lpData[0], 'ptr', DllStructGetPtr($TBBUTTON2), 'int', DllStructGetSize( $TBBUTTON), 'int', $bytesRead)
    DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $procHandle[0], 'int', DllStructGetData($TBBUTTON2,6), 'int', DllStructGetPtr($ExtraData), 'int', DllStructGetSize( $ExtraData), 'int', $bytesRead);_MemRead($procHandle, $lpData[0], DllStructGetSize( $TBBUTTON))

    $info =  DllStructGetData($ExtraData,1) 
    DLLCall("kernel32.dll","int","VirtualFreeEx", "int", $procHandle[0], "ptr", $lpData[0], "int", 0, "int", 0x8000) ;DllStructGetSize ( $TBBUTTON ), "int", 0x8000)
EndIf

DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $procHandle[0])    
$TBBUTTON = 0
$TBBUTTON2 = 0
$ExtraData = 0
$lpData = 0
return $info
EndFunc

;===============================================================================
;
; Function Name:    _SysTrayIconTooltip($iIndex=0)
; Description:      Utility function. Gets the tooltip text of 
;                   systray icon of given index
; Parameter(s):     $iIndex = icon index (Note: starting from 0)
;                   
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns tooltip text of icon
;                   On Failure - Returns -1 in error situations
;                                
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconTooltip($iIndex=0)
;=========================================================
;   Create the struct _TBBUTTON
;   struct {
;   int         iBitmap; 
;    int         idCommand; 
;    BYTE     fsState; 
;    BYTE     fsStyle; 
;   
;   #ifdef _WIN64
;    BYTE     bReserved[6]     // padding for alignment
;   #elif defined(_WIN32)
;    BYTE     bReserved[2]     // padding for alignment
;   #endif
;    DWORD_PTR   dwData; 
;    INT_PTR          iString; 

;   }
;=========================================================
Local $str        = "int;int;byte;byte;byte[2];dword;int"
Dim $TBBUTTON   = DllStructCreate($str)
Dim $TBBUTTON2   = DllStructCreate($str)
Dim $ExtraData = DllStructCreate("dword[2]")
Dim $intTip = DllStructCreate("short[1024]")


Local $pId
Local $text
Local $procHandle
Local $index = $iIndex
Local $bytesRead
Local $info
Local $lpData
Local $trayHwnd


$trayHwnd = _FindTrayToolbarWindow()
If $trayHwnd = -1 Then
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    $intTip = 0
    ;SetError(1)
    Return -1
EndIf

Local $ret = DLLCall("user32.dll","int","GetWindowThreadProcessId", "hwnd", $trayHwnd, "int*", -1)
If Not @error Then
        $pId = $ret[2]
Else
    ConsoleWrite("Error: Could not find toolbar process id, " & @error & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    $intTip = 0
    Return -1
EndIf
$procHandle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', $PROCESS_ALL_ACCESS, 'int', False, 'int', $pId)
If @error Then
    ConsoleWrite("Error: Could not read toolbar process memory, " & @error & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    $intTip = 0
    return -1
EndIf

$lpData = DLLCall("kernel32.dll","int","VirtualAllocEx", "int", $procHandle[0], "int", 0, "int", DllStructGetSize ( $TBBUTTON ), "int", 0x1000, "int", 0x04)
If @error Then 
    ConsoleWrite("VirtualAllocEx Error" & @LF)
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    $ExtraData = 0
    $intTip = 0
    Return -1
Else
    DLLCall("user32.dll","int","SendMessage", "hwnd", $trayHwnd, "int", $TB_GETBUTTON, "int", $index, "ptr",$lpData[0]);e(hwnd, TB_GETBUTTON, index, (LPARAM)lpData);
    DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $procHandle[0], 'int', $lpData[0], 'ptr', DllStructGetPtr($TBBUTTON2), 'int', DllStructGetSize( $TBBUTTON), 'int', $bytesRead)
    DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $procHandle[0], 'int', DllStructGetData($TBBUTTON2,7), 'int', DllStructGetPtr($intTip), 'int', DllStructGetSize( $intTip), 'int', 0);_MemRead($procHandle, $lpData[0], DllStructGetSize( $TBBUTTON))

    ; go through every character
    $i = 1
    While $i < 1024 
        $tipChar = ""
    
#cs 
        BOOL ReadProcessMemory(
  HANDLE hProcess,
  LPCVOID lpBaseAddress,
  LPVOID lpBuffer,
  SIZE_T nSize,
  SIZE_T* lpNumberOfBytesRead
);
#ce

        
        $tipChar = Chr(DllStructGetData($intTip,1,$i))

        If $tipChar = "" Then 
            ExitLoop 
        EndIf
        ;ConsoleWrite(@CRLF & $i & " Char: " & $tipChar & @LF)
        $info =  $info & $tipChar

        $i = $i + 1
    Wend
    
    If $info = "" Then 
        $info = "No tooltip text"
    EndIf
    
    DLLCall("kernel32.dll","int","VirtualFreeEx", "int", $procHandle[0], "ptr", $lpData[0], "int", 0, "int", 0x8000) ;DllStructGetSize ( $TBBUTTON ), "int", 0x8000))
EndIf

DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $procHandle[0])    
$TBBUTTON = 0
$TBBUTTON2 = 0
$ExtraData = 0
$intTip = 0
$lpData = 0
return $info
EndFunc

;===============================================================================
;
; Function Name:    _SysTrayIconCount
; Description:      Utility function. Returns number of icons on systray
;                   Note: Hidden icons are also reported
; Parameter(s):     None
;                   
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns number of icons found
;                   On Failure - Returns -1
;                                
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconCount()
    Local $hWnd = _FindTrayToolbarWindow()
    Local $count = 0
    $count = DLLCall("user32.dll","int","SendMessage", "hwnd", $hWnd, "int", $TB_BUTTONCOUNT, "int", 0, "int", 0)
    If @error Then Return -1
    return $count[0]
EndFunc

;===============================================================================
;
; Function Name:    _SysTrayIconVisible($flag, $index)
; Description:      Hides / unhides any icon on systray
;                   
; Parameter(s):     $flag = hide (1) or show (0) icon
;                   $index = icon index. Can be queried with _SysTrayIconIndex()
;                   
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns 1 if operation was successfull / 0 if 
;                   icon was already hidden/unhidden
;                   On Failure - If invalid parameters, returns -1 and sets error
;                   to 1
;                                
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconVisible($flag, $index)
    If $flag < 0 or $flag > 1 or Not IsInt($flag) Then
        SetError(1)
        return -1
    EndIf
    
    Local $hWnd = _FindTrayToolbarWindow()
    Local $return
    
    Local $str        = "int;int;byte;byte;byte[2];dword;int";char[128]"
    Dim $TBBUTTON   = DllStructCreate($str)
    Dim $TBBUTTON2   = DllStructCreate($str)



    Local $pId
    Local $text
    Local $procHandle
    Local $bytesRead
    Local $info
    Local $lpData

    Local $ret = DLLCall("user32.dll","int","GetWindowThreadProcessId", "hwnd", $hWnd, "int*", -1)
    If Not @error Then
        $pId = $ret[2]
    Else
        ConsoleWrite("Error: Could not find toolbar process id, " & @error & @LF)
        $TBBUTTON = 0
        $TBBUTTON2 = 0
        Return -1
    EndIf
    $procHandle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', $PROCESS_ALL_ACCESS, 'int', False, 'int', $pId)
    If @error Then
        ConsoleWrite("Error: Could not read toolbar process memory, " & @error & @LF)
        $TBBUTTON = 0
        $TBBUTTON2 = 0
        return -1
    EndIf

    $lpData = DLLCall("kernel32.dll","int","VirtualAllocEx", "int", $procHandle[0], "int", 0, "int", DllStructGetSize ( $TBBUTTON ), "int", 0x1000, "int", 0x04)
    If @error Then 
        ConsoleWrite("VirtualAllocEx Error" & @LF)
        $TBBUTTON = 0
        $TBBUTTON2 = 0
        Return -1
    Else
        DLLCall("user32.dll","int","SendMessage", "hwnd", $hWnd, "int", $TB_GETBUTTON, "int", $index, "ptr",$lpData[0]);e(hwnd, TB_GETBUTTON, index, (LPARAM)lpData);
        DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $procHandle[0], 'int', $lpData[0], 'ptr', DllStructGetPtr($TBBUTTON2), 'int', DllStructGetSize( $TBBUTTON), 'int', $bytesRead)
        
        $return = DLLCall("user32.dll","int","SendMessage", "hwnd", $hWnd, "int", $TB_HIDEBUTTON, "int", DllStructGetData($TBBUTTON2,2), "long", $flag)
        ;ConsoleWrite(@CRLF & "Return: " & $return[0])
        
        DLLCall("kernel32.dll","int","VirtualFreeEx", "int", $procHandle[0], "ptr", $lpData[0], "int", 0, "int", 0x8000) ;DllStructGetSize ( $TBBUTTON ), "int", 0x8000)
        

        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $procHandle[0])    
        
    EndIf

    
    $TBBUTTON = 0
    $TBBUTTON2 = 0
    
    return $return[0]
EndFunc

;===============================================================================
;
; Function Name:    _SysTrayIconMove($curPos, $newPos)
; Description:      Moves systray icon
;                   
; Parameter(s):     $curPos = icon's current index (0 based)
;                   $newPos = icon's new position 
;                   ----> ($curPos+1 = one step to right, $curPos-1 = one step to left)
;                   
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns 1 if operation was successfull
;                   On Failure - If invalid parameters, returns -1 and sets error
;                   to 1
;                                
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconMove($curPos, $newPos) 
    
    Local $iconCount = _SysTrayIconCount()
    If $curPos < 0 or $newPos < 0 or $curPos > $iconCount-1 or $newPos > $iconCount-1 or Not IsInt($curPos) or Not IsInt($newPos) Then
        SetError(1)
        return -1
    EndIf
    
    Local $hWnd = _FindTrayToolbarWindow()
    Local $return
    
    Local $return = DLLCall("user32.dll","int","SendMessage", "hwnd", $hWnd, "int", $TB_MOVEBUTTON, "int", $curPos, "int",$newPos)
    return $return[0]
EndFunc

;===============================================================================
;
; Function Name:    _SysTrayIconRemove($index=0
; Description:      Removes systray icon completely.
;                   
; Parameter(s):     index = icon index. Can be queried with _SysTrayIconIndex()
;                   Default = 0
;                   
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns 1 if icon successfully removed
;                   On Failure - Sets error to 1 and returns -1
;                                
; Author(s):        Tuape
;
;===============================================================================
Func _SysTrayIconRemove($index=0)
    If $index < 0 or $index > _SysTrayIconCount()-1 Then
        SetError(1)
        return -1
    EndIf
    
    Local $hWnd = _FindTrayToolbarWindow()
    DLLCall("user32.dll","int","SendMessage", "hwnd", $hWnd, "int", $TB_DELETEBUTTON, "int", $index, "int", 0)
    If Not @error Then
        return 1
    Else
        SetError(2)
        return -1
    EndIf
EndFunc


;===============================================================================
;
; Function Name:    _FindTrayToolbarWindow
; Description:      Utility function for finding Toolbar window hwnd
; Parameter(s):     None
;                   
; Requirement(s):   AutoIt3 Beta
; Return Value(s):  On Success - Returns Toolbar window hwnd
;                   On Failure - returns -1
;                                
; Author(s):        Tuape
;
;===============================================================================
Func _FindTrayToolbarWindow()
  Local $hWnd = DLLCall("user32.dll","hwnd","FindWindow", "str", "Shell_TrayWnd", "int", 0)
  
  if @error Then return -1 
  $hWnd = DLLCall("user32.dll","hwnd","FindWindowEx", "hwnd", $hWnd[0], "int", 0, "str", "TrayNotifyWnd", "int", 0);FindWindowEx(hWnd,NULL,_T("TrayNotifyWnd"), NULL);
  if @error Then return -1 
  If @OSVersion <> "WIN_2000" Then
      $hWnd = DLLCall("user32.dll","hwnd","FindWindowEx", "hwnd", $hWnd[0], "int", 0, "str", "SysPager", "int", 0);FindWindowEx(hWnd,NULL,_T("TrayNotifyWnd"), NULL);
      if @error Then return -1
  EndIf
  $hWnd = DLLCall("user32.dll","hwnd","FindWindowEx", "hwnd", $hWnd[0], "int", 0, "str", "ToolbarWindow32", "int", 0);FindWindowEx(hWnd,NULL,_T("TrayNotifyWnd"), NULL);
  if @error Then return -1  
           
  Return $hWnd[0]

EndFunc

Thanks.. :)

Share this post


Link to post
Share on other sites

Nice example !

Thanks.

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