Moderators Melba23 Posted December 4, 2014 Author Moderators Share Posted December 4, 2014 (edited) Adm682860,I can only think that the error occurs when one of the internal UDF Adlib functions fires part way through the notification deletion/addition process - if this happens between the lines when the array is ReDimmed and when the count is reset then the array size and count might not match. So I have modified the UDF to temporarily cancel any active internal Adlib functions when the array in question is being modified - could you please test this Beta version and let me know if you still have the problem: <snip>Comments from any other users also welcome of course. M23 Edited December 5, 2014 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...
Adm682860 Posted December 4, 2014 Share Posted December 4, 2014 Ok. I will test this one. Link to comment Share on other sites More sharing options...
Adm682860 Posted December 4, 2014 Share Posted December 4, 2014 I think something about calling _Notify_Hide() in wich called _Notify_Delete interact with hiding other notifications by Timer in adlib code is simple - and not victim ; #FUNCTION# ==================================================================================================================== Func myNotifyShow($s, $iTime = 5, $iClick = 1) Local $hNotify = 0, $bReset = False ; если в начале <!> то фон желтенький If StringLeft($s, 1) = "!" Then _Notify_Set(0, Default, 0xFFFF80, "Arial", True, Default) $s = StringMid($s, 2) $bReset = True EndIf ; если в начале <#> то ; #ABCDEF#ABCDEF#... ; #цвет текста#цвет фона#... If StringLeft($s, 1) = "#" Then _Notify_Set(0, '0x' & StringMid($s,2,6), '0x' & StringMid($s,9,6), "Arial", True, Default) $s = StringMid($s, 16) $bReset = True EndIf $hNotify = _Notify_Show(0, "", $s, $iTime, $iClick) If $bReset Then _Notify_Set(Default) EndIf If $hNotify = -1 Then TrayTip ( $_myProgName & ": Уведомление", $s, $iTime, 2 ) EndIf Return $hNotify EndFunc ;==>myNotifyShow Link to comment Share on other sites More sharing options...
Adm682860 Posted December 5, 2014 Share Posted December 5, 2014 with Notify_Mod.au3 bug is still alive May be some video can help or may be not https://yadi.sk/i/Sh_RMrtedALeL Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 5, 2014 Author Moderators Share Posted December 5, 2014 (edited) Adm682860,No need for the video - I believe you! Try this Beta and see if you can break it. I have found another loop which depends on the array count element remaining the same and disabled the Adlib functions there as well:<snip>Any better? M23 Edited December 8, 2014 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...
Adm682860 Posted December 8, 2014 Share Posted December 8, 2014 I break this one too. Still did'nt have any clear idea how to completly kill this bug . May be using windows objects that used in multithreded app to sync threads, but this is too complex. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 8, 2014 Author Moderators Share Posted December 8, 2014 Adm682860,Sorry you are still having problems, but as you appear to be the only one to report this error on a regular basis I wonder if it has something to do with the way you are using the code? Anyway, unless you can come up with a series of actions which can reliably reproduce the error, I am at a loss as to how to debug further. Do let me know if you ever do find anything. 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...
Adm682860 Posted December 9, 2014 Share Posted December 9, 2014 Ok. I'll try to do something by myself and will notify you if succeeded Link to comment Share on other sites More sharing options...
StatQuo Posted January 9, 2015 Share Posted January 9, 2015 Many thanks for this awesome udf i have a q, how i can add custom function on click event ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 9, 2015 Author Moderators Share Posted January 9, 2015 StatQuo,Glad you find it useful. To fire a custom function on a click event, I suggest you use a Global variable as a flag and then set it within the UDF's _Notify_WM_MOUSEACTIVATE function. Poll this flag in your idle loop and action your function when it is set - not forgetting to clear the flag afterwards, of course. 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...
Yaerox Posted February 13, 2015 Share Posted February 13, 2015 (edited) When trying to run Notify_Examples.au3 I get the following: C:\Users\XXX\Desktop\Notify\Notify.au3(916,61) : ERROR: _GDIPlus_BitmapCreateFromScan0(): undefined function. $hBitmap_Resized = _GDIPlus_BitmapCreateFromScan0(32, 32) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\XXX\Desktop\Notify\Notify.au3(918,53) : ERROR: _GDIPlus_GraphicsSetInterpolationMode(): undefined function. _GDIPlus_GraphicsSetInterpolationMode($hBMP_Ctxt, 7) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\XXX\Desktop\Notify\Notify_Example.au3 - 3 error(s), 1 warning(s) !>15:24:14 AU3Check ended. Press F4 to jump to next error.rc:2 Yes I moved the UDFs into my Include Folder ... anyone got the old source code or know alternative functions? Edited February 13, 2015 by MikeWenzel Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 13, 2015 Author Moderators Share Posted February 13, 2015 MikeWenzel,The $__g_hGDIPDll variable was renamed within the GDI UDF during the 3.3.12.0 release last summer and I >updated the UDF to match. Upgrade your AutoIt version and it will all work nicely. If for some reason you do not want to update, just rename every instance of that variable in the UDF to $ghGDIPDll and it should work with earlier releases. 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...
Yaerox Posted February 13, 2015 Share Posted February 13, 2015 (edited) MikeWenzel, The $__g_hGDIPDll variable was renamed within the GDI UDF during the 3.3.12.0 release last summer and I >updated the UDF to match. Upgrade your AutoIt version and it will all work nicely. If for some reason you do not want to update, just rename every instance of that variable in the UDF to $ghGDIPDll and it should work with earlier releases. M23 Yeah I researched this just a second after my post. That's why I edited it. Sry for that. You got an idea how to fix the function-problem? Even caused by the AutoIIt Version? Edited February 13, 2015 by MikeWenzel Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 13, 2015 Author Moderators Share Posted February 13, 2015 MikeWenzel,I imagine those functions were also renamed at the same time, but I really do not remember. The current UDF works with the current AutoIt release (I have just checked) so updating would seem to be the best way to go. 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...
Deye Posted February 21, 2015 Share Posted February 21, 2015 M23is it possible to have a WM_COMMAND that when later in the script when _Notify_Show(0, "", "click to stop process") is usedwhen clicked in example.. , it will be possible to run commands and exit I want it to work independently while script commands are still running$hNot_1 = _Notify_Show(0, "", "process started, click to stop process") if possible, how would a routine for this be constructed?thanksDeye Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 21, 2015 Author Moderators Share Posted February 21, 2015 Deye,If you want to know when a notification has been clicked, I would use its handle and Adlib like this:#include "Notify.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) ; Show notification and save handle $hNotificationHandle = _Notify_Show(0, "Clickable", "Click to exit") ; Look for notification being closed on click AdlibRegister("_Check_Notify") While 1 Sleep(10) WEnd Func _Check_Notify() If Not WinExists($hNotificationHandle) Then MsgBox($MB_SYSTEMMODAL, "Clicked", "Script ending") Exit EndIf EndFunc Func On_Exit() Exit EndFuncThe script still runs while waiting and, as you can see, the closure is detected. 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 February 23, 2015 Author Moderators Share Posted February 23, 2015 Deye,If you would prefer a message-based solution you can do the following:-1. Add a line to the _Notify_WM_MOUSEACTIVATE function to send a message when a notification is retracted:expandcollapse popupFunc _Notify_WM_MOUSEACTIVATE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam ; Check timer is not checking If $aNotify_RetractMode[0] Then Return EndIf ; Check handler not already retracting If $aNotify_RetractMode[1] Then Return EndIf ; Set flag to show handler retracting $aNotify_RetractMode[1] = True For $i = $aNotify_Data[0][0] To 1 Step -1 ; Is it a click on a notification? If $hWnd = $aNotify_Data[$i][0] Then $aNotify_Data[0][5] = $i If $aNotify_Data[$i][5] Then ; Extend the notification AdlibRegister("_Notify_Extend", 100) Else ; Delete the notification if clickable If $aNotify_Data[$i][3] Then AdlibRegister("_Notify_Delete", 100) _WinAPI_PostMessage($hWnd, 0x0444, $hWnd, 0) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EndIf EndIf ExitLoop EndIf Next ; Clear Running flag $aNotify_RetractMode[1] = False Return "GUI_RUNDEFMSG" EndFunc ;==>_Notify_WM_MOUSEACTIVATE- 2. Register a user message function in your script and look for the sent message from the selected notification like this:#include "Notify_Mod.au3" #include <WinAPI.au3> Opt("TrayAutoPause", 0) ; Press ESC to exit script HotKeySet("{ESC}", "On_Exit") ; Register a user message GUIRegisterMsg(0x0444, "_Notify_WM_USER0444") ; In $WM_USER range ; Show notifications _Notify_RegMsg() _Notify_Locate(0) $hNotify_Exit = _Notify_Show(0, "Notify 1", "Click registered") ; This is the one which will fire when retracted _Notify_Show(0, "Notify 2", "Click ignored") While 1 Sleep(10) WEnd Func _Notify_WM_USER0444($hWnd, $iMsg, $wParam, $lParam) ; Check if handle of clicked notification matches the one we want If $wParam = $hNotify_Exit Then ConsoleWrite("Time to go!" & @CRLF) EndIf EndFunc Func On_Exit() Exit EndFuncI am not adding this to the UDF as it is outside of its "notification" scope and the Adlib method above is perfectly useable. But it was a fun little project for a rainy morning. 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...
Deye Posted February 28, 2015 Share Posted February 28, 2015 M23, I have used the Adlib method and it worked well thanks for the examples Deye Link to comment Share on other sites More sharing options...
TheDcoder Posted May 2, 2015 Share Posted May 2, 2015 Error:How:Clicked all click-able notifications, happened after ~5 seconds after the last notification disappeared EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 2, 2015 Author Moderators Share Posted May 2, 2015 TheDcoder,Did that happen when you ran the supplied example or your own code? If the latter then you know what to do...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...
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