Click or drag to resize

App.BeforeDispatch Method (Typed)

X#
Low-level handler used with App:AfterDispatch() for intercepting any message posted to an application's message queue.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD BeforeDispatch(
	hWnd AS IntPtr,
	uMsg AS DWORD,
	wParam AS DWORD,
	lParam AS LONG
) AS LOGIC
Request Example View Source

Parameters

hWnd
Type: IntPtr
The window handle for which the message is meant.
uMsg
Type: DWord
The message constant.
wParam
Type: DWord
The DWORD parameter.
lParam
Type: Long
The LONG parameter.

Return Value

Type: Logic
TRUE if the message should be further processed; otherwise, FALSE.
Remarks
The BeforeDispatch() and AfterDispatch() methods are low-level handlers that intercept any message posted to the application's message queue. BeforeDispatch() is called before the message is dispatched to the Dispatch() method of the corresponding window, whereas AfterDispatch() is called afterwards.
Tip Tip
These methods are not implemented as part of the GUI classes. Rather, they should be implemented by the programmer if general, application-wide message intercepting and handling are wanted. BeforeDispatch() and AfterDispatch() are called from within App:Exec() if they exist.
Examples
This example disables single left-button clicks application-wide:
X#
1METHOD BeforeDispatch(hWnd, uMsg, wParam, lParam) CLASS App
2IF uMsg == WM_LBUTTONDOWN
3RETURN FALSE
4ENDIF
5RETURN TRUE
See Also