SysMetrics plugin v1.11 by Bikonja

SysMetrics is a free plugin made in Borland C++ Builder 6, using Dgilmour's awesome small SDK!
It started out as a learning project for me. I didn't know what C++ was all about, but then came
Dgilmour and he helped me to learn everything needed for this plugin, and helped me a lot with it!
On to the important stuff...


SysMetrics has 4 categorys of functions, click the links to see them
Date Picker - Mouse & Keyboard functions - Windows settings - Window & Screen manipulation

 

 

Date Picker functions:
- DatePicker
- DPSetPos
- DPSetColors
- DPSetRange
- DPSetFirstDay
- GetSelDate
- SetSelDate
- HideDatePicker

 


Mouse & keyboard functions:
- Get mouse double click time
- Set mouse double click time
- Block Mouse and Keyboard input
- Unblock Mouse and Keyboard input
- Get Mouse Position (in screen coordinates)
- Set Mouse Position (in screen coordinates)
- Get Mouse Position (in client coordinates)
- Set Mouse Position (in client coordinates)
- Get Key state

 

Windows settings:
- Get SysMetrics
- Get Drive type
- Get environment paths

 

Window & Screen manipulation:
- Set Window transparency (opacity)
- Set Window transparency (opacity) for other windows
- Set Color Transparency (make holes)
- Get Window title
- Set Window title
- Get Pixel Color
- Set Pixel Color

 

 

DatePicker:

format$='dd/mm/yyyy'
PluginSet
("PlugIn" ,"format$")
PluginRun
("PlugIn","DatePicker")
PluginGet("PlugIn" ,"size$")

-> this function creates the date picker (calendar) and it's return value is the size of the date picker
-> don't forget to set the format as input for this function, it will be used for every function until you destroy the DP
-> the format can be either mm/dd/yyyy or dd/mm/yyyy


DPSetPos:

pos$='15,20,230,200'
PluginSet
("PlugIn","pos$")
PluginRun
("PlugIn","DPSetPos")

-> this function sets the position and size of your date picker
-> pos$ is x,y,width,height


DPSetColors:

colors$='255,0,0|0,255,0|0,0,255|255,0,255|0,255,255|255,255,0'
PluginSet
("PlugIn","colors$")
PluginRun
("PlugIn","DPSetColors")

-> this function changes the colors of your date picker
-> colors are in r,g,b format and seperated by |
-> first color is the background color displayed between months
-> second color is the background color displayed within the month
-> third color is the color used to display text within a month
-> fourth color is the background color displayed in the calendar's title
-> fifth color is the color used to display text within the calendar's title
-> sixth color is the color used to display header day and trailing day text. Header and trailing days are the days from the previous and following months that appear on the current month calendar.
-> for me, most of the colors don't change, however, Delboy has Vista too and his colors change...


DPSetRange:

range=3
PluginSet
("PlugIn","range")
PluginRun
("PlugIn","DPSetRange")

-> this function sets how much dates in a range can the user select at once
-> range is the number of days that a user can select at once


DPSetFirstDay:

day=6
PluginSet
("PlugIn","day")
PluginRun
("PlugIn","DPSetFirstDay")

-> this function sets the first day of the week
-> day is the starting day of the week, 0 being Monday, 1 being Tuesday, etc..


GetSelDate:

PluginRun("PlugIn","GetSelDate")
PluginGet("PlugIn" ,"date$")

-> this function gets the selected range of dates in an array in format startdate|enddate


SetSelDate:

date$='13/12/2007|15/12/2007'
PluginSet("PlugIn" ,"date$")
PluginRun
("PlugIn","SetSelDate")

-> this function selects the set range of dates
-> the input format should be the same as specified in Date picker creation (mm/dd/yyyy or dd/mm/yyyy)



HideDatePicker:

PluginRun("PlugIn","HideDatePicker")

-> this function closes the date picker



Get mouse double click time:

PluginRun("PlugIn","GetDblClickTime")
PluginGet("PlugIn" ,"val")

-> double click time in miliseconds is stored in val

 


Set mouse double click time:

PluginSet("PlugIn","500")
PluginRun
("PlugIn","SetDblClickTime")

-> 500 is your wanted double click time in miliseconds

 


Block Mouse and Keyboard input:

PluginRun("PlugIn","DisableInput")

-> Blocked input can be unblocked with CTRL-ALT-DEL, or by sudden program exit

 


UnBlock Mouse and Keyboard input:
PluginRun("PlugIn","EnableInput")

 


KeyState:

PluginSet("PlugIn","val")
PluginRun
("PlugIn","KeyState")
PluginGet("PlugIn","state$")

-> val is the ASCII value of an alphanumerical character, check MMB help for an ASCII chart. Use uppercase letters for code input, it does not matter in detection if you press upper or lower case letters; state$ is an array showing which buttons are pressed. item1 is ctrl, item2 is alt, item3 is shift and item4 is the specified key. The seperator is |. If an item is a nonzero value, the key was pressed at the time the function was executed. Check the sample for sample on how to use this stuff in real life.

 


Get SysMetrics (check Values.htm for a list of what you can do with this):

PluginSet("PlugIn","ID")
PluginRun
("PlugIn","GetSysMetrics")
PluginGet("PlugIn","val")

-> ID is ID of the item you want to get; return value is stored in val
For a full list of item ID's, open up Values.htm

 


Set window transparency:

PluginSet("PlugIn","opacity")
PluginRun
("PlugIn","Transparency")

-> opacity is wanted opacity for window from 0 (transparent) to 255 (opaque)
-> With this function you can make your project fade in! Check SysMetrics sample to see how it can be done...
-> Check transparency sample for advanced transparency
-> This does not make color 255,0,255 transparent (Check Set color transparency (make holes) command)

 


Set window transparency for other windows:

PluginSet("PlugIn","opacity")
PluginSet
("PlugIn","windowname$")
PluginRun
("PlugIn","TransparencyWindow")

-> opacity is wanted opacity for window from 0 (transparent) to 255 (opaque)
-> windowname$ is name of the window you want to change the opacity for

 


Set color transparency (make holes):

PluginSet("PlugIn","opacity")
PluginRun
("PlugIn","TransparentColor")

-> opacity is wanted overall opacity for window from 0 (transparent) to 255 (opaque)
-> You can use this to set windows opacity and at the same time have holes in MMB, or you can use the window transparency to have window transparency without making holes (making transparent everything that's in color 255,0,255)

 


Get window title:

PluginRun("PlugIn","GetTitle")
PluginGet
("PlugIn","title$")

-> title$ now holds the title

 


Set window title:

title$='Your title'
PluginSet
("PlugIn","title$")
PluginRun
("PlugIn","SetTitle")

-> title$ holds your desired title
-> for a sample on how to make a scrolling title, look at scrollingtitle sample

 


Get drive type:

drive$='C:\\'
PluginSet
("PlugIn","drive$")
PluginRun
("PlugIn","DriveType")
PluginGet("PlugIn","type$")

-> drive$ holds your desired drive letter with :\\ following it (MMB can not use a single \ at end of string)
-> type$ now contains type of that drive. Look here for a list of what types can you get

 


Get environment paths:

var$='USERPROFILE'
PluginSet
("PlugIn","var$")
PluginRun
("PlugIn","EnvironmentPath")
PluginGet("PlugIn","path$")

-> var$ holds your desired environment variable (for a full list of variables, look here - sample doesn't show all)
-> path$ now contains value of your environment variable

 


Get Mouse Position (screen):

PluginRun("PlugIn","MousePos")
PluginGet("PlugIn","pos$")

-> pos$ now holds the current mouse cursor coordinates (0,0 is at the top-left corner of your screen)

 


Set Mouse Position (screen):

pix$='200,200'
PluginSet
("PlugIn","pix$")
PluginRun
("PlugIn","SetMousePos")

-> pix$ holds the wanted mouse cursor coordinates on your screen (0,0 is at the top-left corner of your screen)

 


Get Mouse Position (client):

PluginRun("PlugIn","ClientMousePos")
PluginGet("PlugIn","pos$")

-> pos$ now holds the current mouse cursor coordinates (0,0 is at the top-left corner of your project window)

 


Set Mouse Position (client):

pix$='200,200'
PluginSet
("PlugIn","pix$")
PluginRun
("PlugIn","SetClientMousePos")

-> pix$ holds the wanted mouse cursor coordinates on your project (0,0 is at the top-left corner of your project window)

 


Get Pixel Color:

pix$='200,200'
PluginSet
("PlugIn","pix$")
PluginRun
("PlugIn","GetPixelColor")
PluginGet("PlugIn","color$")

-> pix$ holds your desired pixel coordinates
-> color$ now contains RGB value of your specified pixel (see samples on advanced usage of this function)

 


Set Pixel Color:

param$='200,200,0,0,0'
PluginSet
("PlugIn","param$")
PluginRun
("PlugIn","SetPixelColor")

-> param$ holds your desired parameters which in form x,y,r,g,b;
---- x = x screen coordinate of the pixel to be colored
---- y = y screen coordinate of the pixel to be colored
---- r = intensity of red in the color (0....255)
---- g = intensity of green in the color (0....255)
---- b = intensity of blue in the color (0....255)
-> shown examples paints screen pixel 200,200 with black color