ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Application update functions
  • Overview
  • Programming
  • Custom procedure
  • Initializing the custom procedure
  • Application shutdown
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
To customize the remote control performed on a multi-user WINDEV application, you can trigger the execution of a procedure found in the application.
This procedure will be used instead of the standard message window. This procedure allows you to entire customize the remote administration of application stop.
This procedure can be used for example:
  • to check the name of the connected user (for the groupware): a message is displayed only if the user corresponds to an administrator.
  • for the applications without interface, run in background task.
  • to open a specific window.
Programming

Custom procedure

The custom procedure must be a global procedure of the project. In this procedure, you have the ability to retrieve and process the different information regarding the current mode.
The procedure declaration must be such as:
PROCEDURE <Procedure name> ([<Mode>[, <Message>[ <Display duration>]]])

where the parameters are as follows:
<Mode>Constant defining the current remote control mode:
  • acForbidden: access denied to the application
  • acWarning: warning of imminent shutdown
  • acStop: application shutdown
<Message>Message corresponding to the current mode (this message must be displayed in the window).
<Display duration>Maximum window display time (in seconds)
// -- Procedure ProcessMessage
PROCÉDURE ProcessMessage(AccessMode, MessageToDisplay, DispDuration)
SWITCH AccessMode
CASE acForbidden
IF UserName  "ADMIN" THEN Open(WIN_UnableToConnect)
CASE acWarning
IF UserName <>  "ADMIN" THEN Info(MessageToDisplay)
CASE acStop
IF UserName <> "ADMIN" THEN EndProgram()
END

Initializing the custom procedure

To use the custom procedure to automatically check your application, AppControl must be called in the initialization code of your project:
AppControl("U:\MyApp\WDUPDATE.NET", WIN_ProcessMessage)
where WIN_ProcessMsg is the name of the custom window,
and "WDUPDATE.NET" is the application control file.
Tip: The call to AppControl must be the first statement found in the project initialization code.

Application shutdown

When using a custom procedure, the stop mode defined for the application (acStop constant) does not automatically stop the application. The call to EndProgram must be included in your application.
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 06/30/2023

Send a report | Local help