LED Static

Homepage: Dynamic LED Control

LEDStaticHWND := DllCall("AHKCtrlSupport\CreateLEDStatic", Str, "LEDStatic", int, nStyle, int, x, int, y, int, width, int, height, DWORD, HWND, int, nID, "Cdecl Int")
LEDStaticHWND Handle to the new control
String Unused
nStyle i.e. 0x10000000
x, y top left coordinates on the dialog
Width, Height Width and Height of the control
HWND Handle of the dialog
ID Id of the new control



nRC := DllCall("AHKCtrlSupport\SetLEDStatic", int, nID, int, dwColor, int, dwDarkColor, int, dwShape, int, nTimer, int, nStart, "Cdecl Int")
nRC NULL: error
<>NULL: ok
nID ID of the control
dwColor BGR-value of the desired light color. 0xff0000=blue; 0x0000ff=red
dwDarkColor BGR-value of the desired dark color. 0xff0000=blue; 0x0000ff=red
dwShape ID_SHAPE_ROUND 3001
ID_SHAPE_SQUARE 3002
nTimer Blinking intervall in ms
nStart 0 to turn the LED off (no blinking, dark color)
1 to turn the LED on



Example:
; --------------- Create a LED Static -----------------------------------
; -----------------------------------------------------------------------
dwexStyle := 0x10000000
x = 10
y = 450
width = 30
height = 30
nID = 110
LEDStaticHWND := DllCall("AHKCtrlSupport\CreateLEDStatic", Str, "LEDStatic", int, nStyle, int, x, int, y, int, width, int, height, int, HWND, int, nID, "Cdecl Int")
if (errorlevel <> 0) || (LEDStaticHWND = 0)
{
	MsgBox error while calling CreateLEDStatic Errorlevel: %errorlevel% - RC: %LEDStaticHWND%
	return
}
dwColor=0xff0000
dwDarkColor=0x880000
dwShape=3001
nTimer = 50
nStart = 1
nRC := DllCall("AHKCtrlSupport\SetLEDStatic", int, nID, int, dwColor, int, dwDarkColor, int, dwShape, int, nTimer, int, nStart, "Cdecl Int")
if (errorlevel <> 0) || (nRC = 0)
{
	MsgBox error while calling SetLEDStatic Errorlevel: %errorlevel% - RC: %nRC%
	return
}
dwexStyle := 0x10000000
x = 40
y = 450
width = 30
height = 30
nID = 111
LEDStaticHWND := DllCall("AHKCtrlSupport\CreateLEDStatic", Str, "LEDStatic", int, nStyle, int, x, int, y, int, width, int, height, int, HWND, int, nID, "Cdecl Int")
if (errorlevel <> 0) || (LEDStaticHWND = 0)
{
	MsgBox error while calling CreateLEDStatic Errorlevel: %errorlevel% - RC: %LEDStaticHWND%
	return
}
dwColor=0x0000ff
dwDarkColor=0x000088
dwShape=3002
nTimer = 700
nStart = 1
nRC := DllCall("AHKCtrlSupport\SetLEDStatic", int, nID, int, dwColor, int, dwDarkColor, int, dwShape, int, nTimer, int, nStart, "Cdecl Int")
if (errorlevel <> 0) || (nRC = 0)
{
	MsgBox error while calling SetLEDStatic Errorlevel: %errorlevel% - RC: %nRC%
	return
}
dwexStyle := 0x10000000
x = 70
y = 450
width = 30
height = 30
nID = 112
LEDStaticHWND := DllCall("AHKCtrlSupport\CreateLEDStatic", Str, "LEDStatic", int, nStyle, int, x, int, y, int, width, int, height, int, HWND, int, nID, "Cdecl Int")
if (errorlevel <> 0) || (LEDStaticHWND = 0)
{
	MsgBox error while calling CreateLEDStatic Errorlevel: %errorlevel% - RC: %LEDStaticHWND%
	return
}
dwColor=0xffff00
dwDarkColor=0x008800
dwShape=3001
nTimer = 1500
nStart = 1
nRC := DllCall("AHKCtrlSupport\SetLEDStatic", int, nID, int, dwColor, int, dwDarkColor, int, dwShape, int, nTimer, int, nStart, "Cdecl Int")
if (errorlevel <> 0) || (nRC = 0)
{
	MsgBox error while calling SetLEDStatic Errorlevel: %errorlevel% - RC: %nRC%
	return
}