ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Your version: 01F250083H (WINDEV 25)

The content of this page has been updated to version 27.  See documentation 27 now.
Help / Editors / Project editor
  • Events managed by default
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Events managed by default
WINDEV, WEBDEV and WINDEV Mobile handle the following events by default (order of appearance in the code editor):
EventRuntime condition
InitializingRun when the application is started. Here is the order in which the events are run when starting an application (also when running a test):
  • Initialization of the components "loaded when starting the application".
    • Initialization of sub-components(*).
    • Initialization of component classes.
    • Initialization of the sets of procedures of the component.
    • Initialization of the component project(*).
  • Initialization of classes.
  • Initialization of sets of procedures.
  • Initialization of the project.
  • Initialization of the first project window or of the element whose test is run.
(*) The initialization event of a component is run only when the component uses the same runtime context as the project. For more details on the component generation options, see Creating and generating an external component.

If Use is run, the project initialization event is interrupted (all the lines of code after Use will not be run).

Examples
Some examples of how to use this event:
Used if the site is run with cached sessions.
To manage pre-launched sessions, two events are associated with the project:
  • "Initializing the project", run before the request reaches the WEBDEV application server. This code is run when starting the pre-launched session.
  • "Initializing the project after connection to the site", run when the WEBDEV application server processes the request.
Caution: Some WLanguage functions must not be used in the event "Initializing the project". They must be moved to the event "Initializing the project after connection to the site".
See Pre-launched sessions for more details.
ClosingRun when the closing application (when the last window of the application is closed for example).
Here is the order in which the events for closing the project are run:
  • Closing the project.
  • Event for ending the sets of procedures.
  • Event for ending the classes.
  • Closing the components (closing the component project, then its sets of procedures, then its classes, then its sub-components).
This event will not be run:
  • When EndProgram is run and the "Closing code" parameter is not specified or is set to "False".
  • When AppControl is run and the "Run project closing code" parameter is not specified or is set to "False".
WINDEVWindowsLinux Closing the session
Run in the following cases if the application is currently used:
  • When closing the current user session.
  • When stopping the system of the current computer.
  • When restarting the current computer.
In these cases, only this event will be run. The events for closing the project as well as the events for ending the classes and the sets of procedures will not be run.
Remark: Depending on the operating system of the current computer, the operating system may try to abruptly stop the application after a while.

Examples
Some examples of how to use this event:
  • Freeing the libraries loaded in memory by FreeDLL (if libraries have been loaded in memory).
  • Freeing classes, OLE Automation objects and dynamic arrays (Free keyword).
  • Canceling the current transactions (HTransactionCancel).
  • Closing the HFSQL files (HClose).
  • Sending information messages to other computers (SendMessage).
  • Running the event for closing the project with EndProgram with "Closing code" set to "True".
WINDEVWindows
Automatic test
Optional event.
To enable this event, go to the "Automatic tests" pane, "Tests" group, click the dialog box launcher ( dialog box launcher ) and select "Enable automatic test code of the project".
To disable this event, go to the "Automatic tests" pane, "Tests" group, click the dialog box launcher ( dialog box launcher ) and select "Disable automatic test code of the project".
In the case of an automatic test, this event is run before the project initialization code. This code us used to process some special cases where the automatic test may be locked: opening a window in the initialization code of the project (configuration window, license window, custom login window, ...).

The code for automatic project test allows you to use EmulateWindow to validate the window.
Run when the application is moved to the background. This event is used, for example, to save the data.
Remark: This event is run AFTER the optional window event "Move application to the background".
Run when the application is re-enabled and when it is moved to the foreground. This event is used, for example, to refresh the displayed data.
Remarks:
  • This event is not run when the application starts.
  • This event is run BEFORE the optional window event "Move application to the foreground".
Run in the following cases:
  • When the application starts (after the "Initializing" event of the project).
  • When the theme is changed by programming with ChangeTheme only if the withCodeExecution constant has been specified.
  • When the system automatically changes the theme: modification of system settings, changing the day/night time, activating/deactivating the battery saver, etc.
Remark: This event is only available if dark theme management is enabled. See Dark theme management on mobile for more details.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/10/2020

Send a report | Local help