WSO (WindowSystemObject)

Post your working scripts, libraries and tools
burque505
Posts: 767
Joined: 22 Jan 2017, 19:37

WSO (WindowSystemObject)

10 Jan 2019, 19:13

(This is not in the Other Utilities section because I'm really only interested in using it with AHK). Today I found WindowSystemObject. The binaries and source and be downloaded from there (32-bit and 64-bit DLLs, which for some reason get installed in "Program Files" and "Program Files (x86)", even though the dlls are the only file in either folder! The installer does register the COM objects, however.

From the project home page:
Main features:

Full set of features for creating window interfaces. Supports all standard windows controls.
ActiveX support (Internet Explorer, Windows Media Player and other).
It supports working with popular image formats that are BMP, JPEG, WMF, GIF.
WSO is a language-independent library. Only COM (Automation) support required.
Intuitive object model.
Events model.
Rich set of Windows API constants is available as properties. An constant can be used by its name.
Docking Framework.
Visual Form Designer
Supports Windows 98SE, ME, NT 4, 2000, XP, 2003, Vista, 2008, 7, 2008 R2, 8, 8.1, 10.

Rich set of samples for different languages included in the distributive:

JScript
VBScript
Perl
Pascal
Java
Python
Ruby
HTML
WSH
WSC
Using ActiveScript.ahk it can be automated - I have tried to do it using only ComObjCreate, i.e.

Code: Select all

obj := ComObjCreate("Scripting.WindowSystemObject")
which works, but I haven't figured out how deal with the event handlers yet. Any and all pointers (no pun intended) as to how to deal with WSO's event handlers purely in AHK will be vastly appreciated!

There is some extraneous testing code in the script below. An animated GIF is attached.

Perhaps of more interest is the information I got from running "tlibimp -P wso.dll" and "tlibimp -C wso.dll": If you're curious, see the dumps attached. There is a wealth of information.

The working code is below (as I mentioned, it needs ActiveScript.ahk, although you could probably do without it if you use a 32-bit ScriptControl - I haven't tried that, though).
Spoiler
WSO.gif
WSO.gif (241.32 KiB) Viewed 161 times
Attachments
WSO..zip
(496.18 KiB) Downloaded 15 times
tmplinshi
Posts: 1293
Joined: 01 Oct 2013, 14:57

Re: WSO (WindowSystemObject)

11 Jan 2019, 02:14

Wow, this component can do so many things. Thanks for posting!

Code: Select all

wso := ComObjCreate("Scripting.WindowSystemObject")

Form := Wso.CreateForm(0, 0, 300, 100)
Form.CenterControl()

Button := Form.CreateButton(10, 10, 75, 25, "Close")
Button.OnClick := Func("ButtonClick")

Form.Show()

Wso.Run()

ButtonClick(this) {
	global Form
	MsgBox, bye
	Form.Close()
}

Return to “Scripts and Functions”

Who is online

Users browsing this forum: cocobanana, zhaowu and 53 guests