MilesAhead Posted March 26, 2015 Share Posted March 26, 2015 (edited) MilesAhead, Not off the top of my head - I will have a think. But this is pretty general problem as I often get overlapping notifications from various third-party apps that are running, so I am not sure it will be that easy. Are all of the apps using my UDF? M23 It's not something I'm running into. But now that I am doing AutoIt3 again I anticipate popping up a lot more Toast. The other thing I found.. I tried polling both the toast close variable and the toast handle as I way to skip an item in a loop. I have a delayed start type utility and I pop up Toast with a number to show the count down until I fire off the next application. I could skip easily enough using a default menu item and double clicking the Tray Icon. But with things loading and the tray icons shifting around I found it much easier to insert a flag variable in the event handler that detects the 'x' is clicked when Wait is False. I use that to skip a program in the list of delayed applications. Much more intuitive to close the window to skip the item. Anyway I thought you may consider it generally useful and perhaps put in a way to get a notification when the 'x' is clicked etc.. Edited March 26, 2015 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
MilesAhead Posted March 31, 2015 Share Posted March 31, 2015 (edited) For a program to know of others using Toast the only way I could think to implement it would be using RegisterWindowMessage and handling it. It could be done but kind of messy. It may be simpler to just allow the user to set a direction param in an ini file. In my utility I have done it this way by adding optional param $tdir onto _Toast_Show() and _Toast_Locate(). _Toast_Show() just passes the param to _Toast_Locate() so no need to show it. _Toast_Locate() I just doctor the data and return unless $tdir is 0 in which case it just passes to your code. The $tdir values 1 to 4 just set Toast to the middle of the work area edge clockwise, 1 being the left edge of work area centered, 2 = top, 3 = right, 4 = bottom etc.. That way if the user sees overlapping Toast (s)he can adjust one of the programs to display it in another spot. I made this change in _Toast_Locate() Func _toast_locate($itoast_width, $itoast_height, $tdir = 0) Local $atoast_data[3] Local $l, $t, $r, $b _getdesktopworkarea($l, $t, $r, $b) If $tdir = 1 Then $atoast_data[0] = $l $atoast_data[1] = Round($b / 2) $atoast_data[2] = 262145 $itoast_move = 327682 Return $atoast_data ElseIf $tdir = 2 Then $atoast_data[0] = Round($r / 2) - Round($itoast_width / 2) $atoast_data[1] = $t $atoast_data[2] = 262148 $itoast_move = 327688 Return $atoast_data ElseIf $tdir = 3 Then $atoast_data[0] = $r - $itoast_width $atoast_data[1] = Round($b / 2) - Round($itoast_height / 2) $atoast_data[2] = 262146 $itoast_move = 327681 Return $atoast_data ElseIf $tdir = 4 Then $atoast_data[0] = Round($r / 2) - Round($itoast_width / 2) $atoast_data[1] = $b - $itoast_height $atoast_data[2] = 262152 $itoast_move = 327684 Return $atoast_data EndIf ; if $tdir = 0 falls through to original code ... To be notified if somebody clicked the 'x' to close Toast I took the expedient of just checking for my global variable named $skip Func _toast_wm_events($hwnd, $msg, $wparam, $lparam) #forceref $wParam, $lParam If $hwnd = $htoast_handle Then If $msg = 33 Then Local $apos = GUIGetCursorInfo($htoast_handle) If $apos[4] = $htoast_close_x Then $ftoast_close = True If IsDeclared("skip") Then $skip = True ; user closed Toast to skip to next item EndIf EndIf EndIf EndIf Return "GUI_RUNDEFMSG" EndFunc ;==>_toast_wm_events In my count down loop while Toast is showing I loop 20 times (for each second in the count down)sleeping for 50 ms and checking $skip in every loop. It seems to work well. Makes it easy for someone to skip to the next item. In this case it is programs loaded at startup after various delays. Edited March 31, 2015 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 31, 2015 Author Moderators Share Posted March 31, 2015 (edited) MilesAhead,Thanks, I will look into the code tomorrow. M23 Edited March 31, 2015 by Melba23 23k 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...
MilesAhead Posted April 1, 2015 Share Posted April 1, 2015 My Freeware Page Link to comment Share on other sites More sharing options...
R0G Posted April 26, 2016 Share Posted April 26, 2016 Is it possible to "WinSetOnTop" a toast so that it's above a windows 10 notification? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 26, 2016 Author Moderators Share Posted April 26, 2016 R0G, The Toast is already created with the $WS_EX_TOPMOST style - I am not sure what more you can do if Windows decides to give its creations an even higher z-level. 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...
Trong Posted March 18, 2017 Share Posted March 18, 2017 new version will have icon type ? Regards, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 18, 2017 Author Moderators Share Posted March 18, 2017 You, Currently the UDF has the following options for the $vIcon parameter: ; Parameters ....: $vIcon - 0 - No icon, 8 - UAC, 16 - Stop, 32 - Query, 48 - Exclamation, 64 - Information ; The $MB_ICON constant can also be used for the last 4 above ; If set to the name of an exe, the main icon of that exe will be displayed ; If set to the name of an image file, that image will be displayed What more do you need? 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...
Danp2 Posted March 30, 2017 Share Posted March 30, 2017 Was testing some stuff out earlier today and found a possible bug. I have only be able to reproduce it by calling a function with a hotkey. #include "Toast.au3" $x = 0 HotKeySet("!d", "ShowToast") HotKeySet("{ESC}", "Terminate") While 1 Sleep(100) WEnd Func MyFunc() EndFunc Func Terminate() Exit EndFunc ;==>Terminate Func ShowToast() $x+= 1 _Toast_Show(0, "test title", String($x), -2, False) EndFunc If you press the hotkey while an existing Toast is retracting, the subsequent Toast disappears immediately. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 31, 2017 Author Moderators Share Posted March 31, 2017 (edited) Danp2, I see the problem - now trying to see why it happens. M23 Edit: I now know why it happens - looking to see how to prevent it. Edited March 31, 2017 by Melba23 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...
Danp2 Posted March 31, 2017 Share Posted March 31, 2017 M23, Seems like a tricky one to fix. I'll be interested to see your implementation. Dan Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 31, 2017 Author Moderators Share Posted March 31, 2017 Danp2, The problem is that the Hotkey interrupts the running script and so the running closure code stops while the new Toast is created. This means that when the closure code restarts the new Toast is taken as the current one and is immediately closed. I am trying to get the UDF to recognise this situation, but with no luck as yet. I may have to get into a serious rewrite so I hope you are not holding your breath for a solution! 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 March 31, 2017 Author Moderators Share Posted March 31, 2017 (edited) Danp2, OK, I think I have cracked it. If you call the _Toast_Show function via a HotKey you need to tell the UDF that is what is happening so that it can wait for the current retraction to finish before creating the new Toast. Please try this new version: <snip> and amend your script as follows: #include "Toast_Mod.au3" $x = 0 HotKeySet("!d", "ShowToast") HotKeySet("{ESC}", "Terminate") While 1 Sleep(100) WEnd Func MyFunc() EndFunc Func Terminate() Exit EndFunc ;==>Terminate Func ShowToast() $x+= 1 _Toast_Show(0, "test title", String($x), -2, False, False, "!d") ; Tell UDF which HotKey has been used to call it <<<<<<<<<<<<<<<<< EndFunc It works fine for me - I hope it does for you too. M23 Edited March 31, 2017 by Melba23 Beta code removed 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...
Danp2 Posted March 31, 2017 Share Posted March 31, 2017 M23, Yes, that appears to work. However, I wonder if the additional hotkey parameter is required. Seems like you could change the line If @HotKeyPressed = $sHotKey And $fToast_Retracting Then to If $fToast_Retracting Then and achieve the same result. Thoughts? Dan Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 31, 2017 Author Moderators Share Posted March 31, 2017 Danp2, Thanks a lot for that suggestion - you are quite right. I had added the @HotKeyPressed check earlier in the debugging process to see if a HotKey had been used to call the function and never thought of checking to see if it was still needed. An interesting little edge case bug - I will release a new version this weekend. 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...
Danp2 Posted March 31, 2017 Share Posted March 31, 2017 Great! One other question / suggestion -- Have you considered making the the animation speed user configurable? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 31, 2017 Author Moderators Share Posted March 31, 2017 (edited) Danp2, Quote making the the animation speed user configurable You mean like this: <snip> M23 Edited April 1, 2017 by Melba23 Beta code removed 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...
Danp2 Posted March 31, 2017 Share Posted March 31, 2017 Exactly. ;-) Thanks! Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 31, 2017 Author Moderators Share Posted March 31, 2017 Danp2, No problem - I owe you something for the bug report and code simplification suggestion! 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 April 1, 2017 Author Moderators Share Posted April 1, 2017 [NEW VERSION] - 1 Apr 17 Added: Ability to set time taken for Toast to extend and retract (default 1.0/.5 sec) Fixed: An edge case bug where showing a new Toast while the previous was actually retracting caused the new Toast to vanish instantly. Thanks to Danp2 for the report and feature request. New UDF and example in the first post. M23 MONaH-Rasta 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...
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