WSO (WindowSystemObject)

Post your working scripts, libraries and tools
burque505
Posts: 975
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 1222 times
Attachments
WSO..zip
(496.18 KiB) Downloaded 70 times
tmplinshi
Posts: 1385
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()
}
burque505
Posts: 975
Joined: 22 Jan 2017, 19:37

Re: WSO (WindowSystemObject)

15 May 2019, 23:55

@tmplinshi, I just saw this post of yours now for some reason. A special thanks to you for giving me a way to translate things like

Code: Select all

HelpMenu.Add("About","F1").OnExecute = GetRef("HelpAbout")
in VBScript to

Code: Select all

HelpMenu.Add("About","F1").OnExecute := Func("HelpAbout")
in AHK. There are many examples of this in the code attached.

I was going to include the DLL in the attached archive, but it's probably better to install the thing if you're going work with WSO, so the COM gets registered. You can get WindowSystemObject at this link, look for WSO on the left.

Just another Notepad clone in AHK :) You need the file WSOConsts.ahk in the archive to be in script dir.
WSO Edit.gif
WSO Edit.gif (295.83 KiB) Viewed 819 times
Attachments
WSO.zip
(8.99 KiB) Downloaded 35 times
burque505
Posts: 975
Joined: 22 Jan 2017, 19:37

Re: WSO (WindowSystemObject)

19 May 2019, 13:41

DOCKING FRAMEWORK

This is **Almost** working in AutoHotkey code also, instead of just executing JS as here, but I don't quite have it (95%). But I thought it was too wild to not share right away, so here is the JS version.
Using ActiveScript.ahk, attached just in case, the file 'ascript.ahk' runs 'littledoc.js'. I've included the WSO contants file again also, but the DLL is NOT here. See post above for installation links.

BTW, so far the JS version loads much faster than my AHK version, although I can't tell much difference between them after loading. I was surprised.

Regards,
burque505
P.S. Sorry about the artefacts (or artifacts, depending on which side of the pond you're on :)) in the GIF.
WSO Dock 2.gif
WSO Dock 2.gif (547.05 KiB) Viewed 700 times
Attachments
WSO post-success.zip
(10.78 KiB) Downloaded 36 times
burque505
Posts: 975
Joined: 22 Jan 2017, 19:37

Re: WSO (WindowSystemObject)

21 May 2019, 14:34

ListView related - called "workareas", from the WSO docs. Still need to install WSO from links above, of course.
Spoiler
LV workareas.PNG
LV workareas.PNG (34.13 KiB) Viewed 621 times
burque505
Posts: 975
Joined: 22 Jan 2017, 19:37

Re: WSO (WindowSystemObject)

22 May 2019, 19:04

I like non-rectangular GUIs, here's one using WSO that only took about 50 lines of code. Again, DLLs not included. See link above.
Spoiler
Region.gif
Region.gif (5.65 KiB) Viewed 563 times
User avatar
elModo7
Posts: 104
Joined: 01 Sep 2017, 02:38

Re: WSO (WindowSystemObject)

28 May 2019, 02:46

Man, this is great thanks for posting it!
:beer:

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Flipeador, Google [Bot] and 40 guests