|
|
|
|
AppControl (Function) In french: AppliContrôle
Warning
From version 23, AppliControl is kept for backward compatibility. This function has been replaced with AppControl.
This is an advanced function. The management of the remote check for a WINDEV application is automatically implemented when installing an application in network. This function must be used to customize the management mode of the remote check. Enables (or disables) the remote control for the current multi-user WINDEV application. The remote control allows you to "softly" disconnect the users from the WINDEV application in order to update the application (database update for example). The remote control is used to: - prevent from connecting to an application,
- notify the user that the application will be closed for updating,
- disconnect a user in order to update the application.
// Project initialization code // Customization with a window AppControl("C:\MyApp\FileStop.Txt", WIN_Check) // Project initialization code // Customization with a procedure AppControl("C:\MyApp\StopFile.Txt", AppControl_Callback) // ---------------------------------- // -- AppControl_Callback global procedure PROCÉDURE AppControl_Callback(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 Syntax
Enabling or disabling the automatic control Hide the details
AppControl(<Control file> [, <Run project closing code>])
<Control file>: Character string Full path of control file (a UNC path can be used). The control file is a text file, with a defined structure (for more details, see Structure of control file). If this parameter corresponds to an empty string (""), the control is disabled for the current application. WDADMINEXE is used to simplify the creation of the control file. <Run project closing code>: Optional boolean - True to run the "Close" event of the project when exiting the application automatically,
- False (default value), to prevent the execution of the "Close" event of the project.
Automatic control while opening of a custom window Hide the details
AppControl(<Control file> , <Custom window>)
<Control file>: Character string Full path of control file. The control file is a text file, with a defined structure (for more details, see Structure of control file). If this parameter corresponds to an empty string (""), the control is disabled for the current application. WDADMINEXE is used to simplify the creation of the control file. <Custom window>: Window name Name of the application window that will be opened to process the messages sent by the remote control. For more details on how to use a window, see Remote control: Customization with a window.This window must be associated with a procedure of the following type: PROCEDURE <Window name> (<Mode>, <Message>, <Display duration>) | | <Mode> | Retrieves 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). |
Automatic control with custom procedure Hide the details
AppControl(<Control file> , <WLanguage procedure>)
<Control file>: Character string Full path of control file. The control file is a text file, with a defined structure (for more details, see Structure of control file). If this parameter corresponds to an empty string, the check is disabled for the current application. WDADMINEXE is used to simplify the creation of the control file. <WLanguage procedure>: Procedure name Name of the WLanguage procedure called to process the messages sent by the remote control. For more details on how to use a procedure, see Remote control: Customization with a procedure. This procedure must be a global procedure of application. For more details on this procedure, see Parameters of the procedure used by AppControl.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|