Sign in to follow this  
Followers 0
Valuater

System Tray Message Box UDF

34 posts in this topic

#1 ·  Posted (edited)

Just like real programs do...

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>


; Simple Example
_TrayMessageBox("Tray Message Box", "This is a tray message box text" & @CRLF & @CRLF & "                 ...Thanks, Valuater... 8)    ")


Func _TrayMessageBox($TBTitle, $TBText, $TBwidth = 220, $TBheight = 100, $display_Time = 5000)
    $TBgui = GUICreate($TBTitle, $TBwidth, $TBheight, @DesktopWidth - ($TBwidth + 12), @DesktopHeight - ($TBheight + 53), -1, $WS_EX_TOOLWINDOW)
    $Status = GUICtrlCreateLabel($TBText, 20, 20)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1000, "long", 0x00040008);slide-in
    GUISetState()
    Sleep($display_Time)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1000, "long", 0x00050004);slide-out
    GUIDelete($TBgui)
EndFunc   ;==>_TrayMessageBox

I have been asked about this many times because it is built into EzSkin

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites



I like it. I modify only the style and ex-style to be the title bar a little thin.

I hope to like it. :)

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

; Example
_TrayBoxCreate("Tray Message Box", "This is a tray message box text" & @CRLF & @CRLF & "                 ...Thanks, Valuater... 8)  ")

Func _TrayBoxCreate($TBTitle, $TBText, $display_Time = 5000)
    $TBgui = GUICreate($TBTitle, 275, 135, @DesktopWidth - 280, @DesktopHeight - 170,0x16C80000, 0x00000189)
    $Status = GUICtrlCreateLabel($TBText, 20, 20);, 220, 20, BitOR($SS_SUNKEN, $SS_CENTER))
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1000, "long", 0x00040008);slide-in from bottom
    GUISetState()
    Sleep($display_Time)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1000, "long", 0x00040008);slide-in from bottom
    GUISetState(@SW_SHOW, $TBgui)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1000, "long", 0x00050004);slide-out to bottom
    GUISetState(@SW_HIDE, $TBgui)
EndFunc  ;==>_TrayBox

When the words fail... music speaks

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Functions :

_TrayBoxCreate

_TrayBoxSetStyle

_TrayBoxSetIcon

_TrayBoxSetText

_TrayBoxSetPic

_TrayBoxAnimate

_TrayBoxSetState

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
Local $Status, $TBGui
Local $bmp = @ProgramFilesDir & "\Autoit3\Examples\GUI\Advanced\Images\Blue.bmp"

#Region Example ---------------------------------------------------
_TrayBoxCreate("Tray Message Box", "This is a tray message box text" & @CRLF & @CRLF & "                 ...Thanks, Valuater... 8)    ")
_TrayBoxSetStyle($GUI_SS_DEFAULT_GUI, 0x00000000, $TBGui)
_TrayBoxSetIcon(@SystemDir & "\Shell32.dll", -3, $TBGui)
_TrayBoxSetPic($bmp, $TBGui, 3, 1)
_TrayBoxSetText("TrayBox Text" & @CRLF & "_TrayBoxSetText")
_TrayBoxAnimate($TBGui, 1, 1000)
Sleep(1000)
_TrayBoxAnimate($TBGui, 19, 1000)
_TrayBoxSetState(@SW_HIDE, $TBGui)
#EndRegion Example ---------------------------------------------------

;===============================================================================
; Function Name: _TrayBoxSetPic
; Author(s): Valuater / FireFox
;===============================================================================
Func _TrayBoxCreate($TBTitle = "TrayBox", $TBText = "TrayBox Text", $Left = 745, $Top = 630, $Width = 275, $Height = 135)
    Global $TBGui = GUICreate($TBTitle, $Width, $Height, $Left, $Top, 0x16C80000, 0x00000189)
    Global $Status = GUICtrlCreateLabel($TBText, 20, 20, -2, -2)
    GUISetState(@SW_HIDE, $TBGui)
EndFunc   ;==>_TrayBoxCreate

;===============================================================================
; Function Name: _TrayBoxSetPic
; Author(s): FireFox
;===============================================================================
Func _TrayBoxSetTitle($TBTitle = "Tray box new", $TBGui = "TrayBox")
    WinSetTitle($TBGui, "", $TBTitle)
EndFunc   ;==>_TrayBoxSetTitle

;===============================================================================
; Function Name: _TrayBoxSetPic
; Author(s): FireFox
;===============================================================================
Func _TrayBoxSetText($TBText = "TrayBox Text", $label = $Status)
    GUICtrlSetData($label, $TBText)
EndFunc   ;==>_TrayBoxSetText

;===============================================================================
; Function Name: _TrayBoxSetPic
; Author(s): FireFox
;===============================================================================
Func _TrayBoxSetIcon($Source = @ScriptFullPath, $Icon = -1, $TBGui = "TrayBox")
    GUISetIcon($Source, $Icon, $TBGui)
EndFunc   ;==>_TrayBoxSetIcon

;===============================================================================
; Function Name: _TrayBoxSetPic
; Author(s): FireFox
;===============================================================================
Func _TrayBoxSetPic($bmppath = $bmp, $TBGui = "TrayBox", $PicStyle = 1, _
        $PLeft = 0, $Ptop = 0, $PWidth = 275, $PHeight = 135)
    ; $style - 1=Extend picture to size of traybox
    ; 2=Center picture on traybox
    ; 3=Place picture where you want to
    ; 4=Place picture on the left-top
    ; 5=Place picture on the right-top
    ; 6=Place picture on the left-end
    ; 7=Place picture on the right-end

    If $PicStyle < 1 Or $PicStyle > 7 Then
        Return -1
    ElseIf $PicStyle > 0 Or $PicStyle < 8 Then
        $Width = _GetExtProperty($bmppath, 27)
        $Height = _GetExtProperty($bmppath, 28)
        $PicWidth = StringTrimRight($Width, 7)
        $PicHeight = StringTrimRight($Height, 7)
        $TBSize = WinGetClientSize($TBGui, "")
        If $PicStyle = 1 Then
            GUICtrlCreatePic($bmppath, 0, 0, $TBSize[0], $TBSize[1])
            GUICtrlSetState(-1, $GUI_DISABLE)
        ElseIf $PicStyle = 2 Then
            GUICtrlCreatePic($bmppath, ($TBSize[0] - $PicWidth) / 2, ($TBSize[1] - $PicHeight) / 2, $PicWidth, $PicHeight)
            GUICtrlSetState(-1, $GUI_DISABLE)
        ElseIf $PicStyle = 3 Then
            GUICtrlCreatePic($bmppath, $PLeft, $Ptop, $PWidth, $PHeight)
            GUICtrlSetState(-1, $GUI_DISABLE)
        ElseIf $PicStyle = 4 Then
            GUICtrlCreatePic($bmppath, 0, 0, $PicWidth, $PicHeight)
            GUICtrlSetState(-1, $GUI_DISABLE)
        ElseIf $PicStyle = 5 Then
            GUICtrlCreatePic($bmppath, $TBSize[0] - $PicWidth, 0, $PicWidth, $PicHeight)
            GUICtrlSetState(-1, $GUI_DISABLE)
        ElseIf $PicStyle = 6 Then
            GUICtrlCreatePic($bmppath, 0, $TBSize[1] - $PicHeight, $PicWidth, $PicHeight)
            GUICtrlSetState(-1, $GUI_DISABLE)
        ElseIf $PicStyle = 7 Then
            GUICtrlCreatePic($bmppath, $TBSize[0] - $PicWidth, $TBSize[1] - $PicHeight, $PicWidth, $PicHeight)
            GUICtrlSetState(-1, $GUI_DISABLE)
        EndIf
    EndIf
EndFunc   ;==>_TrayBoxSetPic

;===============================================================================
; Function Name: _GetExtProperty
; Author(s): Simucal
;===============================================================================
Func _GetExtProperty($sPath, $iProp)
    Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty
    $sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1))
    $sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1)))
    $oShellApp = ObjCreate("shell.application")
    $oDir = $oShellApp.NameSpace($sDir)
    $oFile = $oDir.Parsename($sFile)
    If $iProp = -1 Then
        Local $aProperty[35]
        For $i = 0 To 34
            $aProperty[$i] = $oDir.GetDetailsOf($oFile, $i)
        Next
        Return $aProperty
    Else
        $sProperty = $oDir.GetDetailsOf($oFile, $iProp)
        If $sProperty = "" Then
            Return "None"
        Else
            Return $sProperty
        EndIf
    EndIf
EndFunc   ;==>_GetExtProperty

;===============================================================================
; Function Name: _TrayBoxSetPic
; Author(s): FireFox
;===============================================================================
Func _TrayBoxSetStyle($Style = 0x16C80000, $ExStyle = 0x00000189, $TBGui = "TrayBox")
    GUISetStyle($Style, $ExStyle, $TBGui)
EndFunc   ;==>_TrayBoxSetStyle

;===============================================================================
; Function Name: _TrayBoxSetPic
; Author(s): FireFox
;===============================================================================
Func _TrayBoxSetState($State = @SW_SHOW, $TBGui = "TrayBox")
    GUISetState($State, $TBGui)
EndFunc   ;==>_TrayBoxSetState

;===============================================================================
; Function Name: _TrayBoxSetPic
; Author(s): Valuater
;===============================================================================
Func _TrayBoxAnimate($TBGui, $Xstyle = 0, $Xspeed = 1000)
    ; $Xstyle - 1=Fade, 3=Explode, 5=L-Slide, 7=R-Slide, 9=T-Slide, 11=B-Slide,
    ;13=TL-Diag-Slide, 15=TR-Diag-Slide, 17=BL-Diag-Slide, 19=BR-Diag-Slide
    Local $Xpick = StringSplit("80000,90000,40010,50010,40001,50002,40002,50001,40004,50008,40008,50004,40005,5000a,40006,50009" & _
            "40009, 50006, 4000a, 50005", ",")
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBGui, "int", $Xspeed, "long", "0x000" & $Xpick[$Xstyle])
EndFunc   ;==>_TrayBoxAnimate
Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thx a lot Valuater! it's a great example! but can u skin it? the file Xskin.au3 when i download has some error i can't use it

1st i use guicreate to make Tray box: it is:

#include <GUIConstants.au3>
#include <ModernMenu.au3>

Const $AW_BLEND = 0x00080000
; AW_CENTER Makes the window appear to collapse inward if AW_HIDE is used or expand
; outward if the AW_HIDE is not used.
Const $AW_HIDE = 0x00010000
;time animation takes, in milliseconds.
Const $AWTime = 50
Traybox()
Func Traybox()
Global $GuiLeft = @DesktopWidth - 420
Global $GuiTop = _WinAPI_GetSystemMetrics($SM_CYFULLSCREEN) - 182
$hDummy = GUICreate("Dummy")
#Region ### START Koda GUI section ### Form=
$gui = GUICreate("Animated by API",  415, 187,$GuiLeft, $GuiTop,$WS_POPUP)
If Not IsDeclared('Cadet_Blue_3') Then Dim $Cadet_Blue_3 = 0xEBEBEB
    GUISetBkColor($Cadet_Blue_3)
    
$Label1 = GUICtrlCreateLabel("Tray box eg", 16, 24, 379, 28)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xC0C0C)
$Label2 = GUICtrlCreateLabel("Sometext", 104, 80, 202, 28)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xC0C0C)
GUISetState(@SW_SHOW)

AnimateOpen($gui,$AW_BLEND,2000)
Sleep(1000)
AnimateClose($gui,$AW_BLEND,1200)
Sleep(100);
EndFunc

Func AnimateOpen($hW,$AOStyle,$ttime)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hw, "int", $ttime, "long", $AOStyle);slide out to left
    
EndFunc
Func AnimateClose($hW,$ACStyle,$ttime = 500);$AWTime)
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hw, "int", $ttime, "long", BitOR($AW_HIDE,$ACStyle))
EndFunc

is it ok?

Edited by LeHuynhNam

I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites

Thanks for this Valuater and thanks to Andreik and FireFox for their mods

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Thanks for this Valuater and thanks to Andreik and FireFox for their mods

Thanks :)

Added _TrayboxSetTitle with my iPod.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

thx a lot Valuater! it's a great example! but can u skin it? the file Xskin.au3 when i download has some error i can't use it

What is the error print-out in SciTe???

This works..

#include <XSkin.au3>

; folder of skin
$Skin_Folder = @ScriptDir & "\Skins\Universal"

$XSkinGui = XSkinGUICreate( "My GUI", 400, 450, $Skin_Folder)

$button_1 = XSkinButton("Button 1", 145, 100, 100, 35, "Set_Tray")

GUISetState()

While 1
    MouseOver()
   
    Sleep(10)
WEnd

Func Set_Tray()
    XSkinTrayBox( "XSkin", "Test Button 1")
EndFunc

It's that simple!

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thanks :)

Added _TrayboxSetTitle with my iPod.

might want to exchnge your longer UDF for this one

Func _TrayBoxAnimate($TBGui, $Xstyle = 0, $Xspeed = 1000)
    ; $Xstyle - 1=Fade, 3=Explode, 5=L-Slide, 7=R-Slide, 9=T-Slide, 11=B-Slide,
    ;13=TL-Diag-Slide, 15=TR-Diag-Slide, 17=BL-Diag-Slide, 19=BR-Diag-Slide
    Local $Xpick = StringSplit('80000,90000,40010,50010,40001,50002,40002,50001,40004,50008,40008,50004,40005,5000a,40006,50009,4000
9,50006,4000a,50005', ",")
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBGui, "int", $Xspeed, "long", "0x000" & $Xpick[$Xstyle])
EndFunc   ;==>_TrayBoxAnimate

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

@Valuater

Nice idea, I've not tought to do this, I will edit my udf later with your function :)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

the error when i test your eg

#include <XSkin.au3>

; folder of skin
$Skin_Folder = @ScriptDir & "\Skins\Universal"

$XSkinGui = XSkinGUICreate( "My GUI", 400, 450, $Skin_Folder)

$button_1 = XSkinButton("Button 1", 145, 100, 100, 35, "Set_Tray")

GUISetState()

While 1
    MouseOver()
   
    Sleep(10)
WEnd

Func Set_Tray()
    XSkinTrayBox( "XSkin", "Test Button 1")
EndFunc

is here:

D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(94,26) : WARNING: $WS_POPUP: possibly used before declaration.
        $guiHeader2 = $WS_POPUP
        ~~~~~~~~~~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(107,79) : WARNING: $WS_CLIPSIBLINGS: possibly used before declaration.
    GUICtrlCreatePic($elements[0], 0, 0, $tile_size, $tile_size, $WS_CLIPSIBLINGS)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(115,105) : WARNING: $SS_NOTIFY: possibly used before declaration.
        GUICtrlCreatePic($elements[1], ($tile_size * ($XS_i + 1)), 0, $tile_size, $tile_size, BitOR($SS_NOTIFY,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(149,56) : WARNING: $SS_ETCHEDFRAME: possibly used before declaration.
                            GUICtrlSetStyle($CtrlIDB[$XS_x], $SS_ETCHEDFRAME)
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(151,66) : WARNING: $SS_GRAYRECT: possibly used before declaration.
                            GUICtrlSetStyle($CtrlIDB[$XS_x], $SS_NOTIFY + $SS_GRAYRECT)
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(227,103) : WARNING: $SS_BLACKRECT: possibly used before declaration.
    $CtrlButton[$ButtonIndex][0] = GUICtrlCreateLabel("", $Bleft, $Btop, $Bwidth, $Bheight, $SS_BLACKRECT)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(229,111) : WARNING: $SS_WHITERECT: possibly used before declaration.
    $CtrlButton[$ButtonIndex][2] = GUICtrlCreateLabel("", $Bleft, $Btop, $Bwidth - 1, $Bheight - 1, $SS_WHITERECT)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(231,133) : WARNING: $SS_CENTER: possibly used before declaration.
    $CtrlButton[$ButtonIndex][1] = GUICtrlCreateLabel($Btext, $Bleft + 1, $Btop + 1, $Bwidth - 3, $Bheight - 3, $SS_NOTIFY & $SS_CENTER)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(361,128) : WARNING: $BS_BITMAP: possibly used before declaration.
        $XS_winB[$XS_b] = GUICtrlCreateButton("", ($XSIPos[2] - $XadjLt) - $XS_IPos1, $XadjDn, $XS_Isize, $XS_Isize, BitOR($BS_BITMAP,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(361,141) : WARNING: $WS_VISIBLE: possibly used before declaration.
        $XS_winB[$XS_b] = GUICtrlCreateButton("", ($XSIPos[2] - $XadjLt) - $XS_IPos1, $XadjDn, $XS_Isize, $XS_Isize, BitOR($BS_BITMAP, $WS_VISIBLE)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(361,158) : WARNING: $WS_EX_TOPMOST: possibly used before declaration.
        $XS_winB[$XS_b] = GUICtrlCreateButton("", ($XSIPos[2] - $XadjLt) - $XS_IPos1, $XadjDn, $XS_Isize, $XS_Isize, BitOR($BS_BITMAP, $WS_VISIBLE), $WS_EX_TOPMOST)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Designs\Program\Autoit\AutoitV3\Include\XSkin.au3(94,26) : ERROR: $WS_POPUP: undeclared global variable.
        $guiHeader2 = $WS_POPUP
        ~~~~~~~~~~~~~~~~~~~~~~~^

And i still can't use it


I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

thank you valuater, this script has run!

but i have new problem! it only showed the main gui and when i click button 1. the msgbox appear with text! $skin_folder not found!

Edited by LeHuynhNam

I'm Learner Of English so my words can have many mistake! I'll try my best to improve it

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

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

; Example
_TrayBoxCreate("Tray Message Box", "This is a tray message box text")

Func _TrayBoxCreate($TBTitle, $TBText, $display_Time = 2500)
$TBgui = GUICreate($TBTitle, 250, 100, @DesktopWidth - 300, @DesktopHeight - 150,$WS_POPUP+$WS_CAPTION,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST+$WS_EX_DLGMODALFRAME)
$Status = GUICtrlCreateLabel($TBText, 20, 20, 210, 20, BitOR($SS_SUNKEN, $SS_CENTER))
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1000, "long", 0x00040008);slide-in from bottom
GUISetState()
Sleep($display_Time)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1500, "long", 0x00040008);slide-in from bottom
GUISetState(@SW_SHOW, $TBgui)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBGui, "int", 1000, "long", 0x00050010);implode
GUISetState(@SW_HIDE, $TBgui)
EndFunc;==>_TrayBox

Edited by HAL9000

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

@Valuater

Edited post #3 with new function _TrayBoxSetPic

Works fine but i want to know i you have another function for width and height of picture that is easier that the on i have ?

Thanks,

FireFox

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

@Valuater

Edited post #3 with new function _TrayBoxSetPic

...

Works fine but i want to know i you have another function for width and height of picture that is easier that the on i have ?

Thanks,

FireFox

Cool...

I don't know of an easier function right now

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Cool...

I don't know of an easier function right now

8)

I have another question :) , how can I create picture on the Gui selected by user ? because with GuiCtrlCtratePic its only on the last gui created....

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

OK... to start with, you are "Globalizing" the GUI handle in your create function. To work with more than 1 GUI you need to change how the creation is done..

from this

_TrayBoxCreate("Tray Message Box", "Blah.. Blah...")

Func _TrayBoxCreate($TBTitle = "TrayBox", $TBText = "TrayBox Text", $Left = 745, $Top = 630, $Width = 275, $Height = 135)
    Global $TBGui = GUICreate($TBTitle, $Width, $Height, $Left, $Top, 0x16C80000, 0x00000189)
    Global $Status = GUICtrlCreateLabel($TBText, 20, 20)
    GUISetState(@SW_HIDE, $TBGui)
EndFunc   ;==>_TrayBoxCreate

with this, you can choose which GUI you want to put a pic on

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

OK... to start with, you are "Globalizing" the GUI handle in your create function. To work with more than 1 GUI you need to change how the creation is done..

from this

_TrayBoxCreate("Tray Message Box", "Blah.. Blah...")

Func _TrayBoxCreate($TBTitle = "TrayBox", $TBText = "TrayBox Text", $Left = 745, $Top = 630, $Width = 275, $Height = 135)
    Global $TBGui = GUICreate($TBTitle, $Width, $Height, $Left, $Top, 0x16C80000, 0x00000189)
    Global $Status = GUICtrlCreateLabel($TBText, 20, 20)
    GUISetState(@SW_HIDE, $TBGui)
EndFunc   ;==>_TrayBoxCreate

with this, you can choose which GUI you want to put a pic on

8)

Hum...I understand what you want to do but I dont know how to use GuiCtrlCreatePic on the right GUI :)

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

might want to exchnge your longer UDF for this one

Func _TrayBoxAnimate($TBGui, $Xstyle = 0, $Xspeed = 1000)
    ; $Xstyle - 1=Fade, 3=Explode, 5=L-Slide, 7=R-Slide, 9=T-Slide, 11=B-Slide,
    ;13=TL-Diag-Slide, 15=TR-Diag-Slide, 17=BL-Diag-Slide, 19=BR-Diag-Slide
    Local $Xpick = StringSplit('80000,90000,40010,50010,40001,50002,40002,50001,40004,50008,40008,50004,40005,5000a,40006,50009,4000
9,50006,4000a,50005', ",")
    DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBGui, "int", $Xspeed, "long", "0x000" & $Xpick[$Xstyle])
EndFunc   ;==>_TrayBoxAnimate

8)

i just want to say 'Owesome!' very good script. your first script is working fine but this one is giving error

_TrayBoxAnimate()

^ ERROR

how to use it?


Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them.

Share this post


Link to post
Share on other sites

Have tried examples from my script ? Reply #3


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0