Click or drag to resize

FocusChangeEvent Class

X#
Provide information about a FocusChangeEvent, used to indicate a change in window focus (i.e., gaining or losing focus).
Inheritance Hierarchy
Object
  Event
    FocusChangeEvent
      ControlFocusChangeEvent

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax
 CLASS FocusChangeEvent INHERIT Event
Request Example View Source

The FocusChangeEvent type exposes the following members.

Constructors
  NameDescription
Public methodFocusChangeEvent
Initializes a new instance of the FocusChangeEvent class
Top
Properties
  NameDescription
Public propertyGotFocus
A logical value determining whether a window has either gained keyboard focus (TRUE) or is about to lose it (FALSE).
Public propertyHandle
The pointer to the window where the event occurred
(Inherited from Event.)
Public propertyMessage
A dword representing the Windows API message associated with the given event.
(Inherited from Event.)
Public propertyWindow
An object indicating the window or control in which the event occurred. This is helpful, for example, for distinguishing between similar menu events coming from the same context menu attached to different controls.
(Inherited from Event.)
Top
Fields
  NameDescription
Public fieldhWnd (Inherited from Event.)
Public fieldlParam (Inherited from Event.)
Public fieldoWindow (Inherited from Event.)
Public fielduMsg (Inherited from Event.)
Public fieldwParam (Inherited from Event.)
Top
Remarks
When a window comes in or out of focus, the dispatcher generates a FocusChangeEvent and sends it to Window:FocusChange(). When the input focus changes, the window losing the focus gets a FocusChangeEvent (telling it that it is losing the focus) and the window gaining the focus receives a FocusChangeEvent (telling it that it is gaining the focus). A window that has focus gets KeyEvents when the user hits the keyboard. This is similar to an active window, but an active window receives MouseEvents instead of KeyEvents. Tip: Applications using cursors should use FocusChangeEvent to determine whether to create or destroy the cursor.
Examples
The following example locks the attached data server when the window gets focus:
X#
1METHOD FocusChange(oFCE) CLASS TopAppWindow
2IF(oFCE:GotFocus)
3Server:RLock()
4ELSE
5Server:Unlock()
6ENDIF
See Also

Reference