Home | Sign in | English EN
  • Overview
  • Programming
  • Custom procedure
  • Initializing the custom procedure
  • Stopping the application
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
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 management 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.

Custom procedure

The custom procedure must be a global procedure of 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>Retrieves as constants the current mode for remote control:
  • acForbidden: access denied to the application
  • acWarning: warning of imminent shutdown
  • acStop: application shutdown
<Message>Retrieves the message corresponding to the current mode (this message must be displayed in the window).
<Display duration>Maximum display duration of the window (in seconds)
// -- Procedure ProcessMessage
PROCEDURE 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()

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:
AppliControl("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 initialization code of project.

Stopping the application

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
Click [Add] to post a comment