AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones de eventos de Windows
  • Calling the same event several times on the same object
  • Procedure called by Event
  • Parameters used by the procedure
  • Events used by WINDEV
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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 the event, all you have to do is use EndEvent.
Note: The Event function does NOT work on a non-WINDEV window.
Ejemplo
// Capture the mouse click on an edit control 
WM_LBUTTONDOWN is int = 513
Event(MouseClick, "SAI_SAISIE1", WM_LBUTTONDOWN)
// MouseClick procedure 
PROCEDURE MouseClick()
EDT_EDIT1 = ""   // Reset the control to 0 when it is clicked
Sintaxis
<Result> = Event(<WLanguage procedure> , <Object name> , <Windows message>)
<Result>: Integer
  • Identifier of event,
  • 0 if an error occurs.
<WLanguage procedure>: Procedure name
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 Remarks).
For a given object, a single procedure can intercept a given event.
<Object name>: Character string
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: Windows constants can be integrated directly into your WLanguage code using 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.
Observaciones

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, etc.).
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 Event

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 processing returns a value (necessarily of integer type), the Windows event is stopped: it is this value that is returned. If the process returns NO value, the execution continues.

Events used by WINDEV

WINDEV uses 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).
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local