CreateWindow Event

Applies to:  CbtEvents object
See also:  Window object

Occurs when a window is about to be created.

Syntax:

Public Event CreateWindow(ByRef Window As Window, ByRef Style As Long, ByRef ExStyle As Long, ByRef Cancel As Boolean)

The CreateWindow event syntax has these parts:

Part Description
object The name of a CbtEvents object.  NB:  object must be declared using WithEvents.
Window The window about to be created.
Style The window's style.  Consult the Windows Platform SDK documentation for acceptable values for Style.
ExStyle The window's extended style.  Consult the Windows Platform SDK documentation for acceptable values for ExStyle.
Cancel A boolean value that determines whether Window will be created.  Setting Cancel to True prevents the window from being created.

Remarks:

Cancelling the creation of a window, will be interpreted by most applications as an "Out of Memory" error, including applications created using Visual Basic.  

Example:

When the user changes windows

 

Home Copyright and Disclaimer