Help / WLanguage / WLanguage functions / Standard functions / Windows functions / System functions
  • Mouse (or stylus) actions on the icon
  • Taskbar icons
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Adds a system tray icon (in the lower-right corner of the screen).
The following elements can be associated with this icon:
  • a context menu,
  • a tooltip shown when the icon is hovered over by the mouse (or stylus),
  • a procedure called automatically when the user interacts with the icon.
// Add the "C:\Icons\Icon.ICO" icon to the taskbar
ResAddIcon = SysIconAdd("C:\Icons\Icon.ICO", "", "Sales 2022")
pProc is procédure = MyProc
SysIconAdd(fExeDir() + "\icon.ico", MENU_NoName1, "Message", pProc)
<Result> = SysIconAdd(<Icon> [, <Menu name> [, <Hover text> [, <WLanguage procedure>]]])
<Result>: Boolean
  • True if the icon was added,
  • False otherwise.
<Icon>: Character string or Icon variable
Corresponds to one of the following elements:
  • Name and full (or relative) path of the icon file to add. A UNC path is allowed.
  • Name of a variable of type Icon.
Remark: The first valid image (other than PNG) found in the icon file is used and adapted to the 16x16 format. If the icon file contains in first position an image in 16x16 / 32 bpp, the quality of the icon will be very high. If the icon file contains in first position an image in 48x48 / 32 bpp, the quality of the icon will be very poor.
<Menu name>: Optional character string
Name of the context menu associated with the icon.
If this parameter corresponds to an empty string ("") or if it is not specified, no menu will be associated with the icon.
This menu will be displayed when a right click is performed on the icon by the mouse (or by the stylus). This menu must belong to an opened window (this window can be hidden).
<Hover text>: Optional character string
Tooltip shown when the icon is hovered over by the mouse or stylus (up to 64 characters).
If this parameter is not specified or is an empty string (""), no tooltip will be displayed.
<WLanguage procedure>: Optional procedure name
Name of the WLanguage procedure called during a mouse (or stylus) operation on the icon. If this parameter is not specified, no procedure will be executed when there is a mouse action on the icon.
Remark: This parameter can correspond to a Procedure variable.

Mouse (or stylus) actions on the icon

<WLanguage procedure> is called on each mouse (or stylus) action on the icon. This procedure is declared as follows:

PROCEDURE <Procedure name>(<Type of mouse/stylus operation>)
where <Type of mouse/stylus operation> corresponds to the Windows message identifying the type of operation performed by the mouse or stylus.
To easily manage the constants corresponding to the different types of operation, insert the following code in the initialization code of the project:
EXTERN "WinConst.wl"
The Winconst.wl file contains all the declarations of the Windows constants.
The different types of operations for the mouse are:
  • Left double click: WM_LBUTTONDBLCLK = 515
  • Left button down: WM_LBUTTONDOWN = 513
  • Left button up: WM_LBUTTONUP = 514
  • Middle double click: WM_MBUTTONDBLCLK = 521
  • Middle button down: WM_MBUTTONDOWN = 519
  • Middle button up: WM_MBUTTONUP = 520
  • Right double click: WM_RBUTTONDBLCLK = 518
  • Right button down: WM_RBUTTONDOWN = 516
  • Right button up: WM_RBUTTONUP = 517
The different types of operations for the stylus are:
  • Double click: WM_LBUTTONDBLCLK = 515
  • Button down: WM_LBUTTONDOWN = 513
  • Button up: WM_LBUTTONUP = 514

Taskbar icons

  • A single icon can be added to an application. You cannot add several ones.
  • SysIconModify is used to modify the icon.
  • SysIconDelete is used to delete the icon. The icon is automatically deleted when closing the application.
  • To add the icon to the taskbar without displaying the application in the taskbar, you must:
    • Use SysIconAdd to display the icon of the application.
    • Make the application invisible by applying WinStatus to the first project window.
Business / UI classification: Business Logic
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 03/14/2023

Send a report | Local help