Integrating with Windows Toast Notifications

Posted by markgreenway on 09-Feb-2018 02:54

I'm currently working on a project where I need to display Windows toast notifications and hook into the Windows 10 action centre from within our Progress application. 

I've spent some time researching this and it looks like we mainly need access to the Windows.UI.Notifications Namespace. Initially I thought it might be as simple as adding the correct USING statement, but this doesn't appear to be directly available from Developer Studio.

I contacted Progress support who suggested that I should figure out what .NET references need to be added in order to access the Windows.UI.Notifications Namespace. So far I've had no luck figuring it out. They also suggested I try asking for help here.

Any suggestions or thoughts on how to get this working would be greatly appreciated.

Thanks,
Mark.

All Replies

Posted by Damien 3D on 09-Feb-2018 10:27

Hi,

I don't understand exactly what you name "Toast notification"....But in my software, i use the Infragistics.Win.Misc.UltraDesktopAlert

This object put message on the corner you want in the screen, and hide them automatiquely....perhaps like toast ?

look at this

e help.infragistics.com/.../Infragistics4.Win.Misc.v14.2~Infragistics.Win.Misc.UltraDesktopAlert~DropDownButtonVisible.html

and on google

and tell me if is that you look for.

Posted by OctavioOlguin on 09-Feb-2018 12:34

Im úsing this code... abeit is little buggy, as notifications remain in windows 10, on the notification area...  but it might be a good start.

 /*------------------------------------------------------------------------
    File        : NotifyToolTip
    Purpose     :
    Syntax

        USING procs.msg.NotifyToolTip FROM PROPATH.
        DEFINE VARIABLE Ballon        AS NotifyToolTip         NO-UNDO.
        Ballon = NEW NotifyToolTip ().
        ballon:ShowTip("Título", "Mensaje", 10).

    Description : Genera una Notificación tipo  Ballon Tool Tip en windows.
    Author(s)   : JorgeOctavioOlguin
    Created     : Fri Mar 10 15:53:44 CST 2017
    Notes       : Orignal  from Jeff Ledbetter  Tugboat Software..
  ----------------------------------------------------------------------*/

USING Progress.Lang.*.
USING System.ComponentModel.*.
USING System.Windows.Forms.*.

BLOCK-LEVEL ON ERROR UNDO, THROW.


CLASS Procs.Msg.NotifyToolTip:
    /*------------------------------------------------------------------------------
     Purpose:
     Notes:
    ------------------------------------------------------------------------------*/
    DEFINE VARIABLE components AS CLASS Container.
    DEFINE VARIABLE notifyIcon AS CLASS NotifyIcon.


	CONSTRUCTOR PUBLIC NotifyToolTip (  ):
		SUPER ().

        DEFINE VARIABLE cIconFilename AS CHARACTER NO-UNDO.

        cIconFilename = SEARCH("Procs\iconos\sch.ico").

        components = NEW System.ComponentModel.Container().

        notifyIcon = NEW System.Windows.Forms.NotifyIcon(components).
        notifyIcon:Text = "Sistema TAP".
        notifyIcon:Icon = NEW System.Drawing.Icon (cIconFilename).


	END CONSTRUCTOR.

	/*------------------------------------------------------------------------------
	 Purpose:
	 syntax: ballon:ShowTip("Conexión al servidor de Aplicaciones", "No se pudo conectar al sevidor SUCAHERSA", 10).
	------------------------------------------------------------------------------*/

	METHOD PUBLIC VOID ShowTip( INPUT pcTitle AS CHARACTER, INPUT pcText AS CHARACTER, INPUT piTime AS INTEGER ):

        notifyIcon:BalloonTipTitle = pcTitle.
        notifyIcon:BalloonTipText = pcText.
        notifyIcon:Visible = TRUE.
        notifyIcon:ShowBalloonTip(piTime).

		RETURN.

	END METHOD.

	DESTRUCTOR PUBLIC NotifyToolTip ( ):
        DELETE OBJECT components.
        DELETE OBJECT notifyIcon.
	END DESTRUCTOR.

END CLASS.

Good luck

Posted by markgreenway on 11-Feb-2018 14:00

Thanks for the replies and sample code, I'll give it a try.

Not sure if you can post links here, so you might not see this link, but this is what I mean by Windows Toast Notifications

blogs.msdn.microsoft.com/.../

These are similar to the Infragistics pop-ups but they can also be added into the Windows 10 action centre which I don't believe the Infragistics pop-ups can.

Mark.

This thread is closed