Moderators Melba23 Posted May 22, 2015 Author Moderators Share Posted May 22, 2015 (edited) ringerl,Please try out this Beta version and see if it meets your requirements: Notify_Mod.au3And here is a script to test it:expandcollapse popup#include "Notify_Mod.au3" Opt("TrayAutoPause", 0) ; Press ESC to exit script HotKeySet("{ESC}", "On_Exit") ; Register message for click event _Notify_RegMsg() ; Set notification location _Notify_Locate(0) _Notify_Set(Default) _Notify_Show(0, "Short title", "But with a very long message to force truncation until it fits into the maximum width") ConsoleWrite(@error & @CRLF) _Notify_Show(0, "Now a very long title to force truncation until it fits into the maximum width", "Short message") ConsoleWrite(@error & @CRLF) _Notify_Show(0, "", "No title so the message can span both lines without problem if it is long enough to need it but will be truncated if need be to fit in the maximum width") ConsoleWrite(@error & @CRLF) _Notify_Show(0, "", "No_title_so_the_message_can_span_both_lines_without_problem_if_it_is_long_enough_to_need_it_but_will_be_truncated_if_need_be_to_fit_in_the_maximum_width") ConsoleWrite(@error & @CRLF) ; Now allow for truncation.................................| ; | ; V _Notify_Set(0, Default, Default, Default, False, 250, 250, True) _Notify_Show(0, "Short title", "But with a very long message to force truncation until it fits into the maximum width") _Notify_Show(0, "Now a very long title to force truncation until it fits into the maximum width", "Short message") _Notify_Show(0, "", "No title so the message can span both lines without problem if it is long enough to need it but will be truncated if need be to fit in the maximum width") _Notify_Show(0, "", "No_title_so_the_message_can_span_both_lines_without_problem_if_it_is_long_enough_to_need_it_but_will_be_truncated_if_need_be_to_fit_in_the_maximum_width") While 1 Sleep(10) WEnd Func On_Exit() Exit EndFuncAs always, comments from anyone else also welcome.M23 Edited June 1, 2015 by Melba23 Re-uploaded file 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...
Chimaera Posted May 22, 2015 Share Posted May 22, 2015 (edited) The notify_mod link you just posted doesnt work m8Just goes to a blank page Edited May 22, 2015 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 22, 2015 Author Moderators Share Posted May 22, 2015 Chimaera,Seeing as that last effort was posted 6 times by the forum (good job I can delete posts!) I am not surprised that it did not work correctly. Try now.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...
Chimaera Posted May 22, 2015 Share Posted May 22, 2015 Works nowI came in in the middle of this convo but is this a possible alternative to toast?I ran that code and i got thisIs that correct, i even turned off the top set of notifys and still the same and i ran it both beta and normal If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
hucom Posted May 22, 2015 Share Posted May 22, 2015 I have reduced this fantastic script to just showing one clickable notification, but now it doesn't exit anymore... just pauses. After several hours, my head is swimming. I just need the script to fully exit, when the user clicks on the notification. What am I doing wrong?? Any help is MOST appreciated.Here's the code:expandcollapse popup#include "Notify.au3" Opt("TrayAutoPause", 0) ; Press ESC to exit script HotKeySet("{ESC}", "On_Exit") Global $fNot_1_Vis = True, $iBegin = 0 Global $sAutoIt_Path = StringRegExpReplace(@AutoItExe, "(^.*\\)(.*)", "\1") ; Register message for click event _Notify_RegMsg(0) ; Set notification location _Notify_Locate(0) ; Show notifications ; Set all values to default ; _Notify_Set(Default) ; _Notify_Show(@AutoItExe, "Not Clickable with EXE icon", "Retracts after 20 secs", 20, 0) ; Set Show time to 250 ms - note fast entry ; _Notify_Set(0, 0xFF0000, 0xFFFF00, "Courier New", False, 250) ; _Notify_Show(0, "Clickable", "Coloured - stays 40 secs if not clicked", 40) ; Change colours and font ; _Notify_Set(4, 0x0000FF, 0xCCFFCC, "Arial") ; _Notify_Show(0, "Clickable", "Only in margin until clicked - click again to retract", 50) ; Reset all values to default _Notify_Set(Default) _Notify_Show($sAutoIt_Path & "Examples\GUI\Torus.png", "Clickable with PNG", "Reset to default colours") ; Change justification, colours, font, Reset mode to Slide and Show mode to "fade in" 1000ms ; _Notify_Set(6, 0x0000FF, 0xCCCCFF, "Comic MS", True, -1000) ; _Notify_Show(48, "Not Clickable", "With an icon - stays 30 secs", 30, 0) ; Change them all again ; _Notify_Set(0, Default, 0xCCFF00, "Arial", True, Default) ; This one is clickable, but will only remain in the margin until clicked ;$hNot_1 = _Notify_Show(0, "", "No title so the message can span both lines without problem if it is long enough to need it") ; And again ; _Notify_Set(0, Default, 0xFF80FF, "MS Comic Sans", True) ; This one can only be retracted programatically 2 secs after the one above and will fade out, overriding the default setting ;$hNot_2 = _Notify_Show(0, "Programmed Fade", "This will disappear 2 seconds after the 'No Title' one", 0, 0, Default, -1000) While 1 Sleep(10) ;If Not WinExists($hNot_1) And $fNot_1_Vis = True Then ;$iBegin = TimerInit() ;$fNot_1_Vis = False ;EndIf If $iBegin And TimerDiff($iBegin) > 2000 And WinExists($hNot_2) Then _Notify_Hide($hNot_2) $iBegin = 0 EndIf WEnd Func On_Exit() Exit (0) EndFuncThank you so much!! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 22, 2015 Author Moderators Share Posted May 22, 2015 hucom,Welcome to the AutoIt forums.If you want the script to end when the notification is clicked, then all you need to do is wait until the notification no longer exists - like this:expandcollapse popup#include "Notify.au3" Opt("TrayAutoPause", 0) ; Press ESC to exit script HotKeySet("{ESC}", "On_Exit") Global $fNot_1_Vis = True, $iBegin = 0 Global $sAutoIt_Path = StringRegExpReplace(@AutoItExe, "(^.*\\)(.*)", "\1") ; Register message for click event _Notify_RegMsg() ; Set notification location _Notify_Locate(0) ; Reset all values to default _Notify_Set(Default) ; Show notification and note handle $hNotification = _Notify_Show($sAutoIt_Path & "Examples\GUI\Torus.png", "Clickable with PNG", "Reset to default colours") While 1 Sleep(10) ; Check to see if notification still exists If Not WinExists($hNotification) Then ; And exit if not On_Exit() EndIf WEnd Func On_Exit() Exit EndFuncBut I hope you realise that the UDF is designed to remain active as long as its parent script is active so that notifications can be shown when required - that is why the example script that I produced for the UDF (and from which the modified script above was drawn) remains active until a HotKey is pressed.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 May 22, 2015 Author Moderators Share Posted May 22, 2015 Chimaera,Sorry, I missed your post. Yes, that is what is supposed to happen - the titles/texts are truncated to fit if they are too long if the user has set the parameter in _Notify_Set. If not, then the notifications just do not appear and _Notify_Show returns an error.The UDF is indeed an alternative to Toast - the main difference is that you can show several notifications simultaneously, although by design they are smaller and less flexible in their content. The user can choose which UDF best suits their requirements - or indeed use both!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...
hucom Posted May 22, 2015 Share Posted May 22, 2015 (edited) If you want the script to end when the notification is clicked, then all you need to do is wait until the notification no longer exists - like this:Wow! You are so fast! I understand your intent and appreciate you input for the way I would like to use the code.I just tried your modification, now it just disappears right away (doesn't wait for any clicks).; Check to see if notification still exists If Not WinExists($hNotification) Then ; And exit if not On_Exit() EndIfI'm sorry, I feel like an idiot, but I'm a beginner with autoit...Thanks again! Edited May 22, 2015 by hucom Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 22, 2015 Author Moderators Share Posted May 22, 2015 hucom,Did you run the code exactly as I posted it? Because when I run it the notification stays there until clicked - which is what should happen. If you ran something different, please post the code so I can see what is happening.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...
hucom Posted May 22, 2015 Share Posted May 22, 2015 You are absolutely right, of course. I had pasted a modification from the forums (don't remember which one) of the "Notify" file itself. Now that I reverted that, it works like a charm. You are AWESOME. Thank's again!!! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 22, 2015 Author Moderators Share Posted May 22, 2015 hucom,Glad it is working now - and that you like the UDF itself.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...
hucom Posted May 22, 2015 Share Posted May 22, 2015 Glad it is working now - and that you like the UDF itself.The last (minor) issue I'm having, is that the .png goes missing when I compile the script (x86 or x64)."Examples\GUI\Torus.png"But if you don't have time to reply, I understand :-) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 22, 2015 Author Moderators Share Posted May 22, 2015 hucom,That is because the path used for the png is relative to the executing AutoIt interpreter - when you run the script in SciTE it uses the installed version and so the path is correct; when you compile, the interpreter is in the executable itself and the path is not correct. If you replace the current computed path with the full path to the image in your installation folder it will show - I have to use "M:\Program\AutoIt3\Examples\GUI\Torus.png".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 May 22, 2015 Author Moderators Share Posted May 22, 2015 ringerl,I see you keep looking at this thread - have you tried the Beta code I posted earlier?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...
Chimaera Posted May 31, 2015 Share Posted May 31, 2015 Chimaera,Sorry, I missed your post. Yes, that is what is supposed to happen - the titles/texts are truncated to fit if they are too long if the user has set the parameter in _Notify_Set. If not, then the notifications just do not appear and _Notify_Show returns an error.The UDF is indeed an alternative to Toast - the main difference is that you can show several notifications simultaneously, although by design they are smaller and less flexible in their content. The user can choose which UDF best suits their requirements - or indeed use both!M23Just got back of hols isnt it supposed to strech so you can read the message then? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 31, 2015 Author Moderators Share Posted May 31, 2015 Chimaera,No:...that is what is supposed to happen - the titles/texts are truncated to fit if they are too long......an alternative to Toast...by design they are smaller and less flexible in their content...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...
Chimaera Posted May 31, 2015 Share Posted May 31, 2015 (edited) Aaah ok sorry holiday lag ill stick to toast then actually crumpets first Edited May 31, 2015 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
ringerl Posted June 1, 2015 Share Posted June 1, 2015 (edited) ringerl,I see you keep looking at this thread - have you tried the Beta code I posted earlier?M23Hi Melba! Can't download anything following the link you posted, just getting a blank page. Edited June 1, 2015 by ringerl Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2015 Author Moderators Share Posted June 1, 2015 ringer,Sorry about that, it must have been corrupted by one of the many forum software changes - try now.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...
ringerl Posted June 10, 2015 Share Posted June 10, 2015 Still getting an empy page :/ 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