ResNullius Posted July 19, 2017 Share Posted July 19, 2017 Melba23, Had occasion to make use of your very excellent Toast UDF in a recent project. Don't know if's been addressed in the 14 pages of posts so far, but I required the ability to use specific icons from the compiled exe and so I made a slight modification beginning at line 279 of your source where you check to see if an exe or ico file was passed to the function as the $vIcon parameter. ;Replace lines 279 to 286 in 01 April 17 verion of TOAST.AU3 ;Added by ResNullius to accomodate choice of multiple icons in exe, dll If StringInStr($vIcon, "|") Then $iIcon_Style = StringRegExpReplace($vIcon, "(.*)\|", "") $sDLL = StringRegExpReplace($vIcon, "\|.*$", "") Else ;End Added by ResNullius to accomodate numbered icons in exe Switch StringLower(StringRight($vIcon, 3)) Case "exe", "ico" $sDLL = $vIcon $iIcon_Style = 0 Case "bmp", "jpg", "gif", "png" $sImg = $vIcon EndSwitch EndIf EndIf I call it from the compiled script like this: _Toast_Show(@AutoItExe & "|203", "My Program", "My Message",3) ;or _ToastShow("C:\CoolScripts\MyCoolScript.exe|201","My Cool Script", "My Cool Message",3) The pipe symbol "|" is used to separate the file name from the icon's resource/ordinal name. Not tested extensively, but worked a treat for my purposes. Thanks again for all you do for this community! MONaH-Rasta and coffeeturtle 2 Link to comment Share on other sites More sharing options...
Draygoes Posted December 11, 2017 Share Posted December 11, 2017 Thank you very much for this. Found it more useful than my normal notification script (which launches a centered interface and must be rewritten for every small change). Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
Cotino Posted March 28, 2018 Share Posted March 28, 2018 Thanks for this UDF, works great. Is there a way to stack notifications ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 28, 2018 Author Moderators Share Posted March 28, 2018 Cotino, Take a look at my Notify UDF - that enables you to have multiple notifications at the same time. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Cotino Posted March 29, 2018 Share Posted March 29, 2018 Not as nice as toasts, but that'll do ! Thanks ! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 29, 2018 Author Moderators Share Posted March 29, 2018 Cotino, Glad I could help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 2, 2018 Author Moderators Share Posted August 2, 2018 [NEW VERSION] - 2 Aug 18 Added: When specifying the icon to use, if the $vIcon parameter is set to the name of an ico or exe file, the main icon within will be displayed, but if a trailing "|" followed by the icon index is added to the name, that icon from within the file is used New UDF and example in the first post. M23 coffeeturtle and MONaH-Rasta 1 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Subz Posted April 19, 2021 Share Posted April 19, 2021 Setting up a toast notification using Task Scheduler on Kiosk computers but appear to be getting some odd behaviour, a couple of users have reported the the toast is appearing in the top left hand corner of the screen opposed to above the system tray (bottom right). It doesn't always occur and unfortunately I've been unable to replicate the issue, I though it might be related to the script starting before the system tray appears but would have expected an error with GuiCreate in _Toast_Show() function. Users profiles are removed on log off so default settings should always be applicable, i.e. system tray is always set to the bottom right of the screen. Will look at creating default dimensions if $aTray_Pos = WinGetPos(...) returns an error. Has anyone else seen this behavior? Link to comment Share on other sites More sharing options...
lee321987 Posted July 19, 2022 Share Posted July 19, 2022 (edited) I'm getting crashes when I have my Windows 10's Taskbar set to automatically hide. Error: "H:\include\Toast.au3" (361) : ==> Subscript used on non-accessible variable.: $hToast_Handle = GUICreate("", $iToast_Width, $iToast_Height, $aToast_Data[0], $aToast_Data[1], 0x80880000, BitOR(0x00000080, 0x00000008)) $hToast_Handle = GUICreate("", $iToast_Width, $iToast_Height, $aToast_Data^ ERROR Most people would probably never find this bug, but I wrote an alarm program that repeatedly shows and hides a Toast, so I encounter the bug pretty frequently. To reproduce: Right-click the Taskbar and click "Taskbar Settings". Turn on "Automatically hide the Taskbar in Desktop mode". Then run this script and repeatedly tap the Windows key fast (to show/hide the Taskbar) until you get a crash: #include <Toast.au3> _Toast_Set(-1, -1, -1, -1, -1, 14, "Arial", 100, 100) While 1 _Toast_Show(@ScriptFullPath, @ScriptName, 'foo') WEnd Edited July 19, 2022 by lee321987 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 20, 2022 Author Moderators Share Posted July 20, 2022 lee321987, Using a Toast to "flash" like that is completely outside the normal use parameters of the UDF. And needing to "repeatedly tap the Windows key fast" to induce the error is also well outside any normal usage that can be expected. As a result I am not going to investigate your error further. For your interest it is caused by the UDF being unable to correctly calculate the required position of the Toast - and that is hardly surprising given that the taskbar would be constantly appearing and reappearing while the Toast was extending and retracting extremely rapidly. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
clarencemr Posted July 22 Share Posted July 22 On 2/8/2018 at 10:03, Melba23 said: [NUEVA VERSIÓN] - 2 de agosto de 2018 Agregado : Al especificar el ícono a usar, si el parámetro $vIcon se establece en el nombre de un archivo ico o exe, se mostrará el ícono principal dentro del archivo, pero si se agrega un "|" final seguido del índice del ícono al nombre, se usa ese ícono dentro del archivo. Nueva UDF y ejemplo en el primer post. M23 You could give an example using "|" please Link to comment Share on other sites More sharing options...
ResNullius Posted July 23 Share Posted July 23 3 hours ago, clarencemr said: You could give an example using "|" please see the example at the bottom of this post: clarencemr 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now