Jump to content
Melba23

Notify - New version 2 Aug 18

Recommended Posts

Thanks Melba,

Had to go out for a couple of hours, will get back to this as soon as i return

Share this post


Link to post
Share on other sites

Great, it Works now :thumbsup:
Here is how I used it, including a fix for the notification placement for the desktop screen which sometimes overlaps the clock area

For $i = 1 To $aEDM[0][0]
        $hDisplay = $aEDM[$i][0] ; 1 for first handle, 2 for second
        $tRect = _WinAPI_GetMonitorInfo($hDisplay)
        If @error Then Return SetError(3, 0, 0)
        $aCoords[$i][0] = DllStructGetData($tRect[1], 'Left')
        $aCoords[$i][1] = DllStructGetData($tRect[1], 'Top')
        $aCoords[$i][2] = DllStructGetData($tRect[1], 'Right')
        $aCoords[$i][3] = DllStructGetData($tRect[1], 'Bottom')
        ;Edit < < < < < < < < < < < < < < < < < < < < < < < < < >
        If _WinAPI_MonitorFromWindow('', $MONITOR_DEFAULTTOPRIMARY) = $aEDM[$i][0] Then
            If Not _IsTaskbarHidden() Then ;https://www.autoitscript.com/wiki/Snippets_(_Windows_Information_)
                Local $shellWinRect = WinGetClientSize(_WinAPI_GetShellWindow())
                If $shellWinRect[1] = $aCoords[$i][3] Then
                    Local $aTaskbar_Hight = WinGetClientSize("[Class:Shell_TrayWnd]")
                    $aCoords[$i][3] -= $aTaskbar_Hight[1]
                EndIf
            EndIf
        EndIf
        If $aEDM[$i][0] = _WinAPI_MonitorFromWindow(WinGetHandle("My Title", "")) Then
            $iIndex = $i
            $iForceMonitor = $i
        EndIf
    Next


 

Share this post


Link to post
Share on other sites

Deye,

Delighted to hear it. I will release a new version of the UDF this weekend.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

[NEW VERSION] - 4 Jun 17

Added_Notify_Locate now takes an optional second parameter which, when used in a multiple monitor setup, will force the notifications to appear on a specified monitor rather than the left and right side of the entire display area.

New UDF in the first post.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

[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 examples in the zip in the first post.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

User751139,

Sorry for the delay in replying - local internet outage.

Glad you like the UDF. But at first glance I cannot see any easy way to get clickable links into the notifications - but I will think more about it over the weekend.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

User751139,

I could not get an actual link in the notification - but I have managed to code a pseudo-link (simply underlined the message) and written a new function to tell the user just how a notification was retracted. Take a look at this beta code and example and let me know what you think.

Notify_Mod.au3

Notify_Mod_Ex.au3

And of course comments from anyone else also welcome.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

User751139,

More testing has shown that the above script is not as reliable as I would like in detecting clicks on the actual text of the message rather then the whitespace around it. So I have simplified the code to limit the retraction detection function to simply return "timeout / title clicked / message clicked":

Notify_Mod_Simple.au3

I will probably use this version as the basis for a release - does it help you at all?

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi,

AndroidZero started another thread asking how to read the content of a clicked notification. Here is some Beta code which has this facility along with the title/message clicked functionality from the posts above:

UDF: Notify_Mod_TextRet.au3

Example script: Notify_Mod_TextRet_Ex.au3

Let me know if it is of use to anyone, particularly AndroidZero!

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

You forgot to store the message & title content of a notification that expired on timeout, well at least i missed it for my needs.
Added following Line in Notify_Mod_TextRet.au3 (Script Line 887)

Func __Notify_Timer()
...
$g_aNotify_Data[0][9] = GUICtrlRead($g_aNotify_Data[$i][8]) & Opt("GUIDataSeparatorChar") & GUICtrlRead($g_aNotify_Data[$i][9])
..

I added a few functions from my current project to your example and it works like a charm for me !

#include "Notify_Mod_TextRet.au3"
#include <MSSQL.au3>

Opt("TrayAutoPause", 0)

; Press ESC to exit script
HotKeySet("{ESC}", "_Exit")

Global $samAccName = @UserName, _
        $SQL_SERVER = "192.168.10.28", _
        $SQL_USER = "devZero", _
        $SQL_PW = "xxxxxxxxx", _
        $SQL_DB = "kmp"

; Register message for click event
_Notify_RegMsg()

; Set notification location
_Notify_Locate(0)

; Show notifications
Global $aNotCID[5]
$aNotCID[0] = _Notify_Show(0, "Ticket 1", "Message 1")
$aNotCID[1] = _Notify_Show(0, "Ticket 2", "Message 2")
$aNotCID[2] = _Notify_Show(0, "Ticket 3", "Message 3")
$aNotCID[3] = _Notify_Show(0, "Message - Andreas", "This is a test message click to answere")
$aNotCID[4] = _Notify_Show(0, "Status", "SQL Server [online]", 1)

While 1
    Sleep(10)
;~ Opt("GUIDataSeparatorChar")
    For $i = 0 To 4
        Local $sRet = _Notify_RetractCheck($aNotCID[$i])
        Local $reason = $sRet[0]
        If $reason <> 0 Then
            Local $title = StringSplit($sRet[1],"|",1)[1]
            Local $msg = StringSplit($sRet[1],"|",1)[2]
            Local $timestamp = @MDAY & "." & @MON & "." & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC
        EndIf


        If $reason == 0 Then
            ;===== nothing ====
        ElseIf $reason == 1 Then
            ConsoleWrite(@CRLF & "========= $aNotCID[" & $i & "] =========")
            ConsoleWrite(@CRLF & "RetractCheck: Clicked Title")
            ConsoleWrite(@CRLF & "Title: " & $title)
            ConsoleWrite(@CRLF & "Message: " & $msg)
;~          Local $mscon = _MSSQL_Con($SQL_SERVER, $SQL_USER, $SQL_PW, $SQL_DB)
;~          _MSSQL_Query($mscon, "INSERT INTO ticketlog (samAccName, notifyRetract, notifyTitle, notifyMessage, timeStamp) " & _
;~                      "VALUES ('" & $samAccName & "','" & $title & "','" & $msg & "','" & $timestamp & "')")
            If StringInStr($title,"Message", 1) Then
                $msgFrom = StringSplit($title," - ", 1)[2]
                _UDP_Messenger("Popup", "ChatWindow", $msgFrom)
            ElseIf StringInStr($title,"Ticket", 1) Then
                $ticketNr = StringSplit($title," ", 1)[2]
                _Ticket_Window("Edit", $ticketNr, Default, Default)
            EndIf
        ElseIf $reason == 2 Then
            ConsoleWrite(@CRLF & "========= $aNotCID[" & $i & "] =========")
            ConsoleWrite(@CRLF & "RetractCheck: Clicked Message")
            ConsoleWrite(@CRLF & "Title: " & $title)
            ConsoleWrite(@CRLF & "Message: " & $msg)
;~          Local $mscon = _MSSQL_Con($SQL_SERVER, $SQL_USER, $SQL_PW, $SQL_DB)
;~          _MSSQL_Query($mscon, "INSERT INTO ticketlog (samAccName, notifyRetract, notifyTitle, notifyMessage, timeStamp) " & _
;~                      "VALUES ('" & $samAccName & "','" & $title & "','" & $msg & "','" & $timestamp & "')")
            If StringInStr($title,"Message", 1) Then
                $msgFrom = StringSplit($title," - ", 1)[2]
                _UDP_Messenger("Popup", "ChatWindow", $msgFrom)
            ElseIf StringInStr($title,"Ticket", 1) Then
                $ticketNr = StringSplit($title," ", 1)[2]
                _Ticket_Window("Edit", $ticketNr, Default, Default)
            EndIf
        ElseIf $reason == 9 Then
            ConsoleWrite(@CRLF & "========= $aNotCID[" & $i & "] =========")
            ConsoleWrite(@CRLF & "RetractCheck: Timeout")
            ConsoleWrite(@CRLF & "Title: " & $title)
            ConsoleWrite(@CRLF & "Message: " & $msg)
;~          Local $mscon = _MSSQL_Con($SQL_SERVER, $SQL_USER, $SQL_PW, $SQL_DB)
;~          _MSSQL_Query($mscon, "INSERT INTO ticketlog (samAccName, notifyRetract, notifyTitle, notifyMessage, timeStamp) " & _
;~                      "VALUES ('" & $samAccName & "','" & $title & "','" & $msg & "','" & $timestamp & "')")
;~          _MSSQL_End($mscon)
        EndIf
    Next

WEnd

Func _Exit()
    Exit
EndFunc


Func _UDP_Messenger($mode, $window, $from)
    ; too big to show
EndFunc
Func _Ticket_Window($mode, $index, $styleLV, $styleGrid)
    ; too big to show
EndFunc


Really love your Notify UDF and since the last change it even more comfortable.
Also I got a lot of ideas how to make it more customizeable and what new features could be usefull #GDI+ Animation.
I will share the modified notify UDF when all tests are finished until then keep up your excellent work 💪

 

Share this post


Link to post
Share on other sites

AndroidZero,

I did wonder whether to add the content to a timeout retraction - as you found out it is not difficult to do, so I will add that for the next release. Glad you find the new functionality useful.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...