Jump to content

Recommended Posts

Posted

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


 

  • Moderators
Posted

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

 

  • Moderators
Posted

[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

 

  • Moderators
Posted

[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

 

  • 5 months later...
  • Moderators
Posted

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

 

  • Moderators
Posted (edited)

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.

 

 

And of course comments from anyone else also welcome.

M23

Edited by Melba23
Beta code removed

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

 

  • Moderators
Posted (edited)

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":

 

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

M23

Edited by Melba23
Beta code removed

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

 

  • 2 months later...
  • Moderators
Posted (edited)

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:

Example script:

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

M23

Edited by Melba23
Beta code removed

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

 

Posted

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 💪

 

  • Moderators
Posted

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

 

  • Moderators
Posted

[NEW VERSION] - 26 Apr 19

Added: _Notify_RetractCheck allows the user to determine the retraction method (title clicked/message clicked/timeout) and content (title/message) of the last retracted notification.

New UDF and additional example 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

 

  • 1 month later...
Posted

I want to display a message on two lines, but when I change this variable, the notification is larger, but the message is not displayed correctly. Do you have any idea how to proceed?

original
Local $iNotify_Height = 40

after modif
Local $iNotify_Height = 80

ex code:
_Notify_Show(@AutoItExe, "Exemple", "Line 1 " & @CRLF & " Line 2", 0, 0)

Thank you

  • Moderators
Posted

Phil1991,

Welcome to the AutoIt forums.

Not only do you need to increase the height of the notification, you need to increase the height of the label in which the message is displayed. As you have not done this and as you are displaying a title, the message label remains sized for a single line.  If you really need 2 lines of message text then I suggest not using a title - which automatically gives you the possibility of a 2-line message.

As I have often stated, the idea of these notifications is to enable short messages to be passed to the user - and the limited size allows as many as possible to fit onto the screen. As for previous requests to make the notifications larger I am not prepared amend the code to allow this as it seems to me to be counter to the basic idea behind the UDF. If you insist on displaying longer messages, might I point you at my Toast and ExtMsgBox UDFs which do allow for much larger messages - and also for rather more user interaction.

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

 

Posted (edited)

OK Thanks Melba23!!

I will go see your other 2 UDFs. They maybe better suited to my needs in this case.

 

Edit:

Your Toast Udf wil probably solve my problem :)

Edited by Phil1991
Update
  • 5 months later...
Posted

Melba23, thanks for showing another of your apparently interesting UDF.

But I tried all the examples already and did not see a single notice. When starting and working examples, no errors occur. Tell me, what am I doing wrong? Maybe something needs to be pressed at the same time or some actions to be performed?

Autoit: 3.3.14.2
OS: Windows 8.1

  • Moderators
Posted

AndreyS,

The examples work for me in Win 7 and Win 10, so I do not see why they should not in Win 8. You should see the various notifications extend from the side of the screen - do you have a multiple monitor setup by any chance?

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

 

  • 1 year later...
Posted

The Notify.au3 script is awesome! Not only it answers my search for posting notifications in AutoIt, but looking at the code I learned A LOT! Thank you so much!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...