Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; NEO_nTray (NEO's Network Tray Tool)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Notes:
;ctrl left click also works for th etaskbar as well, restoring the last window
;so I may want to redo the code to include it
;
; %A_IPAddress1% Leaks massive amounts of memory, DO NOT use it!!!
;Code Timer for Debugging...
;DllCall("QueryPerformanceCounter", "Int64*", CounterBefore) ;External Var, CPU Tick Timer
;StartTime := A_TickCount ;Internal Var, MS Timer
;Sleep 1000
;ElapsedTime_ms := (A_TickCount - StartTime)
;DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
;ElapsedTime_pc := (CounterAfter - CounterBefore)
;ToolTip, %ElapsedTime_pc% Ticks`n%ElapsedTime_ms% ms
;This thing has gotten slower over the last rev or so...
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Entry Point
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#Persistent
#SingleInstance, Force
#MaxMem 1
#MaxThreads 3
SetBatchLines -1
Process, Priority,, BelowNormal
Menu, Tray, NoStandard ;Disable Standard AHK Menu Entries
SetTitleMatchMode, 2
DetectHiddenWindows, On ;Needed to detect proxomitron while minimized
GoSub Init
StartTime := A_TickCount ;Internal Var, MS Timer
ElapsedTime_ms := (A_TickCount - StartTime)
SetTimer, Burn_Cycle, %Main_Loop_Timing%
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
EmptyMem(PIDtoEmpty)
{
h:= DllCall("OpenProcess", "UInt", 0x001F0FFF, "Int", 0, "Int", PIDtoEmpty)
DllCall("SetProcessWorkingSetSize", "UInt", h, "Int", -1, "Int", -1)
DllCall("CloseHandle", "Int", h)
}
GetTrayBar()
{
ControlGet, hParent, hWnd,, TrayNotifyWnd1 , ahk_class Shell_TrayWnd
ControlGet, hChild , hWnd,, ToolbarWindow321, ahk_id %hParent%
Loop
{
ControlGet, hWnd, hWnd,, ToolbarWindow32%A_Index%, ahk_class Shell_TrayWnd
If Not hWnd
Break
Else If hWnd = %hChild%
{
idxTB := A_Index
Break
}
}
Return idxTB
}
TrayIcons(sExeName = "Proxomitron-MOD.exe")
{
WinGet, pidTaskbar, PID, ahk_class Shell_TrayWnd
hProc:= DllCall("OpenProcess", "Uint", 0x38, "int", 0, "Uint", pidTaskbar)
pProc:= DllCall("VirtualAllocEx", "Uint", hProc, "Uint", 0, "Uint", 32, "Uint", 0x1000, "Uint", 0x4)
idxTB:= GetTrayBar()
SendMessage, 0x418, 0, 0, ToolbarWindow32%idxTB%, ahk_class Shell_TrayWnd ; TB_BUTTONCOUNT
Loop, %ErrorLevel%
{
SendMessage, 0x417, A_Index-1, pProc, ToolbarWindow32%idxTB%, ahk_class Shell_TrayWnd ; TB_GETBUTTON
VarSetCapacity(btn,32,0), VarSetCapacity(nfo,32,0)
DllCall("ReadProcessMemory", "Uint", hProc, "Uint", pProc, "Uint", &btn, "Uint", 32, "Uint", 0)
iBitmap := NumGet(btn, 0)
idn := NumGet(btn, 4)
Statyle := NumGet(btn, 8)
If dwData := NumGet(btn,12)
iString := NumGet(btn,16)
Else dwData := NumGet(btn,16,"int64"), iString:=NumGet(btn,24,"int64")
DllCall("ReadProcessMemory", "Uint", hProc, "Uint", dwData, "Uint", &nfo, "Uint", 32, "Uint", 0)
If NumGet(btn,12)
hWnd := NumGet(nfo, 0)
, uID := NumGet(nfo, 4)
, nMsg := NumGet(nfo, 8)
, hIcon := NumGet(nfo,20)
Else hWnd := NumGet(nfo, 0,"int64"), uID:=NumGet(nfo, 8), nMsg:=NumGet(nfo,12)
WinGet, pid, PID, ahk_id %hWnd%
WinGet, sProcess, ProcessName, ahk_id %hWnd%
WinGetClass, sClass, ahk_id %hWnd%
If !sExeName || (sExeName = sProcess) || (sExeName = pid)
VarSetCapacity(sTooltip,128), VarSetCapacity(wTooltip,128*2)
, DllCall("ReadProcessMemory", "Uint", hProc, "Uint", iString, "Uint", &wTooltip, "Uint", 128*2, "Uint", 0)
, DllCall("WideCharToMultiByte", "Uint", 0, "Uint", 0, "str", wTooltip, "int", -1, "str", sTooltip, "int", 128, "Uint", 0, "Uint", 0)
; , sTrayIcons .= "idx: " . A_Index-1 . " | idn: " . idn . " | Pid: " . pid . " | uID: " . uID . " | MessageID: " . nMsg . " | hWnd: " . hWnd . " | Class: " . sClass . " | Process: " . sProcess . "`n" . " | Tooltip: " . sTooltip . "`n"
, sTrayIcons .= "" . hWnd . ""
}
DllCall("VirtualFreeEx", "Uint", hProc, "Uint", pProc, "Uint", 0, "Uint", 0x8000)
DllCall("CloseHandle", "Uint", hProc)
Return sTrayIcons
}
RemoveTrayIcon(hWnd, uID, nMsg = 0, hIcon = 0, nRemove = 2)
{
NumPut(VarSetCapacity(ni,444,0), ni)
NumPut(hWnd , ni, 4)
NumPut(uID , ni, 8)
NumPut(1|2|4, ni,12)
NumPut(nMsg , ni,16)
NumPut(hIcon, ni,20)
Return DllCall("shell32\Shell_NotifyIconA", "Uint", nRemove, "Uint", &ni)
}
;User Timer Max Quantum Slice Resolution
;Quantum timer resolution
Set_User_Timer_QSR_Min:
DllCall("ntdll.dll\NtSetTimerResolution", UInt, 1) ;0.500 ms
return
Set_User_Timer_QSR_Max:
DllCall("ntdll.dll\NtSetTimerResolution", UInt, 999999) ;0.500 ms
return
Set_User_Timer_QSR_05:
DllCall("ntdll.dll\NtSetTimerResolution", UInt, 5000) ;0.500 ms
return
Set_User_Timer_QSR_1:
DllCall("ntdll.dll\NtSetTimerResolution", UInt, 10000) ;1.000 ms
return
Set_User_Timer_QSR_10:
DllCall("ntdll.dll\NtSetTimerResolution", UInt, 100000) ;10.000 ms
return
Set_User_Timer_QSR_156:
DllCall("ntdll.dll\NtSetTimerResolution", UInt, 156000) ;15.600 ms
return
Set_Tray_Icons_Default:
Network_Icons_Use_Default = Enable
Menu, Menu_Settings_Tray_Icon, Icon, Default, shell32.dll, 145
Menu, Menu_Settings_Tray_Icon, Icon, Custom, shell32.dll, 132
return
Set_Tray_Icons_Custom:
Network_Icons_Use_Default = Disable
Menu, Menu_Settings_Tray_Icon, Icon, Default, shell32.dll, 132
Menu, Menu_Settings_Tray_Icon, Icon, Custom, shell32.dll, 145
return
Set_Network_Use_Keyboard_Leds_Disable:
Network_Use_Keyboard_Leds = Disable
Menu, Menu_Settings_Keyboard_Leds, Icon, Disable, shell32.dll, 145
Menu, Menu_Settings_Keyboard_Leds, Icon, Enable, shell32.dll, 132
GetKeyState, KeyState, ScrollLock, T ;Bug fix for threading issues, so non of the leds end up getting stuck on...
if KeyState = U ;this one gets stuck on anyways every time it seems
{
KeyboardLED(1, "Off")
}
GetKeyState, KeyState, CapsLock, T
if KeyState = U
{
KeyboardLED(4, "Off")
}
GetKeyState, KeyState, NumLock, T
if KeyState = U
{
KeyboardLED(2, "Off")
}
return
Set_Network_Use_Keyboard_Leds_Enable:
Network_Use_Keyboard_Leds = Enable
Menu, Menu_Settings_Keyboard_Leds, Icon, Disable, shell32.dll, 132
Menu, Menu_Settings_Keyboard_Leds, Icon, Enable, shell32.dll, 145
return
Set_QuickLaunch_Mod_Disable:
QuickLaunch_Mod = Disable
Menu, Menu_Settings_QuickLaunch_Mod, Icon, Disable, shell32.dll, 145
Menu, Menu_Settings_QuickLaunch_Mod, Icon, Enable, shell32.dll, 132
return
Set_QuickLaunch_Mod_Enable:
QuickLaunch_Mod = Enable
Menu, Menu_Settings_QuickLaunch_Mod, Icon, Disable, shell32.dll, 132
Menu, Menu_Settings_QuickLaunch_Mod, Icon, Enable, shell32.dll, 145
return
Set_Aero_Peek_Disable:
Aero_Peek = Disable
Menu, Menu_Settings_Aero_Peek, Icon, Disable, shell32.dll, 145
Menu, Menu_Settings_Aero_Peek, Icon, Enable, shell32.dll, 132
Control, Disable,, TrayShowDesktopButtonWClass1, ahk_class Shell_TrayWnd
return
Set_Aero_Peek_Enable:
Aero_Peek = Enable
Menu, Menu_Settings_Aero_Peek, Icon, Disable, shell32.dll, 132
Menu, Menu_Settings_Aero_Peek, Icon, Enable, shell32.dll, 145
Control, Enable,, TrayShowDesktopButtonWClass1, ahk_class Shell_TrayWnd
return
Win7_Taskbar_Mod:
RunWait %ComSpec% /C "net stop UxSms",, Hide ;Stop UxSms
DetectHiddenWindows, On ;Enable Taskbar Autohide
VarSetCapacity(APPBARDATA, 36, 0) ;Var mem limit
;After modding win8 a bit winlogon exe's dwm.exe and taskkill cannot find it, so pskill does the trick for now
;RunWait %ComSpec% /C "taskkill /im dwm.exe /f",, Hide ;Restart DWM (Windows 8)
RunWait %ComSpec% /C "pskill dwm.exe",, Hide ;Restart DWM (Windows 8)
NumPut((ABS_ALWAYSONTOP := 0x2) | (ABS_AUTOHIDE := 0x1), APPBARDATA, 32, "UInt")
DllCall("Shell32.dll\SHAppBarMessage", "UInt", (ABM_SETSTATE := 0x0A), "UInt", &APPBARDATA)
WinHide ahk_class Shell_TrayWnd
RunWait %ComSpec% /C "net start UxSms",, Hide ;Restart UxSms
NumPut((ABS_ALWAYSONTOP := 0x2), APPBARDATA, 32, "UInt") ;Disable Taskbar Autohide
DllCall("Shell32.dll\SHAppBarMessage", "UInt", (ABM_SETSTATE := 0xA), "UInt", &APPBARDATA)
WinShow ahk_class Shell_TrayWnd
Reload ;Needed to refresh the desktop width var...
return
;;; Network Monitor Functions:
GetIfTable(ByRef tb, Border = True)
{
nSize := 4 + 860 * GetNumberOfInterfaces() + 8 ;Var mem limit calc
VarSetCapacity(tb, nSize) ;Var mem limit
Return DllCall("iphlpapi\GetIfTable", "Uint", &tb, "UintP", nSize, "int", Border)
}
GetNumberOfInterfaces()
{
DllCall("iphlpapi\GetNumberOfInterfaces", "UintP", nIf)
Return nIf
}
DecodeInteger(ptr)
{
Return *ptr | *++ptr << 8 | *++ptr << 16 | *++ptr << 24
}
;notes:
;typedef struct _MIB_IFROW {
; WCHAR wszName[MAX_INTERFACE_NAME_LEN];
; DWORD dwIndex;
; DWORD dwType;
; DWORD dwMtu;
; DWORD dwSpeed;
; DWORD dwPhysAddrLen;
; BYTE bPhysAddr[MAXLEN_PHYSADDR];
; DWORD dwAdminStatus;
; DWORD dwOperStatus;
; DWORD dwLastChange;
; DWORD dwInOctets;
; DWORD dwInUcastPkts;
; DWORD dwInNUcastPkts;
; DWORD dwInDiscards;
; DWORD dwInErrors;
; DWORD dwInUnknownProtos;
; DWORD dwOutOctets;
; DWORD dwOutUcastPkts;
; DWORD dwOutNUcastPkts;
; DWORD dwOutDiscards;
; DWORD dwOutErrors;
; DWORD dwOutQLen;
; DWORD dwDescrLen;
; BYTE bDescr[MAXLEN_IFDESCR];
;} MIB_IFROW, *PMIB_IFROW;
;;; Keyboard LED Functions:
KeyboardLED(LEDvalue, Cmd) ;LEDvalue: ScrollLock=1, NumLock=2, CapsLock=4, Cmd = On / Off
{
Static h_device
If ! h_device ;initialise
{
device =\Device\KeyBoardClass0
SetUnicodeStr(fn, device)
h_device := NtCreateFile(fn, 0 + 0x00000100 + 0x00000080 + 0x00100000, 1, 1, 0x00000040 + 0x00000020, 0)
}
VarSetCapacity(output_actual, 4, 0)
input_size = 4
VarSetCapacity(input, input_size, 0)
If Cmd = On ;forces all choosen LED's to ON (LEDvalue = 0 -> LED's according to keystate)
{
KeyLED := LEDvalue | (GetKeyState("ScrollLock", "T") + 2 * GetKeyState("NumLock", "T") + 4 * GetKeyState("CapsLock", "T"))
}
If Cmd = Off ;forces all choosen LED's to OFF (LEDvalue = 0 -> LED's according to keystate)
{
LEDvalue := LEDvalue ^ 7
KeyLED := LEDvalue & (GetKeyState("ScrollLock", "T") + 2 * GetKeyState("NumLock", "T") + 4 * GetKeyState("CapsLock", "T"))
}
;EncodeInteger(KeyLED, 1, &input, 2) ;input bit pattern (KeyLED): bit 0 = scrolllock, bit 1 = numlock, bit 2 = capslock
input := Chr(1) Chr(1) Chr(KeyLED)
input := Chr(1)
success := DllCall("DeviceIoControl", "uint", h_device, "uint", CTL_CODE(0x0000000B, 2, 0, 0), "uint", &input, "uint", input_size, "uint", 0, "uint", 0, "uint", &output_actual, "uint", 0)
}
CTL_CODE(p_device_type, p_function, p_method, p_access)
{
Return, (p_device_type << 16) | (p_access << 14) | (p_function << 2) | p_method
}
NtCreateFile(ByRef wfilename, desiredaccess, sharemode, createdist, flags, fattribs)
{
VarSetCapacity(fh, 4, 0)
VarSetCapacity(objattrib, 24, 0)
VarSetCapacity(io, 8, 0)
VarSetCapacity(pus, 8)
uslen := DllCall("lstrlenW", "str", wfilename) * 2
InsertInteger(uslen, pus, 0, 2)
InsertInteger(uslen, pus, 2, 2)
InsertInteger(&wfilename, pus, 4)
InsertInteger(24, objattrib, 0)
InsertInteger(&pus, objattrib, 8)
status := DllCall("ntdll\ZwCreateFile", "str", fh, "UInt", desiredaccess, "str", objattrib, "str", io, "UInt", 0, "UInt", fattribs, "UInt", sharemode, "UInt", createdist, "UInt", flags, "UInt", 0, "UInt", 0, "UInt")
return % ExtractInteger(fh)
}
SetUnicodeStr(ByRef out, str_)
{
VarSetCapacity(st1, 8, 0)
InsertInteger(0x530025, st1)
VarSetCapacity(out, (StrLen(str_) + 1) * 2, 0)
DllCall("wsprintfW", "str", out, "str", st1, "str", str_, "Cdecl UInt")
}
;pSource is a string (buffer) whose memory area contains a raw/binary integer at pOffset.
;The caller should pass true for pSigned to interpret the result as signed vs. unsigned.
;pSize is the size of PSource's integer in bytes (e.g. 4 bytes for a DWORD or Int).
;pSource must be ByRef to avoid corruption during the formal-to-actual copying process
;(since pSource might contain valid data beyond its first binary zero).
ExtractInteger(ByRef pSource, pOffset = 0, pIsSigned = false, pSize = 4)
{
Loop %pSize% ;Build the integer by adding up its bytes.
result += *(&pSource + pOffset + A_Index - 1) << 8 * (A_Index - 1)
if (!pIsSigned OR pSize > 4 OR result < 0x80000000)
return result ;Signed vs. unsigned doesn't matter in these cases.
return -(0xFFFFFFFF - result + 1) ;Otherwise, convert the value (now known to be 32-bit) to its signed counterpart
}
;The caller must ensure that pDest has sufficient capacity. To preserve any existing contents in pDest,
;only pSize number of bytes starting at pOffset are altered in it.
InsertInteger(pInteger, ByRef pDest, pOffset = 0, pSize = 4)
{
Loop %pSize% ;Copy each byte in the integer into the structure as raw binary data.
DllCall("RtlFillMemory", "UInt", &pDest + pOffset + A_Index-1, "UInt", 1, "UChar", pInteger >> 8 * (A_Index - 1) & 0xFF)
}
;;; Hotkeys
F12:: ;Show / Hide Taskbar
{
If TaskBar_State = Hidden
{
NumPut((ABS_ALWAYSONTOP := 0x2), APPBARDATA, 32, "UInt")
DllCall("Shell32.dll\SHAppBarMessage", "UInt", (ABM_SETSTATE := 0xA), "UInt", &APPBARDATA)
WinShow ahk_class Shell_TrayWnd
TaskBar_State = Visable
}
else
{
DetectHiddenWindows, On
VarSetCapacity(APPBARDATA, 36, 0) ;var mem limit
NumPut((ABS_ALWAYSONTOP := 0x2) | (ABS_AUTOHIDE := 0x1), APPBARDATA, 32, "UInt")
DllCall("Shell32.dll\SHAppBarMessage", "UInt", (ABM_SETSTATE := 0xA), "UInt", &APPBARDATA)
WinHide ahk_class Shell_TrayWnd
TaskBar_State = Hidden
}
}
;Disable for now
;#t:: ;Show / Hide Active Toolbar
;{
; WinSet, Style, ^0xC00000, A
;}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Burn_Cycle
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Burn_Cycle:
;Code Timer for Debugging...
;DllCall("QueryPerformanceCounter", "Int64*", CounterBefore) ;External Var, CPU Tick Timer
;StartTime := A_TickCount ;Internal Var, MS Timer
if IP_Change = 0 ;cludge for multi threading
{
GoSub Network_Monitor
}
if QuickLaunch_Mod = Enable
{
GoSub QuickLaunch_Mod
}
;Opera title bar remover mod
IfWinActive, - Opera
{
WinSet, Style, -0xC00000, - Opera
WinGetPos,,, Var_Width, A,,,
if (Var_Width > Desktop_Width) ;Seems ok, but the script needs reloading baised on the taskbar width otherwise the desktop width var is not refreshed :(
{
WinMove, - Opera,, -3, -3, %Desktop_Width%, %Desktop_Height%,, ;Slowdown Part..
; WinMove, - Opera,, -3, -3, 1922, %Desktop_Height%,, ;Slowdown Part..
}
}
;Firefox title bar remover mod
IfWinActive, - Mozilla Firefox
{
WinSet, Style, -0xC00000, - Mozilla Firefox
WinGetPos,,, Var_Width, A,,,
if (Var_Width > Desktop_Width) ;Seems ok, but the script needs reloading baised on the taskbar width otherwise the desktop width var is not refreshed :(
{
WinMove, - Mozilla Firefox,, -3, -3, %Desktop_Width%, %Desktop_Height%,,
}
}
;Download_Rate_Secs := Round(Download_Rate * (((A_TickCount - StartTime) / 1000), 1))
;Upload_Rate_Secs := Round(Upload_Rate * (((A_TickCount - StartTime) / 1000), 1))
;needs null check...
if (IP_Address = "127.0.0.1" || IP_Address = "0.0.0.0")
{
Menu, Tray, Tip, Disconnected
}
else
{
Menu, Tray, Tip, IP: %IP_Address%`nDownload Rate: %Download_Rate% K`nUpload Rate: %Upload_Rate% K`nDownloaded Total: %Downloaded_Total% K`nUploaded Total: %Uploaded_Total% K
}
;DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
;ElapsedTime_pc := (CounterAfter - CounterBefore)
;ToolTip, Burn_Cycle:`n%ElapsedTime_pc% Ticks`n%ElapsedTime_ms% ms, 0, 0
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Read_Cfg
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Read_Cfg:
IniRead, Main_Loop_Timing, %A_ScriptDir%\NEO_nTray.ini, Main, Main_Loop_Timing
IniRead, Aero_Peek, %A_ScriptDir%\NEO_nTray.ini, Extra, Aero_Peek
IniRead, QuickLaunch_Mod, %A_ScriptDir%\NEO_nTray.ini, Extra, QuickLaunch_Mod
IniRead, TaskBar_State, %A_ScriptDir%\NEO_nTray.ini, Extra, TaskBar_State
IniRead, Port_Viewer, %A_ScriptDir%\NEO_nTray.ini, App_Locations, Port_Viewer
IniRead, Network_Icons_Use_Default, %A_ScriptDir%\NEO_nTray.ini, Network, Network_Icons_Use_Default
IniRead, Network_Icons_Custom_1, %A_ScriptDir%\NEO_nTray.ini, Network, Network_Icons_Custom_1
IniRead, Network_Icons_Custom_2, %A_ScriptDir%\NEO_nTray.ini, Network, Network_Icons_Custom_2
IniRead, Network_Icons_Custom_3, %A_ScriptDir%\NEO_nTray.ini, Network, Network_Icons_Custom_3
IniRead, Network_Icons_Custom_4, %A_ScriptDir%\NEO_nTray.ini, Network, Network_Icons_Custom_4
IniRead, Network_Icons_Custom_5, %A_ScriptDir%\NEO_nTray.ini, Network, Network_Icons_Custom_5
IniRead, Network_Use_Keyboard_Leds, %A_ScriptDir%\NEO_nTray.ini, Network, Network_Use_Keyboard_Leds
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Main Menu
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Main_Menu:
Menu, Menu_Settings_Tray_Icon, add, Default, Set_Tray_Icons_Default
Menu, Menu_Settings_Tray_Icon, add, Custom, Set_Tray_Icons_Custom
Menu, Menu_Settings, add, Tray Icon, :Menu_Settings_Tray_Icon
Menu, Menu_Settings, Icon, Tray Icon, shell32.dll, 303 ;not good in win2k3
Menu, Menu_Settings_Keyboard_Leds, add, Disable, Set_Network_Use_Keyboard_Leds_Disable
Menu, Menu_Settings_Keyboard_Leds, add, Enable, Set_Network_Use_Keyboard_Leds_Enable
Menu, Menu_Settings, add, Keyboard LEDs, :Menu_Settings_Keyboard_Leds
Menu, Menu_Settings, Icon, Keyboard LEDs, main.cpl, 6
Menu, Menu_Settings, add
Menu, Menu_Settings_QuickLaunch_Mod, add, Disable, Set_QuickLaunch_Mod_Disable
Menu, Menu_Settings_QuickLaunch_Mod, add, Enable, Set_QuickLaunch_Mod_Enable
Menu, Menu_Settings, add, QuickLaunch Mod, :Menu_Settings_QuickLaunch_Mod
Menu, Menu_Settings, Icon, QuickLaunch Mod, shell32.dll, 40
Menu, Menu_Settings_Aero_Peek, add, Disable, Set_Aero_Peek_Disable
Menu, Menu_Settings_Aero_Peek, add, Enable, Set_Aero_Peek_Enable
Menu, Menu_Settings, add, Aero Peek, :Menu_Settings_Aero_Peek
Menu, Menu_Settings, Icon, Aero Peek, shell32.dll, 40
Menu, Menu_Settings, add, Win7 Taskbar Mod, Win7_Taskbar_Mod
Menu, Menu_Settings, Icon, Win7 Taskbar Mod, shell32.dll, 40
Menu, Menu_Settings, add
;I woud prefer to have ahk's built in help function right here, but I can't figuer out the code for it
Menu, User_Timer_QSR, add, Min, Set_User_Timer_QSR_Min
Menu, User_Timer_QSR, Icon, Min, shell32.dll, 13
Menu, User_Timer_QSR, add, Max, Set_User_Timer_QSR_Max
Menu, User_Timer_QSR, Icon, Max, shell32.dll, 13
Menu, User_Timer_QSR, add, 0.5 ms, Set_User_Timer_QSR_05
Menu, User_Timer_QSR, Icon, 0.5 ms, shell32.dll, 13
Menu, User_Timer_QSR, add, 1 ms, Set_User_Timer_QSR_1
Menu, User_Timer_QSR, Icon, 1 ms, shell32.dll, 13
Menu, User_Timer_QSR, add, 10 ms, Set_User_Timer_QSR_10
Menu, User_Timer_QSR, Icon, 10 ms, shell32.dll, 13
Menu, User_Timer_QSR, add, 15.6 ms, Set_User_Timer_QSR_156
Menu, User_Timer_QSR, Icon, 15.6 ms, shell32.dll, 13
Menu, Menu_Settings, add, User Timer QSR Max, :User_Timer_QSR
Menu, Menu_Settings, Icon, User Timer QSR Max, shell32.dll, 13
Menu, Menu_Settings_Dev, add, Edit Script, Edit ;This should only be valid in script form, not in compiled form, I need to figuer that out...
Menu, Menu_Settings_Dev, Icon, Edit Script, shell32.dll, 71
Menu, Menu_Settings, add, Dev, :Menu_Settings_Dev
Menu, Menu_Settings, Icon, Dev, shell32.dll, 161
Menu, Tray, add, Port Viewer, Port_View
Menu, Tray, Icon, Port Viewer, shell32.dll, 172
Menu, Tray, add, Log Viewer, Log_View
Menu, Tray, Icon, Log Viewer, shell32.dll, 172
Menu, Tray, add, Abort Connections, Abort_Connections
Menu, Tray, Icon, Abort Connections, shell32.dll, 172
Menu, Tray, add, Change IP, Change_IP
Menu, Tray, Icon, Change IP, shell32.dll, 19
if Network_Icons_Use_Default = Enable
{
Menu, Tray, add, Disconnect, Disconnect
Menu, Tray, Icon, Disconnect, netshell.dll, 71, 1 ;Disconnected
}
else
{
Menu, Tray, add, Disconnect, Disconnect
Menu, Tray, Icon, Disconnect, %Network_Icons_Custom_5%
}
if Network_Icons_Use_Default = Enable
{
Menu, Tray, add, Connect, Connect
Menu, Tray, Icon, Connect, netshell.dll, 69, 1 ;193, 0dn 0up
}
else
{
Menu, Tray, add, Connect, Connect
Menu, Tray, Icon, Connect, %Network_Icons_Custom_1%
}
Menu, Tray, add, Network Connections, Network_Connections
Menu, Tray, Icon, Network Connections, shell32.dll, 89
Menu, Tray, add
Menu, Tray, Add, Settings, :Menu_Settings
Menu, Tray, Icon, Settings, shell32.dll, 13
Menu, Tray, add
Menu, Tray, add, Reload, Reload
Menu, Tray, Icon, Reload, shell32.dll, 239
Menu, Tray, add, Pause, Pause ;This needs a better pause icon, and needs a play icon or whatever once paused
Menu, Tray, Icon, Pause, shell32.dll, 110
Menu, Tray, add
Menu, Tray, add, Exit, Exit
Menu, Tray, Icon, Exit, shell32.dll, 28
Menu, Tray, Click, 1 ;Change from double left click to single left click
Menu, Tray, Default, Port Viewer ;Default Entry to run on double click
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Main_Menu_Cfg
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Main_Menu_Cfg:
if Network_Icons_Use_Default = Enable
{
Menu, Menu_Settings_Tray_Icon, Icon, Default, shell32.dll, 145
Menu, Menu_Settings_Tray_Icon, Icon, Custom, shell32.dll, 132
}
if Network_Icons_Use_Default = Disable
{
Menu, Menu_Settings_Tray_Icon, Icon, Default, shell32.dll, 132
Menu, Menu_Settings_Tray_Icon, Icon, Custom, shell32.dll, 145
}
if Network_Use_Keyboard_Leds = Enable
{
Menu, Menu_Settings_Keyboard_Leds, Icon, Disable, shell32.dll, 132
Menu, Menu_Settings_Keyboard_Leds, Icon, Enable, shell32.dll, 145
}
if Network_Use_Keyboard_Leds = Disable
{
Menu, Menu_Settings_Keyboard_Leds, Icon, Disable, shell32.dll, 145
Menu, Menu_Settings_Keyboard_Leds, Icon, Enable, shell32.dll, 132
}
if QuickLaunch_Mod = Disable
{
Menu, Menu_Settings_QuickLaunch_Mod, Icon, Disable, shell32.dll, 145
Menu, Menu_Settings_QuickLaunch_Mod, Icon, Enable, shell32.dll, 132
}
if QuickLaunch_Mod = Enable
{
Menu, Menu_Settings_QuickLaunch_Mod, Icon, Disable, shell32.dll, 132
Menu, Menu_Settings_QuickLaunch_Mod, Icon, Enable, shell32.dll, 145
}
if Aero_Peek = Disable
{
Menu, Menu_Settings_Aero_Peek, Icon, Disable, shell32.dll, 145
Menu, Menu_Settings_Aero_Peek, Icon, Enable, shell32.dll, 132
}
if Aero_Peek = Enable
{
Menu, Menu_Settings_Aero_Peek, Icon, Disable, shell32.dll, 132
Menu, Menu_Settings_Aero_Peek, Icon, Enable, shell32.dll, 145
}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Network_Monitor
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Network_Monitor:
;Code Timer for Debugging...
;DllCall("QueryPerformanceCounter", "Int64*", CounterBefore) ;External Var, CPU Tick Timer
;Needs null check too...
if (IP_Address = "127.0.0.1" || IP_Address = "0.0.0.0")
{
if Network_Icons_Use_Default = Enable
{
Menu, Tray, Icon, netshell.dll, 71, 1 ;Disconnected
}
else
{
Menu, Tray, Icon, %Network_Icons_Custom_5%
}
if Network_Use_Keyboard_Leds = Enable
{
GetKeyState, KeyState, ScrollLock, T
if KeyState = U
{
KeyboardLED(1, "Off")
}
GetKeyState, KeyState, CapsLock, T
if KeyState = U
{
KeyboardLED(4, "Off")
}
GetKeyState, KeyState, NumLock, T
if KeyState = U
{
KeyboardLED(2, "Off")
}
}
return
}
Download_Rate_New = 0
Upload_Rate_New = 0
GetIfTable(tb)
;notes:
; Return *ptr | *++ptr << 8 | *++ptr << 16 | *++ptr << 24
;typedef struct _MIB_IFROW {
; WCHAR wszName[MAX_INTERFACE_NAME_LEN];
; DWORD dwIndex;
; DWORD dwType;
; DWORD dwMtu;
; DWORD dwSpeed;
; DWORD dwPhysAddrLen;
; BYTE bPhysAddr[MAXLEN_PHYSADDR];
; DWORD dwAdminStatus;
; DWORD dwOperStatus;
; DWORD dwLastChange;
; DWORD dwInOctets; 552?
; DWORD dwInUcastPkts; 556?
; DWORD dwInNUcastPkts; 560?
; DWORD dwInDiscards; 564?
; DWORD dwInErrors; 568?
; DWORD dwInUnknownProtos; 572?
; DWORD dwOutOctets; 576?
; DWORD dwOutUcastPkts;
; DWORD dwOutNUcastPkts;
; DWORD dwOutDiscards;
; DWORD dwOutErrors;
; DWORD dwOutQLen;
; DWORD dwDescrLen;
; BYTE bDescr[MAXLEN_IFDESCR];
;} MIB_IFROW, *PMIB_IFROW;
;;Include this codes to exclude the loopback interface.
;;If DecodeInteger(&tb + 4 + 860 * (A_Index - 1) + 516) = 24
;;Continue
Loop, % DecodeInteger(&tb)
{
Download_Rate_New += DecodeInteger(&tb + 4 + 860 * (A_Index - 1) + 552) ;Total Incoming Octets
Upload_Rate_New += DecodeInteger(&tb + 4 + 860 * (A_Index - 1) + 576) ;Total Outgoing Octets
}
;Needs odd colon char thingy to work...
Download_Rate := Round(((Download_Rate_New - Download_Rate_Old) / 48), 1) ;Download rate calculation
Upload_Rate := Round(((Upload_Rate_New - Upload_Rate_Old) / 48), 1) ;Upload rate calculation
;Offline Testing...
;if DL_Old = %Download_Rate%
;{
; Download_Rate := Round((120.5 / 1024), 1)
;}
;if UP_Old = %Upload_Rate%
;{
; Upload_Rate := Round((120.5 / 1024), 1)
;}
;DL_Old = %Download_Rate%
;UP_Old = %Upload_Rate%
;Needs odd syntax
;Needs a few microsecs of latency before lighting up the keyboard leds
if (Download_Rate = 0 && Upload_Rate = 0)
{
if Network_Icons_Use_Default = Enable
{
Menu, Tray, Icon, netshell.dll, 69, 1 ;193, 0dn 0up
}
else
{
Menu, Tray, Icon, %Network_Icons_Custom_1%
}
if Network_Use_Keyboard_Leds = Enable
{
KeyboardLED(4, "Off")
Sleep, 1
KeyboardLED(1, "Off")
}
}
if (Download_Rate > 0 && Upload_Rate = 0)
{
if Network_Icons_Use_Default = Enable
{
Menu, Tray, Icon, netshell.dll, 68, 1 ;192, +dn 0up
}
else
{
Menu, Tray, Icon, %Network_Icons_Custom_2%
}
if Network_Use_Keyboard_Leds = Enable
{
KeyboardLED(4, "Off")
Sleep, 1
KeyboardLED(1, "On")
}
}
if (Download_Rate = 0 && Upload_Rate > 0)
{
if Network_Icons_Use_Default = Enable
{
Menu, Tray, Icon, netshell.dll, 67, 1 ;191, 0dn +up
}
else
{
Menu, Tray, Icon, %Network_Icons_Custom_3%
}
if Network_Use_Keyboard_Leds = Enable
{
Sleep, 1
KeyboardLED(1, "Off")
KeyboardLED(4, "On")
}
}
if (Download_Rate > 0 && Upload_Rate > 0)
{
if Network_Icons_Use_Default = Enable
{
Menu, Tray, Icon, netshell.dll, 66, 1 ;190, +dn +up
}
else
{
Menu, Tray, Icon, %Network_Icons_Custom_4%
}
if Network_Use_Keyboard_Leds = Enable
{
KeyboardLED(4, "On")
Sleep, 1
KeyboardLED(1, "On")
}
}
;Needs odd colon char to work...
Downloaded_Total := Round(Download_Rate_New / 48)
Uploaded_Total := Round(Upload_Rate_New / 48)
Download_Rate_Old = %Download_Rate_New%
Upload_Rate_Old = %Upload_Rate_New%
;DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
;ElapsedTime_pc := (CounterAfter - CounterBefore)
;ToolTip, Network_Monitor:`n%ElapsedTime_pc% Ticks`n%ElapsedTime_ms% ms, 0, 0
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; QuickLaunch_Mod
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
QuickLaunch_Mod:
Mouse_State_LButton_Old = %Mouse_State_LButton%
MouseGetPos,,,, Win32_Control
GetKeyState, Mouse_State_LButton, LButton
;small issue with timing and mod, if I was previously over the toolbar and now on the taskbar with the same toolbar name, it takes a little while to reg to get rid of the ctrl key
;issue with mod to taskbar part, new
;after windows is already open it continues to use the ctrl mod, which doesn't work to well afterwards
if A_OSVersion = WIN_7
{
if ((Win32_Control = "ToolbarWindow323") && Mouse_State_LButton = "D")
; if ((Win32_Control = "ToolbarWindow323") && Mouse_State_LButton = "D" || (Win32_Control = "MSTaskListWClass1") && Mouse_State_LButton = "D")
{
Send, {Control down}
}
else if (Mouse_State_LButton_Old = "D" && Mouse_State_LButton = "U") ;cheap hack
{
Send, {Control up}
}
}
else if A_OSVersion = WIN_2003
{
if ((Win32_Control = "ToolbarWindow323") && Mouse_State_LButton = "D")
; if ((Win32_Control = "ToolbarWindow322") && Mouse_State_LButton = "D" || (Win32_Control = "ToolbarWindow323") && Mouse_State_LButton = "D")
{
Send, {Control down}
}
else if (Mouse_State_LButton_Old = "D" && Mouse_State_LButton = "U") ;cheap hack
{
Send, {Control up}
}
}
;324...
;323 is the issue on win2k3 slim, taskbar becomes the other toolbar.
;323 is the one that works in win7
;322 is the one that works in win2k3
;MSTaskListWClass1 = taskbar
;I can either scan for the os or I can patch it out correctly
;1st one is the issue
;ToolbarWindow322 Win2k3 single col
;causes issues on win2k3, crtl gets stuck on the taskbar
;ToolbarWindow323 Win7 double col
;This code needs work, works great in win7, but it needs to be worked on in xp and win2k3
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Port_View
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Port_View:
;MsgBox, %Port_Viewer%
Run %Port_Viewer%
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Log_View
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Log_View:
;MsgBox, %Log_Viewer%
;Run %Log_Viewer%
;Proxomitron Log Window
PostMessage, 0x111, 0x3F5, 0,, ahk_class PrxTronCls
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Abort_Connections
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Abort_Connections:
;Proxomitron Abort Connections
PostMessage, 0x111, 0x3F0, 0,, ahk_class PrxTronCls
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Network_Connections
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Network_Connections:
;check to see if netman is enabled via reg, if so then don't run the special code below.
;If it is disabled at runtime, then run the special code below
;Would like to see a sub menu with net connections...
;Big prob, the thign creates a new proccess which I can't seem to track yet.
;So my script stops the netman service before exiting, or it keeps it in mem, both are not cool
;RunWait %ComSpec% /C "sc config netman start= demand",, Hide
;RunWait %ComSpec% /C "net start netman",, Hide
Run ::{7007acc7-3202-11d1-aad2-00805fc1270e},,, Win32_PID
;WinWaitClose ahk_pid %Win32_PID% ;Doesn't actually work...
;RunWait %ComSpec% /C "net stop netman",, Hide
;RunWait %ComSpec% /C "sc config netman start= disabled",, Hide
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Change_IP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Change_IP:
;issue here if ip was originally null
if (IP_Address = "127.0.0.1" || IP_Address = "0.0.0.0")
{
return
}
IP_Old = %IP_Address%
Download_Rate_New = 0
Upload_Rate_New = 0
Download_Rate_Old = 0
Upload_Rate_Old = 0
Downloaded_Total = 0
Uploaded_Total = 0
TrayTip, NEO_nTray, Changing IP...,, 16
Menu, Tray, Tip, Changing IP...
IP_Change = 1 ;cludge for multi threading
if Network_Icons_Use_Default = Enable
{
Menu, Tray, Icon, netshell.dll, 71, 1 ;Disconnected
}
else
{
Menu, Tray, Icon, %Network_Icons_Custom_5%
}
if Network_Use_Keyboard_Leds = Enable
{
GetKeyState, KeyState, ScrollLock, T
if KeyState = U
{
KeyboardLED(1, "Off")
}
GetKeyState, KeyState, CapsLock, T
if KeyState = U
{
KeyboardLED(4, "Off")
}
GetKeyState, KeyState, NumLock, T
if KeyState = U
{
KeyboardLED(2, "Off")
}
}
IP_Change_Count = 0
While (A_IPAddress1 = IP_OLD)
{
IP_Change_Count += 1
if IP_Change_Count = 10
{
TrayTip, NEO_nTray, I tried to change your IP but after %IP_Change_Count% attempts I gave up...,, 16
Sleep 3000 ;Give the user 3 secs to read the msg...
Reload
return
}
else
{
RunWait %ComSpec% /C "IPCONFIG /RELEASE",, Hide
Sleep (1000 * %IP_Change_Count%) ;increase idle by 1sec per loop
RunWait %ComSpec% /C "IPCONFIG /RENEW",, Hide
}
}
TrayTip, NEO_nTray, Old IP Address: %IP_Old%`nNew IP Address: %A_IPAddress1%,, 16
IP_Change = 0 ;Cludge for multi-threading
Sleep 3000 ;Give the user 3 secs to read the msg...
Reload ;Cludge for mem leak on A_IPAddress1, reload the whole darn program after getting a new ip, init should pick up the new ip
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Disconnect
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Disconnect:
RunWait %ComSpec% /C "IPCONFIG /RELEASE",, Hide
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Connect
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Connect:
RunWait %ComSpec% /C "IPCONFIG /RENEW",, Hide
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Init
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Init:
IP_Change = 0 ;cludge for multi threading
;Try to reduce the mem leak as much as possible, and only call this once on init and not in the main loop, it won't beable to auto detect the ip at any given time but it should be good enough
VarSetCapacity(IP_Address, 15, 0) ;Var mem limit
VarSetCapacity(A_IP_Address, 15, 0) ;Var mem limit
IP_Address = %A_IPAddress1%
;Hides the everything on the taskbar including it's self, but leaves the start button
;WinHide ahk_class Shell_TrayWnd
GoSub Read_Cfg
GoSub Main_Menu
GoSub Main_Menu_Cfg
if Aero_Peek = Enable
{
GoSub Set_Aero_Peek_Enable
}
else
{
GoSub Set_Aero_Peek_Disable
}
SysGet, Desktop_Width, 61
SysGet, Desktop_Height, 62
EnvSub, Desktop_Width, 2
EnvSub, Desktop_Height, 2
SysGet, Monitor_Width, 0
SysGet, Monitor_Height, 1
;User Timer Max Quantum Slice Resolution
;Quantum timer resolution
;DllCall("ntdll.dll\NtSetTimerResolution", UInt, 156000) ;15.600 ms
;DllCall("ntdll.dll\NtSetTimerResolution", UInt, 100000) ;10.000 ms
;DllCall("ntdll.dll\NtSetTimerResolution", UInt, 10000) ;1.000 ms
;DllCall("ntdll.dll\NtSetTimerResolution", UInt, 5000) ;0.500 ms
DllCall("ntdll.dll\NtSetTimerResolution", UInt, 1) ;Min
;Run "H:\Program Files\Proxomitron\Proxomitron-MOD.exe"
;Sleep, 250
;bypass
;PostMessage, 0x111, 0x3EF, 0,, ahk_class PrxTronCls
;Tray_Icon_hWnd = % TrayIcons()
;RemoveTrayIcon(Tray_Icon_hWnd, 1, 2)
;Reduce Mem Usage
Process, wait, AutoHotKey.exe ;Find the process
NewPID = %ErrorLevel% ;Save the PID
EmptyMem(NewPID)
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Edit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Edit:
Edit
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Reload
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Reload:
Reload
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Pause
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Pause:
Pause
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Exit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Exit:
if Network_Use_Keyboard_Leds = Enable
{
GetKeyState, KeyState, ScrollLock, T
if KeyState = U
{
KeyboardLED(1, "Off")
}
GetKeyState, KeyState, CapsLock, T
if KeyState = U
{
KeyboardLED(4, "Off")
}
GetKeyState, KeyState, NumLock, T
if KeyState = U
{
KeyboardLED(2, "Off")
}
}
ExitApp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Bookmarks