vbscript code

vbscript code

Hello,

How would I program the up and down arrow keys to increase or decrease the value of a variable?

What the difference between system.ScreenWidth and ScreenWidth? Is it a matter of programming struction or syntax?

What is a good book to learn vbscript language? I interested in the graphic aspects of it. Not the Web stuff. I want to program gadgets for my desktop. Nothing related to the web.

Thanks.
4,440 views 3 replies
Reply #1 Top
Increase or decrease a variable when the up or down is pressed:

Const VK_UP = &H26 'Up Key
Const VK_DOWN = &H28 'Down Key

Dim myVar

Function Object_OnKeyDown(key, flags)
If key = VK_UP Then
myVar = myVar + 1
End If
If key = VK_DOWN Then
myVar = myVar - 1
End If
End Function


System.ScreenWidth vs ScreenWidth
System.ScreenWidth returns the width of the primary monitor. ScreenWidth would only be a variable that incidently is similar. (It might be an old shorthand...)

VBScript doesn't have a graphics aspect by it self. It's mainly used for the web and automating of Windows tasks. However, it's also possible to implement VBScript, which is a part of Windows Script, for your own application. This is what they did with DesktopX. The documentation for DesktopX is one of the best things you can get to learn writing scripted DX objects/widgets/gadgets. https://www.stardock.com/products/desktopx/documentation/index.html It contains explaination of all the DesktopX scripting features and also a section listing tutorials and other hints.
Reply #2 Top
You might also be interested in following CerebroJD comming articles about DXSCripting. https://www.wincustomize.com/Articles.aspx?AID=82842
Reply #3 Top
Thomassen,

Thanks of the info and the links.