PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Calling the same event several times on the same object
  • Procedure called by the Event function
  • Parameters used by the procedure
  • Events used by WINDEV
  • Keys of Pocket PCs and Smartphones
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
Intercepts a Windows event on a control, a group of controls or a WINDEV or WINDEV Mobile window. A specific WLanguage procedure is automatically run when the event is triggered on the specified object. To end the management of event, all you have to do is use EndEvent.
Note: Event does not operate on a non-WINDEV window.
// Capture the mouse click on an edit control
WM_LBUTTONDOWN is int = 513
Event(MouseClick, "EDT_EDIT1", WM_LBUTTONDOWN)
// Procedure MouseClick
PROCÉDURE MouseClick()
EDT_EDIT1 = ""   // Reset the control to 0 when it is clicked
Syntax
<Result> = Event(<Procedure Name> , <Object Name> , <Windows Message>)
<Result>: Integer
  • Identifier of event,
  • 0 if an error occurred.
<Procedure Name>: Character string (with or without quotes)
Name of WLanguage procedure that will be run when intercepting the event. This procedure can be a global procedure of the project or a local procedure of the window that contains the code currently run. This function must comply with a specific standard (see the Notes).
For a given object, a single procedure can intercept a given event.
<Object Name>: Character string (with quotes)
Name of control, group of controls or WINDEV window on which the event will be managed. You also have the ability to use the following generic character strings:
<Window Name>.*The event is managed for all the controls found in <Window Name> (except for <Window Name> itself).
.* (dot star)The event is managed for all the controls found in the current window (except for the window itself).
*. (star dot)The event is managed in all WINDEV windows of current application.
*.* (star dot star)The event is managed in all WINDEV windows and in all controls of all opened WINDEV windows found in the current application.
<Windows Message>: Integer or character string
Number or name of Windows message to manage. See the list of Windows events. Note: The Windows constants can be directly included in your WLanguage code via the EXTERN keyword.
If this parameter corresponds to a character string, this string is case sensitive.
If this parameter corresponds to 0, all the Windows messages are intercepted.
Remarks

Calling the same event several times on the same object

Event can be used to manage the same event several times for the same element (control, window, ...).
In this case, the events are "stacked":
  • the first event is managed until the next event is called.
  • when an event is not managed anymore (EndEvent), the event found immediately before it (if it exists) is taken into account.

Procedure called by the Event function

The interception procedure called by Event must have the following format:

FUNCTION ProcedureManageEvent(WindowsMessage, wParam, IParam)
WindowsMessage, wParam and lParam are three optional integers, used to send and to receive information about the message and the relevant objects.

Parameters used by the procedure

The interception procedure called by Event can use the following variables:
Variables Meaning5.5 variable kept for backward compatibility
MySelf..NameName of the object (control, group of controls or window)
Read-only variable
_EVE.name
MessageNumber of the message (first parameter of the procedure)
Read-only variable
_EVE.wMessage
wParamFirst parameter of the message (second parameter of the procedure)
Read-only variable
_EVE.wParam
lParamSecond parameter of the message (third parameter of the procedure)
Read-only variable
_EVE.lParam
Handle("")Handle of the object that received the message
Read-only variable
_EVE.hWnd
Value returned by the procedureReturns a value to Windows_EVE.Return


Note: If the process returns a value (an integer), the Windows event is stopped: this value is returned. If the process returns NO value, the execution continues.

Events used by WINDEV

WINDEV is using the events included between "WM_USER + 700" and "WM_USER + 1200". Therefore, other ranges of events must be used ("WM_USER + 1300" to "WM_USER + 1400" for example).
Windows Mobile

Keys of Pocket PCs and Smartphones

The diagrams below present the WLanguage constants associated with the keys.
Related Examples:
WD Screen Saver Training (WINDEV): WD Screen Saver
[ + ] This example illustrates the creation of a screen saver with the WLanguage functions.
The following topics are presented in this example:
1/ the periodic call to a procedure ("timers")
2/ the management of Windows events
3/ the system functions (call to Windows APIs)
To use the screen saver:
- Rename the executable (.EXE) to .SCR
- Copy the file to the directory of Windows (Ex: C:\WINDOWS)
- Open the window for the display properties of the desktop
- Choose the "Screen Saver" tab
- Select the screen saver generated by WINDEV
WD Schedule Complete examples (WINDEV): WD Schedule
[ + ] This example presents the management of a graphic schedule.

The following topics are presented in this example:
1/ the scheduler control
2/ the Google Calendar functions
Components
WINDEVReports and Queries wd230obj.dll
Windows Mobile wp230obj.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment