Extended System Control plugin for DesktopX


image

The plan for this plugin is to include all system-related functionality that isn’t already available in the DesktopX System namespace.

 

Download

You can download a test version here (set to expire on 10/5/2009).

If you have ideas for stuff to add to this plugin, feel free to post them on the DesktopX 4.x request thread.

 

Plugin Information

Mouse wheel

  • SystemEx_OnMouseWheel(rotation)
  • SystemEx_OnMButtonDown(x, y)
  • SystemEx_OnMButtonUp(x, y, dragged)

Monitor information

  • Monitors
  • NumberOfMonitors
  • GetMonitor(index)

MonitorInfo object:

  • IsPrimary
  • Left
  • Top
  • Bottom
  • Right

Volume

  • Volume
  • Mute
  • PeakValue (read-only)
  • SystemEx_OnVolumeEvent(volume)
  • SystemEx_OnMuteEvent(isMuted)

Instance

  • CommandLine
  • CommandLineArgs
  • IsFirstInstance
  • SystemEx_OnNewInstance(commandLineArgs)

Misc

  • VerifySignature(path, signature, type)

 

Documentation

Mouse wheel

SystemEx_OnMouseWheel(rotation)

When the mouse is over the object and the mousewheel is used, the SystemExOnMouseWheel
function will be called with the wheel rotation passed as a parameter.

The wheel rotation will be in number of lines.

Default value: 3
Default value for page scrolling: 10

A positive value indicates that the wheel was rotated forward, away from the user;
a negative value indicates that the wheel was rotated backward, toward the user.

SystemEx_OnMButtonDown(x, y) & SystemEx_OnMButtonUp(x, y, dragged)

When you middle click on your object, the SystemEx_OnMButtonDown function will be
called. When you release the button, theSystemEx_OnMButtonUp function will be called.

Both functions will have the mouse coordinates relative to your object passed as
parameters.

 

Monitor Information

This one was asked by Zubaz to better handle multi-monitor systems. As it turns out, the virtual screen coordinates are not nearly enough to be able to position objects on multi-monitor systems. WMI is exposing monitor information, but it does not seems to work reliably (it only gives information for the first monitor on my system for example).

SystemEx.Monitors

Gets an array of MonitorInfo objects

SystemEx.GetMonitor(index)

Returns the MonitorInfo for the given screen

SystemEx.NumberOfMonitors

Gets the number of monitors on the machine

 

Volume Information

SystemEx_OnVolumeEvent(volume)

When the user change the master volume through the volume mixer or another application
your object callback is called. The volume parameter will contain the current master
volume.

XP Compatibility: never called.

SystemEx_OnMuteEvent(isMuted)

If the volume is muted, your object callback is called.
isMuted will be True if the volume has been muted, false otherwise.

XP Compatibility: never called.

SystemEx.Volume

Sets or gets the master volume.

Usage: 
SystemEx.Volume = <volume>
<volume> = SystemEx.Volume

<volume> should/will be between 0 and 100. Any value outside these bounds will be capped.

SystemEx.Mute

Mute or un-mute the audio stream

Usage:
SystemEx.Mute = True
isMuted = SystemEx.Mute

Mute can take two values: True and False.
If Mute is True the audio stream is muted, otherwise it is not muted.

SystemEx.PeakValue

This is a read-only property. It allows you to get the peak level value for the
currently playing sample.

Usage: 
level = SystemEx.PeakValue
level will be between 0 and 100.

XP Compatibility: might not work with some cards, in which case it will always  returns 100.
It reads from the waveout device, so it won’t work when reading from a CD for example.

 

Instance Information

SystemEx.CommandLine

Get the full command line (including the path to the executable and DesktopX-specific arguments)

SystemEx.CommandLineArgs

Get an array of command line arguments.
Command line arguments have been cleaned up to remove DesktopX-specific arguments (in the case of single-exe gadgets)

SystemEx.IsFirstInstance

Will be True if this is the first instance to run, False otherwise.
It is preferable to check for it at startup and close the gadget accordingly,
as only the first instance will receive a callback message when a new instance is started.

SystemEx_OnNewInstance(commandLineArgs)

Gets called when another instance is started. The command line arguments are passed in an array.

 

Misc Information

SystemEx.VerifySignature(path, signature, type)
Check the signature of the file pointed to by path.

The only type of signature supported at this time is SIGNATURE_SHA1

 

Changelog

1.0 Build 228:

  • Renamed to DXSystemEx (plugin namespace is now SystemEx)
  • Added SHA1 signature check
  • Added MouseWheel and Middle button click callbacks (merged from DXMouseWheel)
  • Added Master volume control / Mute / Peak (merged from DXVolumeControl)
  • Added instance information (merged from DxInstance)

1.0 Build 205:

  • First test version
,