WindowSystemObject Interface Reference

The WindowSystemObject object is the root object of the WSO object model hierarchy. More...

List of all members.

Public Member Functions

 CreateForm ([in] LONG Left,[in] LONG Top,[in] LONG Width,[in] LONG Height,[in, defaultvalue(WS_DEFAULT)] LONG Style,[out, retval] IDispatch **pControl)
 This method creates an form.
 CreateDialogForm ([in] LONG Left,[in] LONG Top,[in] LONG Width,[in] LONG Height,[in, defaultvalue(WS_DIALOGDEFAULT)] LONG Style,[out, retval] IDispatch **pControl)
 This method creates an dialog form.
 CreateImageList ([out, retval] IDispatch **pControl)
 This method creates a new ImageList object.
 CreateTimer ([out, retval] IDispatch **pControl)
 This method creates a new Timer object.
 CreateCOMEvents ([in] IDispatch *COMObject,[out, retval] IDispatch **pControl)
 This method creates a new COMEvents object.
 CreateFindDialog ([in, defaultvalue("")] BSTR FindText,[in, defaultvalue(FR_DOWN)] ULONG Flags,[out, retval] IDispatch **pResult)
 This method creates a system-defined Find dialog box.
 CreateReplaceDialog ([in, defaultvalue("")] BSTR FindText,[in, defaultvalue("")] BSTR ReplaceText,[in, defaultvalue(FR_DOWN)] ULONG Flags,[out, retval] IDispatch **pResult)
 This method creates a system-defined Find & Replace dialog box that lets the user specify a string to search for and a replacement string.
 CreateTrayIcon ([out, retval] IDispatch **pControl)
 This method creates a new TrayIcon object.
 Run (void)
 This method starts message loop.
 Stop (void)
 This method breaks message loop.
 Translate ([in] BSTR Text,[out, retval] VARIANT *pResult)
 This method translates an constant name to its value.
 LoadImage ([in] BSTR Path,[out, retval] IDispatch **pResult)
 Creates a new picture object and initializes it from the contents of a file.
 About (void)
 This method displays WSO About Box.
 CreateEventHandler ([out, retval] IDispatch **pControl)
 This method creates a new EventHandler object.
 CreatePrintInfo ([out, retval] IDispatch **pControl)
 This method creates a new PrintInfo object.
 CreateStdDispatch ([in] BSTR TypeLibrary,[in] LONG Major,[in] LONG Minor,[in] BSTR Guid,[in] IUnknown *Object,[out, retval] IDispatch **pControl)
 Creates a new StdDispatch object.
 VirtualKeyCodeToString ([in] ULONG VirtualKey,[in, defaultvalue(TRUE)] VARIANT_BOOL UseKeyboardState,[out, retval] BSTR *pVal)
 Translates the specified virtual-key code and keyboard state to the corresponding Unicode character or characters.
 SaveLayout ([out, retval] BSTR *Layout)
 Saves controls layout to string.
 LoadLayout ([in] BSTR Layout)
 Loads controls layout from string.
 LoadIcon ([in] BSTR FileName,[out, retval] IDispatch **Result)
 This method loads an icon from the specified executable file, DLL, or icon file.
 LoadSysIcon ([in] LONG ID,[out, retval] IDispatch **Result)
 This method loads a system icon.
 GetIconCount ([in] BSTR FileName,[out, retval] ULONG *Result)
 Returns the total number of icons in the specified file.

Properties

IDispatch *R Controls []
 Gets an Controls collection that represents the list of created forms.
IDispatch *R Version []
 This method creates a new Version object.
VARIANT_BOOL RW Debug []
 The Debug property is a Boolean value that indicates that the WindowSystemObject in debug mode or not.
IDispatch *R Regions []
 This method creates a new Regions object.
LONG RW PixelsPerInch []
 Returns or sets the pixels per inch value.
IDispatch *R Screen []
 This method creates a new Screen object.
VARIANT_BOOL RW EnableVisualStyles []
 The EnableVisualStyles property is a Boolean value that indicates that XP Visual Styles enabled or not.
IDispatch *R Console []
 Returns a Console object.
IDispatch *R ActiveForm []
 Returns a Form object that represents active window (may be null if no form is active).
IDispatch *R ForegroundForm []
 Returns a Form object that represents foreground window (may be null).
VARIANT_BOOL RW EnableVistaFileDialog []
 If "TRUE" then the new Windows Vista file dialog will be used for FileOpenSaveDialog, Form::OpenDialog, Form::SaveDialog, if available.


Detailed Description

The WindowSystemObject object is the root object of the WSO object model hierarchy.

The methods and properties introduced in WindowSystemObject encapsulates behavior for

ProgId: “Scripting.WindowSystemObject”.

Example (JScript):

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.Text = "WSO"
f.ClientWidth = 200
f.ClientHeight = 100
f.CenterControl()

Button = f.CreateButton(120,70,75,25,"Close")
Button.OnClick = CloseForm

f.Show()

o.Run()


function CloseForm(Sender)
{
        f.Close()
}

Result:

WindowSystemObject.jpg


Member Function Documentation

About ( void   ) 

This method displays WSO About Box.

CreateCOMEvents ( [in] IDispatch *  COMObject,
[out, retval] IDispatch **  pControl 
)

This method creates a new COMEvents object.

Parameters:
COMObject COM Object
Return values:
pControl COMEvents object.

CreateDialogForm ( [in] LONG  Left,
[in] LONG  Top,
[in] LONG  Width,
[in] LONG  Height,
[in, defaultvalue(WS_DIALOGDEFAULT)] LONG  Style,
[out, retval] IDispatch **  pControl 
)

This method creates an dialog form.

See also CreateForm method.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateDialogForm(0,0,0,0)

f.Text = "WSO"
f.ClientWidth = 200
f.ClientHeight = 100
f.CenterControl()

f.Show()

o.Run()

Result:
DialogForm.jpg

CreateEventHandler ( [out, retval] IDispatch **  pControl  ) 

This method creates a new EventHandler object.

Since:
1.1.5.

CreateFindDialog ( [in, defaultvalue("")] BSTR  FindText,
[in, defaultvalue(FR_DOWN)] ULONG  Flags,
[out, retval] IDispatch **  pResult 
)

This method creates a system-defined Find dialog box.

CreateForm ( [in] LONG  Left,
[in] LONG  Top,
[in] LONG  Width,
[in] LONG  Height,
[in, defaultvalue(WS_DEFAULT)] LONG  Style,
[out, retval] IDispatch **  pControl 
)

This method creates an form.

It specifies the initial position and size of the window, window style.

Parameters:
Left Specifies the initial horizontal position of the window
Top Specifies the initial vertical position of the window
Width Specifies the width of the window
Height Specifies the height of the window
Style Specifies the style of the window. This parameter can be a combination of the following values: WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, WS_MAXIMIZEBOX, WS_SIZEBOX, WS_THICKFRAME, WS_SIZEGRIP, WS_SIZEBOX, WS_CONTROLBOX, WS_SYSMENU. Default value WS_DEFAULT.
Return values:
pControl Form object.
Example:
o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.Text = "WSO"
f.ClientWidth = 200
f.ClientHeight = 100
f.CenterControl()

f.Show()

o.Run()

Result:
Form.jpg

CreateImageList ( [out, retval] IDispatch **  pControl  ) 

This method creates a new ImageList object.

Return values:
pControl ImageList object.

CreatePrintInfo ( [out, retval] IDispatch **  pControl  ) 

This method creates a new PrintInfo object.

Since:
1.1.6.

CreateReplaceDialog ( [in, defaultvalue("")] BSTR  FindText,
[in, defaultvalue("")] BSTR  ReplaceText,
[in, defaultvalue(FR_DOWN)] ULONG  Flags,
[out, retval] IDispatch **  pResult 
)

This method creates a system-defined Find & Replace dialog box that lets the user specify a string to search for and a replacement string.

CreateStdDispatch ( [in] BSTR  TypeLibrary,
[in] LONG  Major,
[in] LONG  Minor,
[in] BSTR  Guid,
[in] IUnknown *  Object,
[out, retval] IDispatch **  pControl 
)

Creates a new StdDispatch object.

Since:
1.1.8.
See also:
StdDispatch.
Parameters:
TypeLibrary The path to the type library or its GUID, for example "{79c5f83e-fb53-4189-9ec4-4ac25440d825}".
Major Major version number of the type library.
Minor Minor version number of the type library.
Guid GUID for the IDispatch interface.
Object IUnknown object.
Return values:
pControl Created StdDispatch object.

CreateTimer ( [out, retval] IDispatch **  pControl  ) 

This method creates a new Timer object.

Return values:
pControl Timer object.

CreateTrayIcon ( [out, retval] IDispatch **  pControl  ) 

This method creates a new TrayIcon object.

Return values:
pControl TrayIcon object.

GetIconCount ( [in] BSTR  FileName,
[out, retval] ULONG *  Result 
)

Returns the total number of icons in the specified file.

If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ico file, the return value is 1.

Since:
1.1.16.

LoadIcon ( [in] BSTR  FileName,
[out, retval] IDispatch **  Result 
)

This method loads an icon from the specified executable file, DLL, or icon file.

An zero-based icon index can be specified at the end of the FileName, for example: "Shell32.dll,16". If this index is a negative number the icon whose resource identifier is equal to the absolute value of the index will be loaded. For example, use -3 to load the icon whose resource identifier is 3.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 500
f.ClientHeight = 300
f.CenterControl()

f.Icon = "Shell32.dll,-16"

left = 10
for (i = 1; i<10; i++)
{
	image = f.DrawImage(left,10,0,0,o.LoadIcon("Shell32.dll,-"+i))
	left += image.Width
	left += 10
}

f.Show()

o.Run()

See also:
ExtractIconEx in the MSDN.
Since:
1.1.16.

LoadImage ( [in] BSTR  Path,
[out, retval] IDispatch **  pResult 
)

Creates a new picture object and initializes it from the contents of a file.

The file can be BMP (bitmap), JPEG, WMF (metafile), ICO (icon), or GIF.

LoadLayout ( [in] BSTR  Layout  ) 

Loads controls layout from string.

A control's layout will be loaded only if UniqueId assigned.

Loads properties:

The method designed for Docking Framework.

Since:
1.1.15.

LoadSysIcon ( [in] LONG  ID,
[out, retval] IDispatch **  Result 
)

This method loads a system icon.

Parameters:
ID Specifies the Image ID.
This parameter can be a one of the following values:

Return values:
Result The icon object.
See also:
LoadImage in the MSDN.
Since:
1.1.16.
Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 500
f.ClientHeight = 400
f.CenterControl()

Icons = [
	"OIC_SAMPLE",
	"OIC_HAND",
	"OIC_QUES",
	"OIC_BANG",
	"OIC_NOTE",
	"OIC_WINLOGO",
	"OIC_WARNING",
	"OIC_ERROR",
	"OIC_INFORMATION",
	"OIC_SHIELD"
]

left = 10
top = 10

for (i = 0; i<Icons.length; i++)
{
	icon = o.LoadSysIcon(o.Translate(Icons[i]))

	f.TextOut(left,top,Icons[i]+":")

	image = f.DrawImage(left + 150,top,0,0,icon)

	image2 = f.DrawImage(left + 150 + 20 + image.Width,top,70,50,icon)
	image2.DrawType = o.Translate("DI_STRETCH")

	top += 10
	top += Math.max(image.Height,70)
}

f.AutoScroll = true

f.Show()

o.Run()

Run ( void   ) 

This method starts message loop.

SaveLayout ( [out, retval] BSTR *  Layout  ) 

Saves controls layout to string.

A control's layout will be saved only if UniqueId assigned.

The UniqueId must be specified for any component with DropTarget = "TRUE".

Saves properties:

The method designed for Docking Framework.

Since:
1.1.15.

Stop ( void   ) 

This method breaks message loop.

Translate ( [in] BSTR  Text,
[out, retval] VARIANT *  pResult 
)

This method translates an constant name to its value.

VirtualKeyCodeToString ( [in] ULONG  VirtualKey,
[in, defaultvalue(TRUE)] VARIANT_BOOL  UseKeyboardState,
[out, retval] BSTR *  pVal 
)

Translates the specified virtual-key code and keyboard state to the corresponding Unicode character or characters.

See ToUnicode in the MSDN.

The method uses current input language.

Parameters:
VirtualKey Virtual-key code.
UseKeyboardState Use current keyboard state. If "TRUE", the method will use current state of ALT, CTRL, etc.
Return values:
pVal Characters.
Since:
1.1.15.


Property Documentation

IDispatch* R ActiveForm

Returns a Form object that represents active window (may be null if no form is active).

See also:
Form::Active.

Form::OnActivate.

Since:
1.1.14.

IDispatch* R Console

Returns a Console object.

Allows to create console window.

Since:
1.1.12.

IDispatch* R Controls

Gets an Controls collection that represents the list of created forms.

See also Collection.

VARIANT_BOOL RW Debug

The Debug property is a Boolean value that indicates that the WindowSystemObject in debug mode or not.

VARIANT_BOOL RW EnableVistaFileDialog

If "TRUE" then the new Windows Vista file dialog will be used for FileOpenSaveDialog, Form::OpenDialog, Form::SaveDialog, if available.

Default: "TRUE"

Since:
1.1.16.

VARIANT_BOOL RW EnableVisualStyles

The EnableVisualStyles property is a Boolean value that indicates that XP Visual Styles enabled or not.

Affects only the current thread.

See also:
Themes.
Since:
1.1.6.

IDispatch* R ForegroundForm

Returns a Form object that represents foreground window (may be null).

See also:
Form::Foreground.

Form::OnActivate.

Since:
1.1.14.

LONG RW PixelsPerInch

Returns or sets the pixels per inch value.

The default setting is 96. This value represents the proportion of the font on the system on which the current program created. Form automaticly resizes itself to differences between the font used at development time and the current system font used by a system at runtime.

IDispatch* R Regions

This method creates a new Regions object.

IDispatch* R Screen

This method creates a new Screen object.

IDispatch* R Version

This method creates a new Version object.


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:13:23 2015. (C) Veretennikov A. B. 2004-2015