|
|
|
|
|
- Overview
- Actions performed by the user
- MK_XX constants
- VK_XX constants
- SB_XXX constants
- SIZE_XXX constants
- Examples
Optional events: Information retrieved
In WINDEV, you can add optional events in the code of the different elements of an application. For more details, see Optional events. Depending on the optional event used, specific information can be retrieved via the _EVE.LPARAM and _EVE.WPARAM variables. Actions performed by the user The table below presents the information returned in the different optional events: | | | Optional event | Information returned in the _EVE.LParam variable | Information returned in the _EVE.WParam variable |
---|
Mouse hover (WM_MOUSEMOVE)
Left mouse button down (WM_LBUTTONDOWN)
Left mouse button up (WM_LBUTTONUP)
Double click with the left mouse button (WM_LBUTTONDBLCLK)
Right mouse button down (WM_RBUTTONDOWN)
Right mouse button up (WM_RBUTTONUP)
Double click with the right mouse button (WM_RBUTTONDBLCLK) | - High weight (known by function HiWord): Vertical position (Y) of mouse cursor relative to the field or window in question (equivalent to function MouseYPos).
- Low weight (known by function LoWord): Horizontal position (X) of mouse cursor relative to the field or window in question (equivalent to function MouseXPos).
| Key pressed in the format of a MK_XXX constant | Mouse wheel (WM_MOUSEWHEEL) | - High weight (known by function HiWord): Vertical position (Y) of mouse cursor relative to the field or window in question (equivalent to function MouseYPos).
- Low weight (known by function LoWord): Horizontal position (X) of mouse cursor relative to the field or window in question (equivalent to function MouseXPos).
| - High weight (known by function HiWord): Castor rotation direction (positive number: upward movement; negative number: downward movement)
- Low weight (known by function LoWord): Key Pushed as constant MK_XXX
| Key down (WM_KEYDOWN) Key up (WM_KEYUP) | | Key pressed in the format of a VK_XXX constant | Key pressed (WM_CHAR) | | ASCII code of the key pressed (can be handled by Charact) | System key down (WM_SYSKEYDOWN) System key up (WM_SYSKEYUP) | | Key pressed in the format of a VK_XXX constant | System key pressed (WM_SYSCHAR) | | ASCII code of the system key pressed | Horizontal scrollbar (WM_HSCROLL) Vertical scrollbar (WM_VSCROLL) | Handle of scrollbar | - High weight (known by function HiWord): Elevator shaft position
- Low weight (known by function LoWord): Method used to move the elevator shaft, in the form of an constant SB_XXX
| Display of context menu (WM_CONTEXTMENU) | - High weight (known by function HiWord): Vertical position (Y) of mouse cursor relative to the field or window in question (equivalent to function MouseYPos).
- Low weight (known by function LoWord): Horizontal position (X) of mouse cursor relative to the field or window in question (equivalent to function MouseXPos).
Note: If these values are equal to -1, the context menu has been opened using the Windows open context menu key. | Handle of window or control from which the context menu is called | Move (WM_MOVE) | - High byte (returned by HiWord):
- vertical position of the upper-left corner of the window relative to the upper-left corner of the screen (equivalent to the Y property)
- vertical position of the upper-left corner of the control relative to the upper-left corner of the window client area (equivalent to the Y property).
- Low byte (returned by LoWord):
- horizontal position of the upper-left corner of the window relative to the upper-left corner of the screen (equivalent to the X property)
- horizontal position of the upper-left corner of the control relative to the upper-left corner of the client area of the window (equivalent to the X property).
| | Resize (WM_SIZE) | - High weight (known by function HiWord): Field or window height (equivalent to property Height).
- Low weight (known by function LoWord): Field or window width (equivalent to property Width).
| Display mode of window (minimized, maximized, ...) in the format of a SIZE_XXX constant (equivalent to WinSize). | Gain focus (WM_SETFOCUS) | | Handle of window or control that gained focus. | Lose focus (WM_KILLFOCUS) | | Handle of window or control that gained focus. |
MK_XX constants The MK_XXX constants are as follows:
| | | MK_CONTROL | 8 | Ctrl key down. | MK_LBUTTON | 1 | Left mouse button down. | MK_MBUTTON | 16 | Middle mouse button down. | MK_RBUTTON | 2 | Right mouse button down. | MK_SHIFT | 4 | Shift key down |
Before using these constants, you must enter the following lines of code:
CONSTANT
MK_CONTROL=8
MK_LBUTTON=1
MK_MBUTTON=16
MK_RBUTTON=2
MK_SHIFT=4
END
VK_XX constants The details of the VK_XXX constants are stored in the "KeyConst.WL" file in the "Personal\External" subdirectory of the WINDEV installation directory. Before using these constants, you must enter the following line of code: SB_XXX constants The SB_XXX constants are as follows:
| | | | | The scrollbar box was moved by: |
---|
SB_LINEDOWN | 1 | the spin button at the bottom | SB_LINEUP | 0 | the spin button at the top | SB_LINELEFT | 0 | the spin button on the left | SB_LINERIGHT | 1 | the spin button on the right | SB_PAGEDOWN | 3 | the scrollbar below the scrollbar box | SB_PAGEUP | 2 | the scrollbar above the scrollbar box | SB_PAGELEFT | 2 | the scrollbar on the left of the scrollbar box | SB_PAGERIGHT | 3 | the scrollbar on the right of the scrollbar box | SB_THUMBPOSITION | 4 | the scrollbar box | SB_THUMBTRACK | 5 | the scrollbar box |
Before using these constants, you must enter the following lines of code:
CONSTANT
SB_LINEDOWN=1
SB_LINEUP=0
SB_LINELEFT=0
SB_LINERIGHT=1
SB_PAGEDOWN=3
SB_PAGEUP=2
SB_PAGELEFT=2
SB_PAGERIGHT=3
SB_THUMBPOSITION=4
SB_THUMBTRACK=5
END
SIZE_XXX constants The SIZE_XXX constants are as follows: | | | SIZE_MAXIMIZED | 2 | The window is maximized | SIZE_MINIMIZED | 1 | The window is minimized | SIZE_RESTORED | 0 | The window is restored |
Before using these constants, you must enter the following line of code:
CONSTANT
SIZE_RESTORED=0
SIZE_MINIMIZED=1
SIZE_MAXIMIZED=2
END
The following example is used to find out the rotational direction of the mouse wheel:
Direction is int
Direction = HiWord(_EVE.wParam)
IF Direction < 0 THEN
Trace("The mouse wheel is going to the bottom")
ELSE
Trace("The mouse wheel is going to the top")
END
The following example is used to delete the current row from a table when the Del key is pressed:
EXTERN "KeyConst.WL"
IF _EVE.wParam = VK_DELETE THEN
IF YesNo("Delete the current row?") = Yes THEN
TableDelete(MySelf)
END
END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|