WindowSystemObjectExtensions Interface Reference

A WindowSystemObjectExtensions object contains some additional methods. More...

List of all members.

Public Member Functions

 SendMessage ([in] VARIANT Control, LONG Message, LONG wParam, VARIANT lParam,[out, retval] VARIANT *pVal)
 Use this method to send a message to an control.
 PostMessage ([in] VARIANT Control, LONG Message, LONG wParam, VARIANT lParam,[out, retval] VARIANT *pVal)
 Use this method to post a message to an control.
 AddMessageHandler ([in] IDispatch *Control, LONG Message, VARIANT MessageHandler)
 Use this specify a event handler for processing some message.
 RegisterWindowMessage ([in] BSTR Message,[out, retval] ULONG *MessageId)
 Registeres a new window message.
 EnumWindows ([out, retval] IDispatch **Result)
 Returns a list of the Window objects that represents top level windows.
 SendCopyData ([in] VARIANT Control,[in] BSTR Data,[out, retval] VARIANT *pVal)
 Sends WM_COPYDATA message to a Window.
 PostCopyData ([in] VARIANT Control,[in] BSTR Data,[out, retval] VARIANT *pVal)
 Sends WM_COPYDATA message to a Window.
 CreateClipboard ([in, defaultvalue(FALSE)] VARIANT_BOOL ClipboardViewer,[out, retval] IDispatch **Clipboard)
 Creates a Clipboard object.
 GetFileSysIconIndexSmall ([in] BSTR pVal,[in, defaultvalue(0)] ULONG FileAttributes,[out, retval] ULONG *Result)
 Retrieves the index of a system image list icon (small) for a file.
 GetFileSysIconIndexLarge ([in] BSTR pVal,[in, defaultvalue(0)] ULONG FileAttributes,[out, retval] ULONG *Result)
 Retrieves the index of a system image list icon (large) for a file.
 UuidCreate ([out, retval] BSTR *Result)
 Creates a new UUID.
 CreateIconBuilder ([out, retval] IDispatch **Result)
 Creates a new IconBuilder object.
 CreateExecutor ([out, retval] IDispatch **Result)
 Creates a new Executor object.

Properties

IDispatch *R SystemImageListSmall []
 Returns a system image list object that contains small icon images.
IDispatch *R SystemImageListLarge []
 Returns a system image list object that contains large icon images.
VARIANT_BOOL R IsWindowsXP []
 Returns "TRUE", if we have Windows XP or later.
VARIANT_BOOL R IsWindowsVista []
 Returns "TRUE", if we have Windows Vista or later.
VARIANT_BOOL R IsWindows7 []
 Returns "TRUE", if we have Windows 7 or later.
VARIANT_BOOL R IsWindows8 []
 Returns "TRUE", if we have Windows 8 or later.
VARIANT_BOOL R IsThemeActive []
 Returns "TRUE", if a visual style is active.


Detailed Description

A WindowSystemObjectExtensions object contains some additional methods.

ProgId: “Scripting.WindowSystemObjectExtensions”.

Since:
1.1.5.


Member Function Documentation

AddMessageHandler ( [in] IDispatch *  Control,
LONG  Message,
VARIANT  MessageHandler 
)

Use this specify a event handler for processing some message.

Parameters:
Control The control.
Message The message identifier.
MessageHandler The event handler.
The control can be one of:

Note:
If the control is an ActiveXControl the event handler will be executed for any its child window (since 1.1.16).
The event handler will be executed with the next arguments:

Example, ActiveX control context menu disabling (JScript):

o = new ActiveXObject("Scripting.WindowSystemObject")

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

f.ClientWidth = 500
f.ClientHeight = 300
f.CenterControl()
f.Text = "Web Browser"

t = f.Menu.Add("File")
t.Add("Exit","ESC").OnExecute = CloseFormHandler

Browser = f.CreateActiveXControl(0,0,0,0,"{8856F961-340A-11D0-A96B-00C04FD705A2}")
Browser.Align = o.Translate("AL_CLIENT")


f.Show()

Browser.Control.Navigate(StartupDir() + "ActiveXNoContextMenu.js.htm")

ext = new ActiveXObject("Scripting.WindowSystemObjectExtensions")

ext.AddMessageHandler(Browser,WM_RBUTTONDOWN = 0x0204, MessageHandler)
ext.AddMessageHandler(Browser,WM_RBUTTONDBLCLK = 0x0206, MessageHandler)


o.Run()

function MessageHandler(Sender,Message,WParam,LParam,Handled,Result)
{
        Handled.Value = true
}


function CloseFormHandler(Sender)
{
        Sender.Form.Close()
}


function StartupDir() {s = WScript.ScriptFullName; s = s.substring(0,s.lastIndexOf("\\")+1); return s; }

Since:
1.1.5.

CreateClipboard ( [in, defaultvalue(FALSE)] VARIANT_BOOL  ClipboardViewer,
[out, retval] IDispatch **  Clipboard 
)

Creates a Clipboard object.

Parameters:
ClipboardViewer Sets ClipboardViewer property for the Clipboard object.
Return values:
Clipboard Result.
Since:
1.1.9.

CreateExecutor ( [out, retval] IDispatch **  Result  ) 

Creates a new Executor object.

Since:
1.1.17.

CreateIconBuilder ( [out, retval] IDispatch **  Result  ) 

Creates a new IconBuilder object.

Since:
1.1.17.

EnumWindows ( [out, retval] IDispatch **  Result  ) 

Returns a list of the Window objects that represents top level windows.

Return values:
List of the Window objects.
Since:
1.1.9.

GetFileSysIconIndexLarge ( [in] BSTR  pVal,
[in, defaultvalue(0)] ULONG  FileAttributes,
[out, retval] ULONG *  Result 
)

Retrieves the index of a system image list icon (large) for a file.

Parameters:
pVal File name.
FileAttributes If not 0 that the function will not attempt to access the file specified by pVal. Rather, it should act as if the file specified by pVal exists with the file attributes passed in FileAttributes,
Return values:
Result Icon Index.
Since:
1.1.10.

GetFileSysIconIndexSmall ( [in] BSTR  pVal,
[in, defaultvalue(0)] ULONG  FileAttributes,
[out, retval] ULONG *  Result 
)

Retrieves the index of a system image list icon (small) for a file.

Parameters:
pVal File name.
FileAttributes If not 0 that the function will not attempt to access the file specified by pVal. Rather, it should act as if the file specified by pVal exists with the file attributes passed in FileAttributes,
Return values:
Result Icon Index.
Since:
1.1.10.

PostCopyData ( [in] VARIANT  Control,
[in] BSTR  Data,
[out, retval] VARIANT *  pVal 
)

Sends WM_COPYDATA message to a Window.

The Window can be a Form .

Parameters:
Control Window.
Data Data.
Return values:
pVal Nonzero indicates success. Zero indicates failure.
Since:
1.1.9.

PostMessage ( [in] VARIANT  Control,
LONG  Message,
LONG  wParam,
VARIANT  lParam,
[out, retval] VARIANT *  pVal 
)

Use this method to post a message to an control.

Parameters:
Control The control.
Message The message identifier.
wParam The wParam.
lParam The lParam.
Return values:
pVal The result.
See also:
PostMessage WinAPI function for details.

RegisterWindowMessage ( [in] BSTR  Message,
[out, retval] ULONG *  MessageId 
)

Registeres a new window message.

See RegisterWindowMessage in the WinAPI.

Parameters:
Message Message name.
Return values:
MessageId Message ID.
Since:
1.1.9.

SendCopyData ( [in] VARIANT  Control,
[in] BSTR  Data,
[out, retval] VARIANT *  pVal 
)

Sends WM_COPYDATA message to a Window.

The Window can be a Form .

Parameters:
Control Window.
Data Data.
Return values:
pVal The result of the message processing.
Since:
1.1.9.

SendMessage ( [in] VARIANT  Control,
LONG  Message,
LONG  wParam,
VARIANT  lParam,
[out, retval] VARIANT *  pVal 
)

Use this method to send a message to an control.

Parameters:
Control The control.
Message The message identifier.
wParam The wParam.
lParam The lParam.
Return values:
pVal The result.
See also:
SendMessage WinAPI function for details.

UuidCreate ( [out, retval] BSTR *  Result  ) 

Creates a new UUID.

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


Property Documentation

VARIANT_BOOL R IsThemeActive

Returns "TRUE", if a visual style is active.

See also:
WindowSystemObject::EnableVisualStyles.
Since:
1.1.16.

VARIANT_BOOL R IsWindows7

Returns "TRUE", if we have Windows 7 or later.

Since:
1.1.10.

VARIANT_BOOL R IsWindows8

Returns "TRUE", if we have Windows 8 or later.

Since:
1.1.10.

VARIANT_BOOL R IsWindowsVista

Returns "TRUE", if we have Windows Vista or later.

Since:
1.1.10.

VARIANT_BOOL R IsWindowsXP

Returns "TRUE", if we have Windows XP or later.

Since:
1.1.10.

IDispatch* R SystemImageListLarge

Returns a system image list object that contains large icon images.

Return values:
pVal ImageList.
Since:
1.1.10.

IDispatch* R SystemImageListSmall

Returns a system image list object that contains small icon images.

Return values:
pVal ImageList.
Since:
1.1.10.


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