PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • 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.
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:
Versions 20 and later
WEBDEV - Server code Initializing the project after connection to the site
New in version 20
WEBDEV - Server code Initializing the project after connection to the site
WEBDEV - Server code Initializing the project after connection to the site
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 cached 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 running EndProgram with the "Closing code" parameter not specified or equal to "False".
  • When running AppControl with the "Execution of end code of project" not specified or equal to "False".
WINDEVWindowsLinuxWindows Mobile 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.
Note: 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".
WINDEVWindowsWindows Mobile
Automatic test
Optional event that can be enabled (or not) by the options:
  • "Automatic tests .. Enable the code of automatic test for the project".
  • "Automatic tests .. Disable the code of automatic test for the project".
Optional event.
To enable this event, on the "Automatic tests" pane, in the "Tests" group, click the group button ( ) and select "Enable the code for automatic test of the project".
To enable this event, on the "Automatic tests" pane, in the "Tests" group, click the group button ( ) and select "Disable the code for automatic test 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 test of the project allows you to use EmulateWindow to validate the window.
Versions 18 and later
AndroidiPhone/iPad Move to the background
New in version 18
AndroidiPhone/iPad Move to the background
AndroidiPhone/iPad Move to the background
Run when the application is placed in the background. This event is used, for example, to save the data.
Note: This event is run AFTER the optional window event "Put the application in the background".
Versions 18 and later
AndroidiPhone/iPad Move to the foreground
New in version 18
AndroidiPhone/iPad Move to the foreground
AndroidiPhone/iPad Move to the foreground
Run when the application is re-enabled and when it is placed in the foreground. This event is used, for example, to refresh the displayed data.
Notes:
  • This event is not run when the application starts.
  • This event is run BEFORE the optional window event "Put the application in the foreground".
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment