ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / System notification functions
  • Overview
  • How to?
  • Click on a notification or a button of a notification
  • Functions and types of variables associated with interactive notifications
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
A notification is a small window that appears at the bottom right of the screen, and that can be viewed at any time in the Windows notification area.
This type of window has been standardized by Windows (using XML).
In version 27, you can easily create notifications to be displayed in Windows.
A notification can contain:
  • images,
  • text,
  • edit controls,
  • buttons,
  • combo boxes.
WINDEV includes multiple functions and WLanguage types to create these notifications.
How to?
To create and display a notification:
  1. Check if the user's system supports interactive notifications using SysNotificationCompatible.
  2. Create a variable of type sysNotification. This variable contains the full description of the notification.
    • To add input areas to the notification, create one or more variables of type sysNotificationInput. The Type property of this variable type determines whether the input area is a combo box or a text area.
    • To add buttons to the notification, create one or more variables of type sysNotificationButton. The Type property of this type of variable determines the type and position of the button to be created.
    • Define the actions to be performed when the user clicks the notification or a button of the notification (see next paragraph). These actions can correspond to:
      • a specific global procedure.
      • the "Receive a notification" optional project event (this event is called if the procedure does not exist or has not been specified in the Action property).
  3. Send the notification to the system with SysNotificationSend.

Click on a notification or a button of a notification

The information about the user's interaction with a notification is retrieved through a system of Callback procedures.
You can associate a specific procedure to each action performed on a notification (either on the notification itself or on its buttons). However, since a notification can reopen an application, a GLOBAL procedure must be used because it must be accessible from the moment the application is opened.
The name of the procedure to be executed is contained in the notification via the Action property. If no name is specified (e.g. a user-customized XML file is used), or the procedure is not found, the "Receive a notification" optional project event is executed.
Both the procedure and the "Receive a notification" optional project event should be in the following format:
PROCEDURE ProcedureName(arguments is string, data is array of string)
where:
  • <arguments> contains the arguments associated with the action (via the Note property of the sysNotification variable for a click on the notification, or via the Note property of the sysNotificationButton variable for a click on a button).
  • <data> contains the data entered by users in the controls of the notification (edit control or combo box). Each string has the following format:
    <Control name> + TAB + <Control value>
Remark: The procedures and the optional event are executed in the main thread of the application (direct access to the controls).
Functions and types of variables associated with interactive notifications
The following functions are used to handle interactive notifications:
InSysNotificationModeUsed to determine if the application is launched from an interactive notification in "Windows 10".
SysNotificationClearRemoves all interactive notifications previously sent by the current application.
SysNotificationCompatibleChecks if the operating system supports interactive notifications.
SysNotificationRemoveRemoves a previously sent interactive notification.
SysNotificationRemoveIDRemoves all previously sent interactive notifications that match the specified identifier (ID).
SysNotificationSendSends an interactive notification to the system in order to be displayed.

The following types of variables are used to handle interactive notifications:
sysNotificationThe sysNotification type is used to define all the advanced characteristics of an interactive system notification.
sysNotificationButtonThe sysNotificationButton type is used to define all the advanced characteristics of Button control in an interactive notification.
sysNotificationInputThe sysNotificationInput type is used to define all the advanced features of an input control, such as a text input or combo box control, in an interactive notification.
Related Examples:
WD Windows Notification Management Training (WINDEV): WD Windows Notification Management
[ + ] Starting with Windows 10, "toast" notifications (on the right side of the Desktop) are interactive, and enable you to include buttons, input areas and combo boxes.
This example shows how to use this type of notifications.
Minimum version required
  • Version 27
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help