What error do you get?it gives an include error
Have you tried with StringSize in the same folder as the Toast UDF?
M23
Posted 09 June 2011 - 08:27 AM
What error do you get?it gives an include error
Posted 10 June 2011 - 01:27 PM
Posted 11 June 2011 - 10:24 PM
Posted 11 June 2011 - 10:26 PM
Example List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _DesktopDimensions() • _DisplayPassword() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringIsValid() • _StringReplaceWholeWord() • _StringStripChar() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • AutoIt Search • AutoIt3 Portable • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • FileInstallr • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIGetBkColor() • LockFile() • PasteBin • SciTE Jump • Signature Creator • WM_COPYDATA • More Examples...Updated: 11/04/2013
Posted 12 August 2011 - 07:14 PM
Posted 14 December 2011 - 06:00 PM
Edited by Syed23, 14 December 2011 - 06:01 PM.
Posted 14 December 2011 - 06:15 PM
#include-once ; Declare AnimateWindow constants Global Const $AW_FADE_IN = 0x00080000 Global Const $AW_FADE_OUT = 0x00090000 Global Const $AW_EXPLODE = 0x00040010 Global Const $AW_IMPLODE = 0x00050010 Global Const $AW_SLIDE_IN_LEFT = 0x00040001 Global Const $AW_SLIDE_OUT_LEFT = 0x00050002 Global Const $AW_SLIDE_IN_RIGHT = 0x00040002 Global Const $AW_SLIDE_OUT_RIGHT = 0x00050001 Global Const $AW_SLIDE_IN_TOP = 0x00040004 Global Const $AW_SLIDE_OUT_TOP = 0x00050008 Global Const $AW_SLIDE_IN_BOTTOM = 0x00040008 Global Const $AW_SLIDE_OUT_BOTTOM = 0x00050004 Global Const $AW_DIAG_SLIDE_IN_TOPLEFT = 0x00040005 Global Const $AW_DIAG_SLIDE_OUT_TOPLEFT = 0x0005000A Global Const $AW_DIAG_SLIDE_IN_TOPRIGHT = 0x00040006 Global Const $AW_DIAG_SLIDE_OUT_TOPRIGHT = 0x00050009 Global Const $AW_DIAG_SLIDE_IN_BOTTOMLEFT = 0x00040009 Global Const $AW_DIAG_SLIDE_OUT_BOTTOMLEFT = 0x00050006 Global Const $AW_DIAG_SLIDE_IN_BOTTOMRIGHT = 0x0004000A Global Const $AW_DIAG_SLIDE_OUT_BOTTOMRIGHT = 0x00050005 ; #FUNCTION# ========================================================================================================= ; Name...........: _WinAnimate ; Description ...: Animates windows by sliding, fading or exploding in/out ; Syntax.........: _WinAnimate($v_gui, $i_mode, [$i_duration]) ; Parameters ....: $v_gui -> Either handle or title of window to animate ; $i_mode -> $AW constant from above ; $i_duration -> Speed of animation (higher = slower) ; Requirement(s).: v3.2.12.1 or higher ; Return values .: Success: Returns 1 ; Failure: Returns 0, Error 1 = DLL call fail, Error 2 = OS version incapable ; Author ........: Gary Frost ; Example........; Yes ;===================================================================================================================== Func _WinAnimate($h_gui, $i_mode, $i_duration = 1000) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $h_gui, "int", $i_duration, "long", $i_mode) Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError') If $ai_gle[0] <> 0 Then Return SetError(1, 0, 0) EndIf Return 1 EndFunc ;==> $RetValue = _WinAnimate() ; Example $hwnd = GUICreate("AnimateWindow - Demo", @DesktopWidth, @DesktopHeight - 40, 0, 0) GUISetBkColor(0xFFFF00) $RetValue = _WinAnimate($hwnd, $AW_FADE_IN) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_FADE_OUT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_EXPLODE) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_IMPLODE) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_SLIDE_IN_LEFT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_SLIDE_OUT_LEFT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_SLIDE_IN_RIGHT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_SLIDE_OUT_RIGHT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_SLIDE_IN_TOP) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_SLIDE_OUT_TOP) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_SLIDE_IN_BOTTOM) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_SLIDE_OUT_BOTTOM) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_DIAG_SLIDE_IN_TOPLEFT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_DIAG_SLIDE_OUT_TOPLEFT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_DIAG_SLIDE_IN_TOPRIGHT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_DIAG_SLIDE_OUT_TOPRIGHT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_DIAG_SLIDE_IN_BOTTOMLEFT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_DIAG_SLIDE_OUT_BOTTOMLEFT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_DIAG_SLIDE_IN_BOTTOMRIGHT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Sleep(1500) $RetValue = _WinAnimate($hwnd, $AW_DIAG_SLIDE_OUT_BOTTOMRIGHT) ConsoleWrite($RetValue & " " & "Err: " & @error & " " & "Ext: " & @extended & @CRLF) Exit
Posted 14 December 2011 - 06:18 PM
Posted 16 December 2011 - 10:58 AM
Hannes123,
I have no idea why running the UDF in an the RDP session produces the Toast in the wrong vertical location. I can only imagine that UDF misreads the position of the remote taskbar in some way, but as I do not use RDP I cannot really suggest any way to get round it..
Edited by jmon, 16 December 2011 - 10:59 AM.
www.jmontserrat.comFile Sequence UDF - _StringExtractPaths - _StringTrimPattern - GuiCtrlSetOnTop - CalendarUDF
Posted 16 December 2011 - 10:59 AM
Posted 16 December 2011 - 12:32 PM
but when I'm using Aero the results are different >>[0] = -2
[1] = -2
[2] = 1370 ; @DesktopWidth is 1366
[3] = 30
As you can see the first difference is the position of the taskbar, the second problem is @DesktopWidth has a difference of 4px, but in Aero mode this is the same value (I would expect that because it spans the width of the monitor!) Therefore the logical solution (after 30mins of staring at my screen) was to calculate the offset difference of X and Y, multiply by 2 and subtract from @DesktopWidth/Height e.g. -2 * 2 = -4 and then 1366 - -4 = 1370 the new desktop width.[0] = 0
[1] = 0
[2] = 1366 ; @DesktopWidth is 1366
[3] = 30
; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _Toast_Locate ; Description ...: Find Systray and determine Toast start position and movement direction ; Syntax ........: _Toast_Locate($iToast_Width, $iToast_Height) ; Parameters ....: $iToast_Width - required width of slice ; $iToast_Height - required height of slice ; Author ........: Melba23, based on some original code by GioVit ; Modified.......: guinness to work with Classic Theme mode on Windows Vista+ ; Remarks .......: This function is used internally by _Toast_Show ; =============================================================================================================================== Func _Toast_Locate($iToast_Width, $iToast_Height) ; Define return array Local $aToast_Data[3] ; Workaround for Windows Vista+ Classic Theme mode, as @DesktopHeight/Width return different values Local $iDiff = 0 ; Find systray Local $iPrevMode = Opt("WinTitleMatchMode", 4) Local $aTray_Pos = WinGetPos("[CLASS:Shell_TrayWnd]") Opt("WinTitleMatchMode", $iPrevMode) ; If error in finding systray If Not IsArray($aTray_Pos) Then Return SetError(2, 0, -1) ; Workaround for Windows Vista+ Classic Theme mode For $i = 0 To 1 If $aTray_Pos[$i] < 0 Then $iDiff = ($aTray_Pos[$i] * 2) $aTray_Pos[$i] = 0 EndIf Next ; Get the height & width of the main desktop as well as subtracting the offset difference Local $iDesktopHeight = @DesktopHeight - $iDiff, $iDesktopWidth = @DesktopWidth - $iDiff ; Determine direction of Toast motion and starting position If $aTray_Pos[1] > 0 Then $iToast_Move = 0x00050004 ; $AW_SLIDE_OUT_BOTTOM $aToast_Data[0] = $iDesktopWidth - $iToast_Width - 10 $aToast_Data[1] = $aTray_Pos[1] - $iToast_Height $aToast_Data[2] = 0x00040008 ; $AW_SLIDE_IN_BOTTOM ElseIf $aTray_Pos[0] > 0 Then $iToast_Move = 0x00050001 ; $AW_SLIDE_OUT_RIGHT $aToast_Data[0] = $aTray_Pos[0] - $iToast_Width $aToast_Data[1] = $iDesktopHeight - $iToast_Height - 10 $aToast_Data[2] = 0x00040002 ; $AW_SLIDE_IN_RIGHT ElseIf $aTray_Pos[2] = $iDesktopWidth Then $iToast_Move = 0x00050008 ; $AW_SLIDE_OUT_TOP $aToast_Data[0] = $iDesktopWidth - $iToast_Width - 10 $aToast_Data[1] = $aTray_Pos[1] + $aTray_Pos[3] $aToast_Data[2] = 0x00040004 ; $AW_SLIDE_IN_TOP ElseIf $aTray_Pos[3] = $iDesktopHeight Then $iToast_Move = 0x00050002 ; $AW_SLIDE_OUT_LEFT $aToast_Data[0] = $aTray_Pos[0] + $aTray_Pos[2] $aToast_Data[1] = $iDesktopHeight - $iToast_Height - 10 $aToast_Data[2] = 0x00040001 ; $AW_SLIDE_IN_LEFT EndIf Return $aToast_Data EndFunc ;==>_Toast_Locate
Edited by guinness, 16 December 2011 - 12:35 PM.
Example List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _DesktopDimensions() • _DisplayPassword() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringIsValid() • _StringReplaceWholeWord() • _StringStripChar() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • AutoIt Search • AutoIt3 Portable • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • FileInstallr • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIGetBkColor() • LockFile() • PasteBin • SciTE Jump • Signature Creator • WM_COPYDATA • More Examples...Updated: 11/04/2013
Posted 16 December 2011 - 02:13 PM
Posted 16 December 2011 - 02:39 PM
Edited by guinness, 16 December 2011 - 02:41 PM.
Example List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _DesktopDimensions() • _DisplayPassword() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringIsValid() • _StringReplaceWholeWord() • _StringStripChar() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • AutoIt Search • AutoIt3 Portable • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • FileInstallr • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIGetBkColor() • LockFile() • PasteBin • SciTE Jump • Signature Creator • WM_COPYDATA • More Examples...Updated: 11/04/2013
Posted 18 December 2011 - 07:45 AM
Posted 18 December 2011 - 09:48 AM
Posted 18 December 2011 - 08:17 PM
Func _SetDesktopWorkArea($left, $top, $right, $bottom) Local Const $SPI_SETWORKAREA = 47 Local Const $SPI_GETWORKAREA = 48 Local $tRcWA = DllStructCreate($tagRECT) DllStructSetData($tRcWA, "Left", $left) DllStructSetData($tRcWA, "Top", $top) DllStructSetData($tRcWA, "Right", $right) DllStructSetData($tRcWA, "Bottom", $bottom) Return _WinAPI_SystemParametersInfo($SPI_SETWORKAREA, 0, DllStructGetPtr($tRcWA)) EndFunc ;==>_SetDesktopWorkArea
Posted 19 December 2011 - 02:31 PM
Glad to help, your udf is so nice. I still didn't have time to look into it, but hopefully tomorrow I will. Thanks.. Thanks for finding the bug.
www.jmontserrat.comFile Sequence UDF - _StringExtractPaths - _StringTrimPattern - GuiCtrlSetOnTop - CalendarUDF
Posted 19 December 2011 - 03:05 PM
Posted 20 December 2011 - 09:09 PM
0 members, 0 guests, 0 anonymous users