├── .gitattributes
├── .gitignore
├── CHANGELOG
├── LEDControl.sln
├── LEDControl
├── App.config
├── CbtHook.dll
├── CoreAudioApi.dll
├── Custom.Designer.cs
├── Custom.cs
├── Custom.resx
├── EmbeddedAssembly.cs
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── LEDControl.csproj
├── Microsoft.WindowsAPICodePack.dll
├── Microsoft.WindowsAPICodePack.xml
├── MsgBoxCheck.cs
├── OpenLibSys.cs
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ ├── IdleIcon.ico
│ ├── RWIcon.ico
│ ├── ReadIcon.ico
│ └── WriteIcon.ico
├── TVicPort_Cs.cs
├── Welcome.Designer.cs
├── Welcome.cs
├── Welcome.resx
├── WinRing0.dll
├── WinRing0.sys
├── WinRing0.vxd
├── WinRing0x64.dll
├── WinRing0x64.sys
├── WindowsHook.dll
├── packages.config
├── part1.txt
├── part2.txt
├── part3.txt
└── part4.txt
├── LICENSE
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | build/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 |
28 | # MSTest test Results
29 | [Tt]est[Rr]esult*/
30 | [Bb]uild[Ll]og.*
31 |
32 | # NUNIT
33 | *.VisualState.xml
34 | TestResult.xml
35 |
36 | # Build Results of an ATL Project
37 | [Dd]ebugPS/
38 | [Rr]eleasePS/
39 | dlldata.c
40 |
41 | # DNX
42 | project.lock.json
43 | artifacts/
44 |
45 | *_i.c
46 | *_p.c
47 | *_i.h
48 | *.ilk
49 | *.meta
50 | *.obj
51 | *.pch
52 | *.pdb
53 | *.pgc
54 | *.pgd
55 | *.rsp
56 | *.sbr
57 | *.tlb
58 | *.tli
59 | *.tlh
60 | *.tmp
61 | *.tmp_proj
62 | *.log
63 | *.vspscc
64 | *.vssscc
65 | .builds
66 | *.pidb
67 | *.svclog
68 | *.scc
69 |
70 | # Chutzpah Test files
71 | _Chutzpah*
72 |
73 | # Visual C++ cache files
74 | ipch/
75 | *.aps
76 | *.ncb
77 | *.opensdf
78 | *.sdf
79 | *.cachefile
80 |
81 | # Visual Studio profiler
82 | *.psess
83 | *.vsp
84 | *.vspx
85 |
86 | # TFS 2012 Local Workspace
87 | $tf/
88 |
89 | # Guidance Automation Toolkit
90 | *.gpState
91 |
92 | # ReSharper is a .NET coding add-in
93 | _ReSharper*/
94 | *.[Rr]e[Ss]harper
95 | *.DotSettings.user
96 |
97 | # JustCode is a .NET coding add-in
98 | .JustCode
99 |
100 | # TeamCity is a build add-in
101 | _TeamCity*
102 |
103 | # DotCover is a Code Coverage Tool
104 | *.dotCover
105 |
106 | # NCrunch
107 | _NCrunch_*
108 | .*crunch*.local.xml
109 |
110 | # MightyMoose
111 | *.mm.*
112 | AutoTest.Net/
113 |
114 | # Web workbench (sass)
115 | .sass-cache/
116 |
117 | # Installshield output folder
118 | [Ee]xpress/
119 |
120 | # DocProject is a documentation generator add-in
121 | DocProject/buildhelp/
122 | DocProject/Help/*.HxT
123 | DocProject/Help/*.HxC
124 | DocProject/Help/*.hhc
125 | DocProject/Help/*.hhk
126 | DocProject/Help/*.hhp
127 | DocProject/Help/Html2
128 | DocProject/Help/html
129 |
130 | # Click-Once directory
131 | publish/
132 |
133 | # Publish Web Output
134 | *.[Pp]ublish.xml
135 | *.azurePubxml
136 | ## TODO: Comment the next line if you want to checkin your
137 | ## web deploy settings but do note that will include unencrypted
138 | ## passwords
139 | #*.pubxml
140 |
141 | *.publishproj
142 |
143 | # NuGet Packages
144 | *.nupkg
145 | # The packages folder can be ignored because of Package Restore
146 | **/packages/*
147 | # except build/, which is used as an MSBuild target.
148 | !**/packages/build/
149 | # Uncomment if necessary however generally it will be regenerated when needed
150 | #!**/packages/repositories.config
151 |
152 | # Windows Azure Build Output
153 | csx/
154 | *.build.csdef
155 |
156 | # Windows Store app package directory
157 | AppPackages/
158 |
159 | # Visual Studio cache files
160 | # files ending in .cache can be ignored
161 | *.[Cc]ache
162 | # but keep track of directories ending in .cache
163 | !*.[Cc]ache/
164 |
165 | # Others
166 | ClientBin/
167 | [Ss]tyle[Cc]op.*
168 | ~$*
169 | *~
170 | *.dbmdl
171 | *.dbproj.schemaview
172 | *.pfx
173 | *.publishsettings
174 | node_modules/
175 | orleans.codegen.cs
176 |
177 | # RIA/Silverlight projects
178 | Generated_Code/
179 |
180 | # Backup & report files from converting an old project file
181 | # to a newer Visual Studio version. Backup files are not needed,
182 | # because we have git ;-)
183 | _UpgradeReport_Files/
184 | Backup*/
185 | UpgradeLog*.XML
186 | UpgradeLog*.htm
187 |
188 | # SQL Server files
189 | *.mdf
190 | *.ldf
191 |
192 | # Business Intelligence projects
193 | *.rdl.data
194 | *.bim.layout
195 | *.bim_*.settings
196 |
197 | # Microsoft Fakes
198 | FakesAssemblies/
199 |
200 | # Node.js Tools for Visual Studio
201 | .ntvs_analysis.dat
202 |
203 | # Visual Studio 6 build log
204 | *.plg
205 |
206 | # Visual Studio 6 workspace options file
207 | *.opt
208 |
209 | # LightSwitch generated files
210 | GeneratedArtifacts/
211 | _Pvt_Extensions/
212 | ModelManifest.xml
213 |
--------------------------------------------------------------------------------
/CHANGELOG:
--------------------------------------------------------------------------------
1 | 1.1.0.0 (11/3/2016)
2 | -------------------
3 |
4 | Adds support for monitoring changes to Caps Lock key, and toggle LEDs as
5 | answer.
6 |
7 | 1.2.0.0 (12/3/2016)
8 | -------------------
9 |
10 | Improves the way the key changes are detected - now, if the application is run
11 | as administrator, the detection will be instantaneous and virtually zero
12 | taxing on the CPU; if run normally, the new mechanism will work only for apps
13 | that run with the same privileges as this application - for apps run as
14 | administrator, the old mechanism (with the delay) will be applied. thus, the
15 | delay does nothing if the app is run as admin, can be set to any value, and the
16 | same effect is achieved.
17 |
18 | Added option to set delay between the disk drives are checked for activity,
19 | previously, this was hard coded to 1 ms.
20 |
21 | Added option to disable key monitoring altogether, alongside the existing
22 | option to disable disk activity monitoring.
23 |
24 | Added option to have the launch automatically run at startup in the same
25 | context the app is already in (for e.g., if the app was run as administrator,
26 | next time you start the system up, the app will run as administrator, without
27 | UAC prompt).
28 |
29 | Added posibility of monitoring the NumLock key as well, besides the existing
30 | Caps Lock option.
31 |
32 | Added new information about resources used, and version info, in the About
33 | screen.
34 |
35 | Added several new explanaitions for the features offered via the '?' buttons.
36 |
37 | 1.3.0.0 (8/4/2016)
38 | ------------------
39 |
40 | Added page which lets you write any LED ID and status number, and write that
41 | to EC (this way, you can test different numbers for the LEDs on your ThinkPad,
42 | and report back which numbers correspond to which lights) - write just one
43 | byte of data, in hex, so valid numbers there are from 00 to FF (0 to 255 in
44 | decimal). Skip the 0x in front of the hexadecimal number when writing in
45 | those fields. There is a "+1" button which will increment the number in the
46 | text field automatically - please use this to test for new LED IDs, and report
47 | back which numbers correspond to which LEDs; I discovered 2 new LEDs, 0x08,
48 | and 0x09, but I don't know which lights these actualy correspond to yet.
49 |
50 | Added code to update LED status when the computer wakes up from a low power
51 | state (like sleep, or hibernation, and the status of the LEDs does not
52 | correspond to the condition of a monitored asset - for example, if you put your
53 | computer to sleep, Caps Lock being off and have the app show the status of Caps
54 | Lock on the power button, it will now turn off the button when waking up from
55 | sleep, as it is changed by the BIOS to on at wake up.
56 |
57 | 1.4.0.0 (4/6/2016)
58 | ------------------
59 |
60 | Added ability to toggle Fn Lock LED, from the UI, using command line switches,
61 | and to assign actions to it.
62 |
63 | Added option to remember keybaord illumination after restart, sleep, shutdown
64 | and power on cycles.
65 |
66 | Added option to turn off keyboard lights when applications go full screen
67 | (ideal for watching movies) - n.b. it does not turn off LEDs assigned to HDD
68 | activity.
69 |
70 | Added option to invert light status (negative feedback - instead of turning on
71 | the light based on an event, turn it off, and vice versa).
72 |
73 | Added option to set offset when debugging LEDs - basically said option now
74 | allows writting of values everywhere in the EC - DO NOT ABUSE THIS OPTION,
75 | NOT ONLY CAN IT HAVE ADVERSE EFFECTS (LIKE ACCIDENTALY DISABLING THE FAN OF
76 | THE LAPTOP FOR E.G.), BUT THE COMPUTER MAY ALSO CRASH (TURNS OFF INSTANTLY,
77 | NO BSOD OR ELSE) IF THE EC IS SPAMMED - USE AT OWN RISK.
78 |
79 | 1.5.0.0 (5/6/2016)
80 | ------------------
81 |
82 | The app is now portable (Made CoreAudioApi.dll and
83 | Microsoft.WindowsAPICodePack.dll an embedded resource which is loaded at run
84 | time, rather than separate DLLs).
85 |
86 | The application now runs even if disk activity cannot be measured, disabling
87 | the disk activity monitoring features.
88 |
89 | Changed code that could cause a memory leak.
90 |
91 | Solved a bug that prevented the restoration of keyboard illumination after
92 | sleep or when the workstation was locked and the Windows lock screen was
93 | displayed in Windows 10.
94 |
95 | 1.6.0.1 (13/6/2016)
96 | -------------------
97 |
98 | The application now supports 2 drivers for communicating with the EC: WinRing0
99 | (default, recommended), and TVicPort (legacy) - by requiring all applications
100 | that make use of its features to be run as administrator, WinRing0 is the
101 | secure choice, but requires the app to be run as admin at all times; TVicPort
102 | can lead to some serious security issues, but being used by TPFanControl as
103 | well, it could be a handy choice - Personally, I would recommend you to use
104 | WinRing0, unless you need the app running without administartive privileges
105 | for whatever reason (you still need admin to install TVicPort tho, so it won't
106 | be of use on corporate computers, if that is what you were thinking...).
107 |
108 | Added new command line arguments, check source code for more info, or ask here.
109 |
110 | Added an option to pick up the driver, after the initial setup, from the main
111 | UX.
112 |
113 | Fixed a bug that could prevent the app from launching silently at startup,
114 | using the Task Scheduler, or by other means.
115 |
116 | Fixed a bug that requested the user to pick the default driver again, after
117 | an application update.
118 |
119 | 1.6.0.2 (15/6/2016)
120 | -------------------
121 |
122 | Fixed grammar in some text messages
123 |
124 | Added code to handle the situation when disk performance counters are disabled
125 | on the machine the application runs on. The user is given instructions on how
126 | to enable them in order to get HDD activity, and the application asks whether
127 | it should try to fix this issue automatically, at startup. The message can be
128 | dismissed, and set to not display again until the next time the issue is
129 | detected.
130 |
131 | Added more information to certain '?' explanations in the main window.
132 |
133 | Added code to deactivate EC driver on application exit.
134 |
135 | 1.6.0.3 (15/6/2016)
136 | -------------------
137 |
138 | Added code to avoid the application displaying the 'LEDControl.exe has stopped
139 | working' message when relaunching after picking up a new driver for use from
140 | the 'Choose driver' section of the main window.
141 |
142 | When opened, the Welcome wizard selects the currently used driver in the drop
143 | down list, except when the dialog is shown at startup, at first run, or by
144 | holding the SHIFT key, in order to be easier for the user to make the safest
145 | choice.
146 |
147 | Added code to better handle the application closing from all the relevant
148 | entry points possible.
149 |
150 | 1.6.0.4 (20/8/2016)
151 | -------------------
152 |
153 | Fixed a bug that prevented keyboard illuminaton auto switch off when going
154 | full screen from working if the setting to remember the keyboard illumination
155 | level after power events was set to off.
156 |
157 | Fixed a bug that caused the keyboard illumination to turn off if the foreground
158 | window was the desktop, and the setting to automatically turn off keyboard
159 | illumination when going full screen was on.
160 |
161 | 1.6.0.5 (11/9/2016)
162 | -------------------
163 |
164 | Keyboard illumination level persists, if the option to remember keyboard light
165 | level is set in the main UI of the app, after the lid is closed and then opened
166 | again, and "Do nothing" is set as the action to perform when closing the lid in
167 | Windows power plan settings (thanks to bug report by Mavi_No1).
168 |
--------------------------------------------------------------------------------
/LEDControl.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LEDControl", "LEDControl\LEDControl.csproj", "{C3AB624F-5637-42C4-9E84-55405F14AE80}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x86 = Debug|x86
12 | Release|Any CPU = Release|Any CPU
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {C3AB624F-5637-42C4-9E84-55405F14AE80}.Debug|Any CPU.ActiveCfg = Debug|x86
17 | {C3AB624F-5637-42C4-9E84-55405F14AE80}.Debug|Any CPU.Build.0 = Debug|x86
18 | {C3AB624F-5637-42C4-9E84-55405F14AE80}.Debug|x86.ActiveCfg = Debug|x86
19 | {C3AB624F-5637-42C4-9E84-55405F14AE80}.Debug|x86.Build.0 = Debug|x86
20 | {C3AB624F-5637-42C4-9E84-55405F14AE80}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {C3AB624F-5637-42C4-9E84-55405F14AE80}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {C3AB624F-5637-42C4-9E84-55405F14AE80}.Release|x86.ActiveCfg = Release|x86
23 | {C3AB624F-5637-42C4-9E84-55405F14AE80}.Release|x86.Build.0 = Release|x86
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/LEDControl/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | True
15 |
16 |
17 | True
18 |
19 |
20 | False
21 |
22 |
23 | False
24 |
25 |
26 | False
27 |
28 |
29 | False
30 |
31 |
32 | False
33 |
34 |
35 | False
36 |
37 |
38 | False
39 |
40 |
41 | False
42 |
43 |
44 | False
45 |
46 |
47 | False
48 |
49 |
50 | 100
51 |
52 |
53 | False
54 |
55 |
56 | 1
57 |
58 |
59 | False
60 |
61 |
62 | False
63 |
64 |
65 | False
66 |
67 |
68 | False
69 |
70 |
71 | False
72 |
73 |
74 | 0
75 |
76 |
77 | True
78 |
79 |
80 | False
81 |
82 |
83 | False
84 |
85 |
86 | False
87 |
88 |
89 | False
90 |
91 |
92 | False
93 |
94 |
95 | False
96 |
97 |
98 | False
99 |
100 |
101 | False
102 |
103 |
104 | False
105 |
106 |
107 | True
108 |
109 |
110 | 0
111 |
112 |
113 | True
114 |
115 |
116 | False
117 |
118 |
119 |
120 |
--------------------------------------------------------------------------------
/LEDControl/CbtHook.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/CbtHook.dll
--------------------------------------------------------------------------------
/LEDControl/CoreAudioApi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/CoreAudioApi.dll
--------------------------------------------------------------------------------
/LEDControl/Custom.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace LEDControl
2 | {
3 | partial class Custom
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.textBox1 = new System.Windows.Forms.TextBox();
33 | this.label2 = new System.Windows.Forms.Label();
34 | this.textBox2 = new System.Windows.Forms.TextBox();
35 | this.label3 = new System.Windows.Forms.Label();
36 | this.button1 = new System.Windows.Forms.Button();
37 | this.button2 = new System.Windows.Forms.Button();
38 | this.label4 = new System.Windows.Forms.Label();
39 | this.label5 = new System.Windows.Forms.Label();
40 | this.label6 = new System.Windows.Forms.Label();
41 | this.textBox3 = new System.Windows.Forms.TextBox();
42 | this.label7 = new System.Windows.Forms.Label();
43 | this.SuspendLayout();
44 | //
45 | // label1
46 | //
47 | this.label1.AutoSize = true;
48 | this.label1.Location = new System.Drawing.Point(12, 16);
49 | this.label1.Name = "label1";
50 | this.label1.Size = new System.Drawing.Size(150, 17);
51 | this.label1.TabIndex = 0;
52 | this.label1.Text = "Control this LED by ID:";
53 | //
54 | // textBox1
55 | //
56 | this.textBox1.Location = new System.Drawing.Point(13, 46);
57 | this.textBox1.Name = "textBox1";
58 | this.textBox1.Size = new System.Drawing.Size(270, 22);
59 | this.textBox1.TabIndex = 1;
60 | this.textBox1.Text = "00";
61 | //
62 | // label2
63 | //
64 | this.label2.AutoSize = true;
65 | this.label2.Location = new System.Drawing.Point(10, 84);
66 | this.label2.Name = "label2";
67 | this.label2.Size = new System.Drawing.Size(157, 17);
68 | this.label2.TabIndex = 2;
69 | this.label2.Text = "Set the following status:";
70 | //
71 | // textBox2
72 | //
73 | this.textBox2.Location = new System.Drawing.Point(12, 116);
74 | this.textBox2.Name = "textBox2";
75 | this.textBox2.Size = new System.Drawing.Size(312, 22);
76 | this.textBox2.TabIndex = 3;
77 | this.textBox2.Text = "80";
78 | //
79 | // label3
80 | //
81 | this.label3.Location = new System.Drawing.Point(10, 141);
82 | this.label3.Name = "label3";
83 | this.label3.Size = new System.Drawing.Size(302, 44);
84 | this.label3.TabIndex = 4;
85 | this.label3.Text = "Common status values are: 00 - OFF, 80 - ON, C0 - BLINK.";
86 | //
87 | // button1
88 | //
89 | this.button1.Location = new System.Drawing.Point(168, 295);
90 | this.button1.Name = "button1";
91 | this.button1.Size = new System.Drawing.Size(75, 23);
92 | this.button1.TabIndex = 5;
93 | this.button1.Text = "&Set";
94 | this.button1.UseVisualStyleBackColor = true;
95 | this.button1.Click += new System.EventHandler(this.button1_Click);
96 | //
97 | // button2
98 | //
99 | this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
100 | this.button2.Location = new System.Drawing.Point(249, 295);
101 | this.button2.Name = "button2";
102 | this.button2.Size = new System.Drawing.Size(75, 23);
103 | this.button2.TabIndex = 6;
104 | this.button2.Text = "Close";
105 | this.button2.UseVisualStyleBackColor = true;
106 | this.button2.Click += new System.EventHandler(this.button2_Click);
107 | //
108 | // label4
109 | //
110 | this.label4.Location = new System.Drawing.Point(12, 329);
111 | this.label4.Name = "label4";
112 | this.label4.Size = new System.Drawing.Size(331, 63);
113 | this.label4.TabIndex = 7;
114 | this.label4.Text = "You will hear a system sound after the attempt to set the LED has been made, for " +
115 | "confirmation. Physically check your ThinkPad for outcome.";
116 | //
117 | // label5
118 | //
119 | this.label5.AutoSize = true;
120 | this.label5.Location = new System.Drawing.Point(293, 49);
121 | this.label5.Name = "label5";
122 | this.label5.Size = new System.Drawing.Size(24, 17);
123 | this.label5.TabIndex = 9;
124 | this.label5.Text = "+1";
125 | this.label5.Click += new System.EventHandler(this.label5_Click);
126 | //
127 | // label6
128 | //
129 | this.label6.Location = new System.Drawing.Point(9, 248);
130 | this.label6.Name = "label6";
131 | this.label6.Size = new System.Drawing.Size(302, 44);
132 | this.label6.TabIndex = 12;
133 | this.label6.Text = "Common offset values are: 0C - for LEDs, 0D - for keyboard backlight";
134 | //
135 | // textBox3
136 | //
137 | this.textBox3.Location = new System.Drawing.Point(11, 223);
138 | this.textBox3.Name = "textBox3";
139 | this.textBox3.Size = new System.Drawing.Size(312, 22);
140 | this.textBox3.TabIndex = 11;
141 | this.textBox3.Text = "0c";
142 | //
143 | // label7
144 | //
145 | this.label7.AutoSize = true;
146 | this.label7.Location = new System.Drawing.Point(9, 191);
147 | this.label7.Name = "label7";
148 | this.label7.Size = new System.Drawing.Size(50, 17);
149 | this.label7.TabIndex = 10;
150 | this.label7.Text = "Offset:";
151 | //
152 | // Custom
153 | //
154 | this.AcceptButton = this.button1;
155 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
156 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
157 | this.CancelButton = this.button2;
158 | this.ClientSize = new System.Drawing.Size(338, 392);
159 | this.Controls.Add(this.label6);
160 | this.Controls.Add(this.textBox3);
161 | this.Controls.Add(this.label7);
162 | this.Controls.Add(this.label5);
163 | this.Controls.Add(this.label4);
164 | this.Controls.Add(this.button2);
165 | this.Controls.Add(this.button1);
166 | this.Controls.Add(this.label3);
167 | this.Controls.Add(this.textBox2);
168 | this.Controls.Add(this.label2);
169 | this.Controls.Add(this.textBox1);
170 | this.Controls.Add(this.label1);
171 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
172 | this.MaximizeBox = false;
173 | this.MinimizeBox = false;
174 | this.Name = "Custom";
175 | this.ShowIcon = false;
176 | this.ShowInTaskbar = false;
177 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
178 | this.Text = "Debug LEDs";
179 | this.ResumeLayout(false);
180 | this.PerformLayout();
181 |
182 | }
183 |
184 | #endregion
185 |
186 | private System.Windows.Forms.Label label1;
187 | private System.Windows.Forms.Label label2;
188 | private System.Windows.Forms.Label label3;
189 | private System.Windows.Forms.Button button1;
190 | private System.Windows.Forms.Button button2;
191 | private System.Windows.Forms.Label label4;
192 | public System.Windows.Forms.TextBox textBox1;
193 | public System.Windows.Forms.TextBox textBox2;
194 | private System.Windows.Forms.Label label5;
195 | private System.Windows.Forms.Label label6;
196 | public System.Windows.Forms.TextBox textBox3;
197 | private System.Windows.Forms.Label label7;
198 | }
199 | }
--------------------------------------------------------------------------------
/LEDControl/Custom.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace LEDControl
12 | {
13 | public partial class Custom : Form
14 | {
15 | public Custom()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void button2_Click(object sender, EventArgs e)
21 | {
22 | this.DialogResult = DialogResult.Cancel;
23 | this.Close();
24 | }
25 |
26 | private void button1_Click(object sender, EventArgs e)
27 | {
28 | this.DialogResult = DialogResult.OK;
29 | this.Close();
30 | }
31 |
32 | private void button3_Click(object sender, EventArgs e)
33 | {
34 | }
35 |
36 | private void label5_Click(object sender, EventArgs e)
37 | {
38 | try
39 | {
40 | int decValue = int.Parse(textBox1.Text, System.Globalization.NumberStyles.HexNumber);
41 | if (decValue == 255) decValue = -1;
42 | decValue += 1;
43 | textBox1.Text = decValue.ToString("X");
44 | if (textBox1.Text.Length == 1) textBox1.Text = "0" + textBox1.Text;
45 | textBox1.SelectionStart = 2;
46 | }
47 | catch { }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/LEDControl/Custom.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/LEDControl/EmbeddedAssembly.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.IO;
5 | using System.Reflection;
6 | using System.Security.Cryptography;
7 |
8 | public class EmbeddedAssembly
9 | {
10 | // Version 1.3
11 |
12 | static Dictionary dic = null;
13 |
14 | public static void Load(string embeddedResource, string fileName)
15 | {
16 | if (dic == null)
17 | dic = new Dictionary();
18 |
19 | byte[] ba = null;
20 | Assembly asm = null;
21 | Assembly curAsm = Assembly.GetExecutingAssembly();
22 |
23 | using (Stream stm = curAsm.GetManifestResourceStream(embeddedResource))
24 | {
25 | // Either the file is not existed or it is not mark as embedded resource
26 | if (stm == null)
27 | throw new Exception(embeddedResource + " is not found in Embedded Resources.");
28 |
29 | // Get byte[] from the file from embedded resource
30 | ba = new byte[(int)stm.Length];
31 | stm.Read(ba, 0, (int)stm.Length);
32 | try
33 | {
34 | asm = Assembly.Load(ba);
35 |
36 | // Add the assembly/dll into dictionary
37 | dic.Add(asm.FullName, asm);
38 | return;
39 | }
40 | catch
41 | {
42 | // Purposely do nothing
43 | // Unmanaged dll or assembly cannot be loaded directly from byte[]
44 | // Let the process fall through for next part
45 | }
46 | }
47 |
48 | bool fileOk = false;
49 | string tempFile = "";
50 |
51 | using (SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider())
52 | {
53 | string fileHash = BitConverter.ToString(sha1.ComputeHash(ba)).Replace("-", string.Empty); ;
54 |
55 | tempFile = Path.GetTempPath() + fileName;
56 |
57 | if (File.Exists(tempFile))
58 | {
59 | byte[] bb = File.ReadAllBytes(tempFile);
60 | string fileHash2 = BitConverter.ToString(sha1.ComputeHash(bb)).Replace("-", string.Empty);
61 |
62 | if (fileHash == fileHash2)
63 | {
64 | fileOk = true;
65 | }
66 | else
67 | {
68 | fileOk = false;
69 | }
70 | }
71 | else
72 | {
73 | fileOk = false;
74 | }
75 | }
76 |
77 | if (!fileOk)
78 | {
79 | System.IO.File.WriteAllBytes(tempFile, ba);
80 | }
81 |
82 | asm = Assembly.LoadFile(tempFile);
83 |
84 | dic.Add(asm.FullName, asm);
85 | }
86 |
87 | public static Assembly Get(string assemblyFullName)
88 | {
89 | if (dic == null || dic.Count == 0)
90 | return null;
91 |
92 | if (dic.ContainsKey(assemblyFullName))
93 | return dic[assemblyFullName];
94 |
95 | return null;
96 | }
97 | }
--------------------------------------------------------------------------------
/LEDControl/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace LEDControl
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.powerOn = new System.Windows.Forms.Button();
33 | this.powerOff = new System.Windows.Forms.Button();
34 | this.label1 = new System.Windows.Forms.Label();
35 | this.powerBlink = new System.Windows.Forms.Button();
36 | this.label2 = new System.Windows.Forms.Label();
37 | this.dotBlink = new System.Windows.Forms.Button();
38 | this.dotOff = new System.Windows.Forms.Button();
39 | this.dotOn = new System.Windows.Forms.Button();
40 | this.microphoneBlink = new System.Windows.Forms.Button();
41 | this.microphoneOff = new System.Windows.Forms.Button();
42 | this.microphoneOn = new System.Windows.Forms.Button();
43 | this.sleepBlink = new System.Windows.Forms.Button();
44 | this.sleepOff = new System.Windows.Forms.Button();
45 | this.sleepOn = new System.Windows.Forms.Button();
46 | this.label3 = new System.Windows.Forms.Label();
47 | this.label4 = new System.Windows.Forms.Label();
48 | this.label5 = new System.Windows.Forms.Label();
49 | this.label6 = new System.Windows.Forms.Label();
50 | this.checkHDDReadPower = new System.Windows.Forms.CheckBox();
51 | this.checkHDDReadDot = new System.Windows.Forms.CheckBox();
52 | this.checkHDDReadMicrophone = new System.Windows.Forms.CheckBox();
53 | this.checkHDDReadSleep = new System.Windows.Forms.CheckBox();
54 | this.label7 = new System.Windows.Forms.Label();
55 | this.button1 = new System.Windows.Forms.Button();
56 | this.workerHDD = new System.ComponentModel.BackgroundWorker();
57 | this.NotifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
58 | this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
59 | this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
60 | this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
61 | this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
62 | this.checkHDDWriteSleep = new System.Windows.Forms.CheckBox();
63 | this.checkHDDWriteMicrophone = new System.Windows.Forms.CheckBox();
64 | this.checkHDDWriteDot = new System.Windows.Forms.CheckBox();
65 | this.checkHDDWritePower = new System.Windows.Forms.CheckBox();
66 | this.label8 = new System.Windows.Forms.Label();
67 | this.checkHDDSleep = new System.Windows.Forms.CheckBox();
68 | this.checkHDDMicrophone = new System.Windows.Forms.CheckBox();
69 | this.checkHDDDot = new System.Windows.Forms.CheckBox();
70 | this.checkHDDPower = new System.Windows.Forms.CheckBox();
71 | this.label9 = new System.Windows.Forms.Label();
72 | this.checkCLSleep = new System.Windows.Forms.CheckBox();
73 | this.checkCLMicrophone = new System.Windows.Forms.CheckBox();
74 | this.checkCLDot = new System.Windows.Forms.CheckBox();
75 | this.checkCLPower = new System.Windows.Forms.CheckBox();
76 | this.label10 = new System.Windows.Forms.Label();
77 | this.label11 = new System.Windows.Forms.Label();
78 | this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
79 | this.checkHDD = new System.Windows.Forms.CheckBox();
80 | this.button2 = new System.Windows.Forms.Button();
81 | this.button3 = new System.Windows.Forms.Button();
82 | this.button4 = new System.Windows.Forms.Button();
83 | this.button5 = new System.Windows.Forms.Button();
84 | this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
85 | this.label12 = new System.Windows.Forms.Label();
86 | this.checkNLSleep = new System.Windows.Forms.CheckBox();
87 | this.checkNLMicrophone = new System.Windows.Forms.CheckBox();
88 | this.checkNLDot = new System.Windows.Forms.CheckBox();
89 | this.checkNLPower = new System.Windows.Forms.CheckBox();
90 | this.label13 = new System.Windows.Forms.Label();
91 | this.checkBox5 = new System.Windows.Forms.CheckBox();
92 | this.button6 = new System.Windows.Forms.Button();
93 | this.timer1 = new System.Windows.Forms.Timer(this.components);
94 | this.button7 = new System.Windows.Forms.Button();
95 | this.button8 = new System.Windows.Forms.Button();
96 | this.rememberKBD = new System.Windows.Forms.CheckBox();
97 | this.lightTimer = new System.Windows.Forms.Timer(this.components);
98 | this.checkTurnKBLightOff = new System.Windows.Forms.CheckBox();
99 | this.label14 = new System.Windows.Forms.Label();
100 | this.button9 = new System.Windows.Forms.Button();
101 | this.button10 = new System.Windows.Forms.Button();
102 | this.button11 = new System.Windows.Forms.Button();
103 | this.checkHDDReadFn = new System.Windows.Forms.CheckBox();
104 | this.checkHDDWriteFn = new System.Windows.Forms.CheckBox();
105 | this.checkHDDFn = new System.Windows.Forms.CheckBox();
106 | this.checkCLFn = new System.Windows.Forms.CheckBox();
107 | this.checkNLFn = new System.Windows.Forms.CheckBox();
108 | this.checkInvertFn = new System.Windows.Forms.CheckBox();
109 | this.checkInvertSleep = new System.Windows.Forms.CheckBox();
110 | this.checkInvertMicrophone = new System.Windows.Forms.CheckBox();
111 | this.checkInvertDot = new System.Windows.Forms.CheckBox();
112 | this.checkInvertPower = new System.Windows.Forms.CheckBox();
113 | this.label15 = new System.Windows.Forms.Label();
114 | this.button12 = new System.Windows.Forms.Button();
115 | this.contextMenuStrip1.SuspendLayout();
116 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
117 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
118 | this.SuspendLayout();
119 | //
120 | // powerOn
121 | //
122 | this.powerOn.Location = new System.Drawing.Point(123, 10);
123 | this.powerOn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
124 | this.powerOn.Name = "powerOn";
125 | this.powerOn.Size = new System.Drawing.Size(100, 28);
126 | this.powerOn.TabIndex = 0;
127 | this.powerOn.Text = "ON";
128 | this.powerOn.UseVisualStyleBackColor = true;
129 | this.powerOn.Click += new System.EventHandler(this.powerOn_Click);
130 | //
131 | // powerOff
132 | //
133 | this.powerOff.Location = new System.Drawing.Point(231, 10);
134 | this.powerOff.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
135 | this.powerOff.Name = "powerOff";
136 | this.powerOff.Size = new System.Drawing.Size(100, 28);
137 | this.powerOff.TabIndex = 1;
138 | this.powerOff.Text = "OFF";
139 | this.powerOff.UseVisualStyleBackColor = true;
140 | this.powerOff.Click += new System.EventHandler(this.powerOff_Click);
141 | //
142 | // label1
143 | //
144 | this.label1.AutoSize = true;
145 | this.label1.Location = new System.Drawing.Point(17, 16);
146 | this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
147 | this.label1.Name = "label1";
148 | this.label1.Size = new System.Drawing.Size(95, 17);
149 | this.label1.TabIndex = 2;
150 | this.label1.Text = "Power button:";
151 | //
152 | // powerBlink
153 | //
154 | this.powerBlink.Location = new System.Drawing.Point(339, 10);
155 | this.powerBlink.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
156 | this.powerBlink.Name = "powerBlink";
157 | this.powerBlink.Size = new System.Drawing.Size(100, 28);
158 | this.powerBlink.TabIndex = 3;
159 | this.powerBlink.Text = "Third state";
160 | this.powerBlink.UseVisualStyleBackColor = true;
161 | this.powerBlink.Click += new System.EventHandler(this.powerBlink_Click);
162 | //
163 | // label2
164 | //
165 | this.label2.AutoSize = true;
166 | this.label2.Location = new System.Drawing.Point(17, 52);
167 | this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
168 | this.label2.Name = "label2";
169 | this.label2.Size = new System.Drawing.Size(64, 17);
170 | this.label2.TabIndex = 4;
171 | this.label2.Text = "Red Dot:";
172 | //
173 | // dotBlink
174 | //
175 | this.dotBlink.Location = new System.Drawing.Point(339, 46);
176 | this.dotBlink.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
177 | this.dotBlink.Name = "dotBlink";
178 | this.dotBlink.Size = new System.Drawing.Size(100, 28);
179 | this.dotBlink.TabIndex = 7;
180 | this.dotBlink.Text = "Third state";
181 | this.dotBlink.UseVisualStyleBackColor = true;
182 | this.dotBlink.Click += new System.EventHandler(this.dotBlink_Click);
183 | //
184 | // dotOff
185 | //
186 | this.dotOff.Location = new System.Drawing.Point(231, 46);
187 | this.dotOff.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
188 | this.dotOff.Name = "dotOff";
189 | this.dotOff.Size = new System.Drawing.Size(100, 28);
190 | this.dotOff.TabIndex = 6;
191 | this.dotOff.Text = "OFF";
192 | this.dotOff.UseVisualStyleBackColor = true;
193 | this.dotOff.Click += new System.EventHandler(this.dotOff_Click);
194 | //
195 | // dotOn
196 | //
197 | this.dotOn.Location = new System.Drawing.Point(123, 46);
198 | this.dotOn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
199 | this.dotOn.Name = "dotOn";
200 | this.dotOn.Size = new System.Drawing.Size(100, 28);
201 | this.dotOn.TabIndex = 5;
202 | this.dotOn.Text = "ON";
203 | this.dotOn.UseVisualStyleBackColor = true;
204 | this.dotOn.Click += new System.EventHandler(this.dotOn_Click);
205 | //
206 | // microphoneBlink
207 | //
208 | this.microphoneBlink.Location = new System.Drawing.Point(339, 81);
209 | this.microphoneBlink.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
210 | this.microphoneBlink.Name = "microphoneBlink";
211 | this.microphoneBlink.Size = new System.Drawing.Size(100, 28);
212 | this.microphoneBlink.TabIndex = 10;
213 | this.microphoneBlink.Text = "Third state";
214 | this.microphoneBlink.UseVisualStyleBackColor = true;
215 | this.microphoneBlink.Click += new System.EventHandler(this.microphoneBlink_Click);
216 | //
217 | // microphoneOff
218 | //
219 | this.microphoneOff.Location = new System.Drawing.Point(231, 81);
220 | this.microphoneOff.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
221 | this.microphoneOff.Name = "microphoneOff";
222 | this.microphoneOff.Size = new System.Drawing.Size(100, 28);
223 | this.microphoneOff.TabIndex = 9;
224 | this.microphoneOff.Text = "OFF";
225 | this.microphoneOff.UseVisualStyleBackColor = true;
226 | this.microphoneOff.Click += new System.EventHandler(this.microphoneOff_Click);
227 | //
228 | // microphoneOn
229 | //
230 | this.microphoneOn.Location = new System.Drawing.Point(123, 81);
231 | this.microphoneOn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
232 | this.microphoneOn.Name = "microphoneOn";
233 | this.microphoneOn.Size = new System.Drawing.Size(100, 28);
234 | this.microphoneOn.TabIndex = 8;
235 | this.microphoneOn.Text = "ON";
236 | this.microphoneOn.UseVisualStyleBackColor = true;
237 | this.microphoneOn.Click += new System.EventHandler(this.microphoneOn_Click);
238 | //
239 | // sleepBlink
240 | //
241 | this.sleepBlink.Location = new System.Drawing.Point(339, 117);
242 | this.sleepBlink.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
243 | this.sleepBlink.Name = "sleepBlink";
244 | this.sleepBlink.Size = new System.Drawing.Size(100, 28);
245 | this.sleepBlink.TabIndex = 13;
246 | this.sleepBlink.Text = "Third state";
247 | this.sleepBlink.UseVisualStyleBackColor = true;
248 | this.sleepBlink.Click += new System.EventHandler(this.sleepBlink_Click);
249 | //
250 | // sleepOff
251 | //
252 | this.sleepOff.Location = new System.Drawing.Point(231, 117);
253 | this.sleepOff.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
254 | this.sleepOff.Name = "sleepOff";
255 | this.sleepOff.Size = new System.Drawing.Size(100, 28);
256 | this.sleepOff.TabIndex = 12;
257 | this.sleepOff.Text = "OFF";
258 | this.sleepOff.UseVisualStyleBackColor = true;
259 | this.sleepOff.Click += new System.EventHandler(this.sleepOff_Click);
260 | //
261 | // sleepOn
262 | //
263 | this.sleepOn.Location = new System.Drawing.Point(123, 117);
264 | this.sleepOn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
265 | this.sleepOn.Name = "sleepOn";
266 | this.sleepOn.Size = new System.Drawing.Size(100, 28);
267 | this.sleepOn.TabIndex = 11;
268 | this.sleepOn.Text = "ON";
269 | this.sleepOn.UseVisualStyleBackColor = true;
270 | this.sleepOn.Click += new System.EventHandler(this.sleepOn_Click);
271 | //
272 | // label3
273 | //
274 | this.label3.AutoSize = true;
275 | this.label3.Location = new System.Drawing.Point(17, 87);
276 | this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
277 | this.label3.Name = "label3";
278 | this.label3.Size = new System.Drawing.Size(86, 17);
279 | this.label3.TabIndex = 14;
280 | this.label3.Text = "Microphone:";
281 | //
282 | // label4
283 | //
284 | this.label4.AutoSize = true;
285 | this.label4.Location = new System.Drawing.Point(17, 123);
286 | this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
287 | this.label4.Name = "label4";
288 | this.label4.Size = new System.Drawing.Size(87, 17);
289 | this.label4.TabIndex = 15;
290 | this.label4.Text = "Sleep moon:";
291 | //
292 | // label5
293 | //
294 | this.label5.AutoSize = true;
295 | this.label5.Location = new System.Drawing.Point(16, 181);
296 | this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
297 | this.label5.Name = "label5";
298 | this.label5.Size = new System.Drawing.Size(424, 17);
299 | this.label5.TabIndex = 16;
300 | this.label5.Text = "____________________________________________________";
301 | //
302 | // label6
303 | //
304 | this.label6.AutoSize = true;
305 | this.label6.Location = new System.Drawing.Point(17, 209);
306 | this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
307 | this.label6.Name = "label6";
308 | this.label6.Size = new System.Drawing.Size(126, 17);
309 | this.label6.TabIndex = 17;
310 | this.label6.Text = "Disks read activity:";
311 | //
312 | // checkHDDReadPower
313 | //
314 | this.checkHDDReadPower.AutoSize = true;
315 | this.checkHDDReadPower.Location = new System.Drawing.Point(21, 234);
316 | this.checkHDDReadPower.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
317 | this.checkHDDReadPower.Name = "checkHDDReadPower";
318 | this.checkHDDReadPower.Size = new System.Drawing.Size(113, 21);
319 | this.checkHDDReadPower.TabIndex = 18;
320 | this.checkHDDReadPower.Text = "Power button";
321 | this.checkHDDReadPower.UseVisualStyleBackColor = true;
322 | this.checkHDDReadPower.CheckedChanged += new System.EventHandler(this.checkHDDReadPower_CheckedChanged);
323 | //
324 | // checkHDDReadDot
325 | //
326 | this.checkHDDReadDot.AutoSize = true;
327 | this.checkHDDReadDot.Location = new System.Drawing.Point(21, 262);
328 | this.checkHDDReadDot.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
329 | this.checkHDDReadDot.Name = "checkHDDReadDot";
330 | this.checkHDDReadDot.Size = new System.Drawing.Size(82, 21);
331 | this.checkHDDReadDot.TabIndex = 19;
332 | this.checkHDDReadDot.Text = "Red Dot";
333 | this.checkHDDReadDot.UseVisualStyleBackColor = true;
334 | this.checkHDDReadDot.CheckedChanged += new System.EventHandler(this.checkHDDReadDot_CheckedChanged);
335 | //
336 | // checkHDDReadMicrophone
337 | //
338 | this.checkHDDReadMicrophone.AutoSize = true;
339 | this.checkHDDReadMicrophone.Location = new System.Drawing.Point(21, 290);
340 | this.checkHDDReadMicrophone.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
341 | this.checkHDDReadMicrophone.Name = "checkHDDReadMicrophone";
342 | this.checkHDDReadMicrophone.Size = new System.Drawing.Size(104, 21);
343 | this.checkHDDReadMicrophone.TabIndex = 20;
344 | this.checkHDDReadMicrophone.Text = "Microphone";
345 | this.checkHDDReadMicrophone.UseVisualStyleBackColor = true;
346 | this.checkHDDReadMicrophone.CheckedChanged += new System.EventHandler(this.checkHDDReadMicrophone_CheckedChanged);
347 | //
348 | // checkHDDReadSleep
349 | //
350 | this.checkHDDReadSleep.AutoSize = true;
351 | this.checkHDDReadSleep.Location = new System.Drawing.Point(21, 319);
352 | this.checkHDDReadSleep.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
353 | this.checkHDDReadSleep.Name = "checkHDDReadSleep";
354 | this.checkHDDReadSleep.Size = new System.Drawing.Size(105, 21);
355 | this.checkHDDReadSleep.TabIndex = 21;
356 | this.checkHDDReadSleep.Text = "Sleep moon";
357 | this.checkHDDReadSleep.UseVisualStyleBackColor = true;
358 | this.checkHDDReadSleep.CheckedChanged += new System.EventHandler(this.checkHDDReadSleep_CheckedChanged);
359 | //
360 | // label7
361 | //
362 | this.label7.AutoSize = true;
363 | this.label7.Location = new System.Drawing.Point(13, 753);
364 | this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
365 | this.label7.Name = "label7";
366 | this.label7.Size = new System.Drawing.Size(424, 17);
367 | this.label7.TabIndex = 22;
368 | this.label7.Text = "____________________________________________________";
369 | //
370 | // button1
371 | //
372 | this.button1.Location = new System.Drawing.Point(16, 775);
373 | this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
374 | this.button1.Name = "button1";
375 | this.button1.Size = new System.Drawing.Size(100, 28);
376 | this.button1.TabIndex = 23;
377 | this.button1.Text = "About";
378 | this.button1.UseVisualStyleBackColor = true;
379 | this.button1.Click += new System.EventHandler(this.button1_Click);
380 | //
381 | // workerHDD
382 | //
383 | this.workerHDD.WorkerSupportsCancellation = true;
384 | this.workerHDD.DoWork += new System.ComponentModel.DoWorkEventHandler(this.workerHDD_DoWork);
385 | //
386 | // NotifyIcon1
387 | //
388 | this.NotifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
389 | this.NotifyIcon1.Text = "notifyIcon1";
390 | this.NotifyIcon1.Visible = true;
391 | this.NotifyIcon1.DoubleClick += new System.EventHandler(this.NotifyIcon1_DoubleClick);
392 | //
393 | // contextMenuStrip1
394 | //
395 | this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
396 | this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
397 | this.toolStripMenuItem1,
398 | this.toolStripSeparator1,
399 | this.toolStripMenuItem2});
400 | this.contextMenuStrip1.Name = "contextMenuStrip1";
401 | this.contextMenuStrip1.Size = new System.Drawing.Size(200, 62);
402 | //
403 | // toolStripMenuItem1
404 | //
405 | this.toolStripMenuItem1.Name = "toolStripMenuItem1";
406 | this.toolStripMenuItem1.Size = new System.Drawing.Size(199, 26);
407 | this.toolStripMenuItem1.Text = "Show application";
408 | this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
409 | //
410 | // toolStripSeparator1
411 | //
412 | this.toolStripSeparator1.Name = "toolStripSeparator1";
413 | this.toolStripSeparator1.Size = new System.Drawing.Size(196, 6);
414 | //
415 | // toolStripMenuItem2
416 | //
417 | this.toolStripMenuItem2.Name = "toolStripMenuItem2";
418 | this.toolStripMenuItem2.Size = new System.Drawing.Size(199, 26);
419 | this.toolStripMenuItem2.Text = "Quit";
420 | this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
421 | //
422 | // checkHDDWriteSleep
423 | //
424 | this.checkHDDWriteSleep.AutoSize = true;
425 | this.checkHDDWriteSleep.Location = new System.Drawing.Point(164, 319);
426 | this.checkHDDWriteSleep.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
427 | this.checkHDDWriteSleep.Name = "checkHDDWriteSleep";
428 | this.checkHDDWriteSleep.Size = new System.Drawing.Size(105, 21);
429 | this.checkHDDWriteSleep.TabIndex = 28;
430 | this.checkHDDWriteSleep.Text = "Sleep moon";
431 | this.checkHDDWriteSleep.UseVisualStyleBackColor = true;
432 | this.checkHDDWriteSleep.CheckedChanged += new System.EventHandler(this.checkHDDWriteSleep_CheckedChanged);
433 | //
434 | // checkHDDWriteMicrophone
435 | //
436 | this.checkHDDWriteMicrophone.AutoSize = true;
437 | this.checkHDDWriteMicrophone.Location = new System.Drawing.Point(164, 290);
438 | this.checkHDDWriteMicrophone.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
439 | this.checkHDDWriteMicrophone.Name = "checkHDDWriteMicrophone";
440 | this.checkHDDWriteMicrophone.Size = new System.Drawing.Size(104, 21);
441 | this.checkHDDWriteMicrophone.TabIndex = 27;
442 | this.checkHDDWriteMicrophone.Text = "Microphone";
443 | this.checkHDDWriteMicrophone.UseVisualStyleBackColor = true;
444 | this.checkHDDWriteMicrophone.CheckedChanged += new System.EventHandler(this.checkHDDWriteMicrophone_CheckedChanged);
445 | //
446 | // checkHDDWriteDot
447 | //
448 | this.checkHDDWriteDot.AutoSize = true;
449 | this.checkHDDWriteDot.Location = new System.Drawing.Point(164, 262);
450 | this.checkHDDWriteDot.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
451 | this.checkHDDWriteDot.Name = "checkHDDWriteDot";
452 | this.checkHDDWriteDot.Size = new System.Drawing.Size(82, 21);
453 | this.checkHDDWriteDot.TabIndex = 26;
454 | this.checkHDDWriteDot.Text = "Red Dot";
455 | this.checkHDDWriteDot.UseVisualStyleBackColor = true;
456 | this.checkHDDWriteDot.CheckedChanged += new System.EventHandler(this.checkHDDWriteDot_CheckedChanged);
457 | //
458 | // checkHDDWritePower
459 | //
460 | this.checkHDDWritePower.AutoSize = true;
461 | this.checkHDDWritePower.Location = new System.Drawing.Point(164, 234);
462 | this.checkHDDWritePower.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
463 | this.checkHDDWritePower.Name = "checkHDDWritePower";
464 | this.checkHDDWritePower.Size = new System.Drawing.Size(113, 21);
465 | this.checkHDDWritePower.TabIndex = 25;
466 | this.checkHDDWritePower.Text = "Power button";
467 | this.checkHDDWritePower.UseVisualStyleBackColor = true;
468 | this.checkHDDWritePower.CheckedChanged += new System.EventHandler(this.checkHDDWritePower_CheckedChanged);
469 | //
470 | // label8
471 | //
472 | this.label8.AutoSize = true;
473 | this.label8.Location = new System.Drawing.Point(160, 209);
474 | this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
475 | this.label8.Name = "label8";
476 | this.label8.Size = new System.Drawing.Size(126, 17);
477 | this.label8.TabIndex = 24;
478 | this.label8.Text = "Disks write activity:";
479 | //
480 | // checkHDDSleep
481 | //
482 | this.checkHDDSleep.AutoSize = true;
483 | this.checkHDDSleep.Enabled = false;
484 | this.checkHDDSleep.Location = new System.Drawing.Point(313, 319);
485 | this.checkHDDSleep.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
486 | this.checkHDDSleep.Name = "checkHDDSleep";
487 | this.checkHDDSleep.Size = new System.Drawing.Size(105, 21);
488 | this.checkHDDSleep.TabIndex = 33;
489 | this.checkHDDSleep.Text = "Sleep moon";
490 | this.checkHDDSleep.UseVisualStyleBackColor = true;
491 | //
492 | // checkHDDMicrophone
493 | //
494 | this.checkHDDMicrophone.AutoSize = true;
495 | this.checkHDDMicrophone.Enabled = false;
496 | this.checkHDDMicrophone.Location = new System.Drawing.Point(313, 290);
497 | this.checkHDDMicrophone.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
498 | this.checkHDDMicrophone.Name = "checkHDDMicrophone";
499 | this.checkHDDMicrophone.Size = new System.Drawing.Size(104, 21);
500 | this.checkHDDMicrophone.TabIndex = 32;
501 | this.checkHDDMicrophone.Text = "Microphone";
502 | this.checkHDDMicrophone.UseVisualStyleBackColor = true;
503 | //
504 | // checkHDDDot
505 | //
506 | this.checkHDDDot.AutoSize = true;
507 | this.checkHDDDot.Enabled = false;
508 | this.checkHDDDot.Location = new System.Drawing.Point(313, 262);
509 | this.checkHDDDot.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
510 | this.checkHDDDot.Name = "checkHDDDot";
511 | this.checkHDDDot.Size = new System.Drawing.Size(82, 21);
512 | this.checkHDDDot.TabIndex = 31;
513 | this.checkHDDDot.Text = "Red Dot";
514 | this.checkHDDDot.UseVisualStyleBackColor = true;
515 | //
516 | // checkHDDPower
517 | //
518 | this.checkHDDPower.AutoSize = true;
519 | this.checkHDDPower.Enabled = false;
520 | this.checkHDDPower.Location = new System.Drawing.Point(313, 234);
521 | this.checkHDDPower.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
522 | this.checkHDDPower.Name = "checkHDDPower";
523 | this.checkHDDPower.Size = new System.Drawing.Size(113, 21);
524 | this.checkHDDPower.TabIndex = 30;
525 | this.checkHDDPower.Text = "Power button";
526 | this.checkHDDPower.UseVisualStyleBackColor = true;
527 | //
528 | // label9
529 | //
530 | this.label9.AutoSize = true;
531 | this.label9.Location = new System.Drawing.Point(309, 209);
532 | this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
533 | this.label9.Name = "label9";
534 | this.label9.Size = new System.Drawing.Size(93, 17);
535 | this.label9.TabIndex = 29;
536 | this.label9.Text = "Disks activity:";
537 | //
538 | // checkCLSleep
539 | //
540 | this.checkCLSleep.AutoSize = true;
541 | this.checkCLSleep.Location = new System.Drawing.Point(21, 555);
542 | this.checkCLSleep.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
543 | this.checkCLSleep.Name = "checkCLSleep";
544 | this.checkCLSleep.Size = new System.Drawing.Size(105, 21);
545 | this.checkCLSleep.TabIndex = 38;
546 | this.checkCLSleep.Text = "Sleep moon";
547 | this.checkCLSleep.UseVisualStyleBackColor = true;
548 | //
549 | // checkCLMicrophone
550 | //
551 | this.checkCLMicrophone.AutoSize = true;
552 | this.checkCLMicrophone.Location = new System.Drawing.Point(21, 526);
553 | this.checkCLMicrophone.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
554 | this.checkCLMicrophone.Name = "checkCLMicrophone";
555 | this.checkCLMicrophone.Size = new System.Drawing.Size(104, 21);
556 | this.checkCLMicrophone.TabIndex = 37;
557 | this.checkCLMicrophone.Text = "Microphone";
558 | this.checkCLMicrophone.UseVisualStyleBackColor = true;
559 | //
560 | // checkCLDot
561 | //
562 | this.checkCLDot.AutoSize = true;
563 | this.checkCLDot.Location = new System.Drawing.Point(21, 498);
564 | this.checkCLDot.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
565 | this.checkCLDot.Name = "checkCLDot";
566 | this.checkCLDot.Size = new System.Drawing.Size(82, 21);
567 | this.checkCLDot.TabIndex = 36;
568 | this.checkCLDot.Text = "Red Dot";
569 | this.checkCLDot.UseVisualStyleBackColor = true;
570 | //
571 | // checkCLPower
572 | //
573 | this.checkCLPower.AutoSize = true;
574 | this.checkCLPower.Location = new System.Drawing.Point(21, 470);
575 | this.checkCLPower.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
576 | this.checkCLPower.Name = "checkCLPower";
577 | this.checkCLPower.Size = new System.Drawing.Size(113, 21);
578 | this.checkCLPower.TabIndex = 35;
579 | this.checkCLPower.Text = "Power button";
580 | this.checkCLPower.UseVisualStyleBackColor = true;
581 | //
582 | // label10
583 | //
584 | this.label10.AutoSize = true;
585 | this.label10.Location = new System.Drawing.Point(17, 446);
586 | this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
587 | this.label10.Name = "label10";
588 | this.label10.Size = new System.Drawing.Size(120, 17);
589 | this.label10.TabIndex = 34;
590 | this.label10.Text = "Caps Lock status:";
591 | //
592 | // label11
593 | //
594 | this.label11.AutoSize = true;
595 | this.label11.Location = new System.Drawing.Point(17, 647);
596 | this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
597 | this.label11.Name = "label11";
598 | this.label11.Size = new System.Drawing.Size(48, 17);
599 | this.label11.TabIndex = 39;
600 | this.label11.Text = "Delay:";
601 | //
602 | // numericUpDown1
603 | //
604 | this.numericUpDown1.Location = new System.Drawing.Point(63, 646);
605 | this.numericUpDown1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
606 | this.numericUpDown1.Maximum = new decimal(new int[] {
607 | 2000,
608 | 0,
609 | 0,
610 | 0});
611 | this.numericUpDown1.Minimum = new decimal(new int[] {
612 | 1,
613 | 0,
614 | 0,
615 | 0});
616 | this.numericUpDown1.Name = "numericUpDown1";
617 | this.numericUpDown1.Size = new System.Drawing.Size(68, 22);
618 | this.numericUpDown1.TabIndex = 40;
619 | this.numericUpDown1.Value = new decimal(new int[] {
620 | 1,
621 | 0,
622 | 0,
623 | 0});
624 | this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
625 | this.numericUpDown1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.numericUpDown1_KeyPress);
626 | //
627 | // checkHDD
628 | //
629 | this.checkHDD.AutoSize = true;
630 | this.checkHDD.Location = new System.Drawing.Point(21, 377);
631 | this.checkHDD.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
632 | this.checkHDD.Name = "checkHDD";
633 | this.checkHDD.Size = new System.Drawing.Size(265, 21);
634 | this.checkHDD.TabIndex = 41;
635 | this.checkHDD.Text = "Disable disk drives activity monitoring";
636 | this.checkHDD.UseVisualStyleBackColor = true;
637 | this.checkHDD.CheckedChanged += new System.EventHandler(this.checkHDD_CheckedChanged);
638 | //
639 | // button2
640 | //
641 | this.button2.Location = new System.Drawing.Point(297, 372);
642 | this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
643 | this.button2.Name = "button2";
644 | this.button2.Size = new System.Drawing.Size(33, 28);
645 | this.button2.TabIndex = 42;
646 | this.button2.Text = "?";
647 | this.button2.UseVisualStyleBackColor = true;
648 | this.button2.Click += new System.EventHandler(this.button2_Click);
649 | //
650 | // button3
651 | //
652 | this.button3.Location = new System.Drawing.Point(139, 642);
653 | this.button3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
654 | this.button3.Name = "button3";
655 | this.button3.Size = new System.Drawing.Size(33, 28);
656 | this.button3.TabIndex = 43;
657 | this.button3.Text = "?";
658 | this.button3.UseVisualStyleBackColor = true;
659 | this.button3.Click += new System.EventHandler(this.button3_Click);
660 | //
661 | // button4
662 | //
663 | this.button4.Location = new System.Drawing.Point(123, 775);
664 | this.button4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
665 | this.button4.Name = "button4";
666 | this.button4.Size = new System.Drawing.Size(316, 28);
667 | this.button4.TabIndex = 44;
668 | this.button4.Text = "Register to run at system startup as admin";
669 | this.button4.UseVisualStyleBackColor = true;
670 | this.button4.Click += new System.EventHandler(this.button4_Click);
671 | //
672 | // button5
673 | //
674 | this.button5.Location = new System.Drawing.Point(139, 406);
675 | this.button5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
676 | this.button5.Name = "button5";
677 | this.button5.Size = new System.Drawing.Size(33, 28);
678 | this.button5.TabIndex = 47;
679 | this.button5.Text = "?";
680 | this.button5.UseVisualStyleBackColor = true;
681 | this.button5.Click += new System.EventHandler(this.button5_Click);
682 | //
683 | // numericUpDown2
684 | //
685 | this.numericUpDown2.Location = new System.Drawing.Point(63, 409);
686 | this.numericUpDown2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
687 | this.numericUpDown2.Maximum = new decimal(new int[] {
688 | 2000,
689 | 0,
690 | 0,
691 | 0});
692 | this.numericUpDown2.Minimum = new decimal(new int[] {
693 | 1,
694 | 0,
695 | 0,
696 | 0});
697 | this.numericUpDown2.Name = "numericUpDown2";
698 | this.numericUpDown2.Size = new System.Drawing.Size(68, 22);
699 | this.numericUpDown2.TabIndex = 46;
700 | this.numericUpDown2.Value = new decimal(new int[] {
701 | 1,
702 | 0,
703 | 0,
704 | 0});
705 | //
706 | // label12
707 | //
708 | this.label12.AutoSize = true;
709 | this.label12.Location = new System.Drawing.Point(17, 411);
710 | this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
711 | this.label12.Name = "label12";
712 | this.label12.Size = new System.Drawing.Size(48, 17);
713 | this.label12.TabIndex = 45;
714 | this.label12.Text = "Delay:";
715 | //
716 | // checkNLSleep
717 | //
718 | this.checkNLSleep.AutoSize = true;
719 | this.checkNLSleep.Location = new System.Drawing.Point(164, 555);
720 | this.checkNLSleep.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
721 | this.checkNLSleep.Name = "checkNLSleep";
722 | this.checkNLSleep.Size = new System.Drawing.Size(105, 21);
723 | this.checkNLSleep.TabIndex = 52;
724 | this.checkNLSleep.Text = "Sleep moon";
725 | this.checkNLSleep.UseVisualStyleBackColor = true;
726 | //
727 | // checkNLMicrophone
728 | //
729 | this.checkNLMicrophone.AutoSize = true;
730 | this.checkNLMicrophone.Location = new System.Drawing.Point(164, 526);
731 | this.checkNLMicrophone.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
732 | this.checkNLMicrophone.Name = "checkNLMicrophone";
733 | this.checkNLMicrophone.Size = new System.Drawing.Size(104, 21);
734 | this.checkNLMicrophone.TabIndex = 51;
735 | this.checkNLMicrophone.Text = "Microphone";
736 | this.checkNLMicrophone.UseVisualStyleBackColor = true;
737 | //
738 | // checkNLDot
739 | //
740 | this.checkNLDot.AutoSize = true;
741 | this.checkNLDot.Location = new System.Drawing.Point(164, 498);
742 | this.checkNLDot.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
743 | this.checkNLDot.Name = "checkNLDot";
744 | this.checkNLDot.Size = new System.Drawing.Size(82, 21);
745 | this.checkNLDot.TabIndex = 50;
746 | this.checkNLDot.Text = "Red Dot";
747 | this.checkNLDot.UseVisualStyleBackColor = true;
748 | //
749 | // checkNLPower
750 | //
751 | this.checkNLPower.AutoSize = true;
752 | this.checkNLPower.Location = new System.Drawing.Point(164, 470);
753 | this.checkNLPower.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
754 | this.checkNLPower.Name = "checkNLPower";
755 | this.checkNLPower.Size = new System.Drawing.Size(113, 21);
756 | this.checkNLPower.TabIndex = 49;
757 | this.checkNLPower.Text = "Power button";
758 | this.checkNLPower.UseVisualStyleBackColor = true;
759 | //
760 | // label13
761 | //
762 | this.label13.AutoSize = true;
763 | this.label13.Location = new System.Drawing.Point(160, 446);
764 | this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
765 | this.label13.Name = "label13";
766 | this.label13.Size = new System.Drawing.Size(113, 17);
767 | this.label13.TabIndex = 48;
768 | this.label13.Text = "NumLock status:";
769 | //
770 | // checkBox5
771 | //
772 | this.checkBox5.AutoSize = true;
773 | this.checkBox5.Location = new System.Drawing.Point(21, 615);
774 | this.checkBox5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
775 | this.checkBox5.Name = "checkBox5";
776 | this.checkBox5.Size = new System.Drawing.Size(180, 21);
777 | this.checkBox5.TabIndex = 53;
778 | this.checkBox5.Text = "Disable keys monitoring";
779 | this.checkBox5.UseVisualStyleBackColor = true;
780 | this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
781 | //
782 | // button6
783 | //
784 | this.button6.Location = new System.Drawing.Point(212, 610);
785 | this.button6.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
786 | this.button6.Name = "button6";
787 | this.button6.Size = new System.Drawing.Size(33, 28);
788 | this.button6.TabIndex = 54;
789 | this.button6.Text = "?";
790 | this.button6.UseVisualStyleBackColor = true;
791 | this.button6.Click += new System.EventHandler(this.button6_Click);
792 | //
793 | // timer1
794 | //
795 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
796 | //
797 | // button7
798 | //
799 | this.button7.Location = new System.Drawing.Point(16, 812);
800 | this.button7.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
801 | this.button7.Name = "button7";
802 | this.button7.Size = new System.Drawing.Size(215, 28);
803 | this.button7.TabIndex = 55;
804 | this.button7.Text = "Debug LEDs (advanced)";
805 | this.button7.UseVisualStyleBackColor = true;
806 | this.button7.Click += new System.EventHandler(this.button7_Click);
807 | //
808 | // button8
809 | //
810 | this.button8.Location = new System.Drawing.Point(231, 812);
811 | this.button8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
812 | this.button8.Name = "button8";
813 | this.button8.Size = new System.Drawing.Size(75, 23);
814 | this.button8.TabIndex = 56;
815 | this.button8.Text = "button8";
816 | this.button8.UseVisualStyleBackColor = true;
817 | this.button8.Visible = false;
818 | this.button8.Click += new System.EventHandler(this.button8_Click);
819 | //
820 | // rememberKBD
821 | //
822 | this.rememberKBD.Location = new System.Drawing.Point(21, 679);
823 | this.rememberKBD.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
824 | this.rememberKBD.Name = "rememberKBD";
825 | this.rememberKBD.Size = new System.Drawing.Size(436, 39);
826 | this.rememberKBD.TabIndex = 57;
827 | this.rememberKBD.Text = "Remember keyboard illumination level after restart, sleep, and other power events" +
828 | "";
829 | this.rememberKBD.UseVisualStyleBackColor = true;
830 | this.rememberKBD.CheckedChanged += new System.EventHandler(this.rememberKBD_CheckedChanged);
831 | //
832 | // lightTimer
833 | //
834 | this.lightTimer.Interval = 1000;
835 | this.lightTimer.Tick += new System.EventHandler(this.lightTimer_Tick);
836 | //
837 | // checkTurnKBLightOff
838 | //
839 | this.checkTurnKBLightOff.Location = new System.Drawing.Point(21, 727);
840 | this.checkTurnKBLightOff.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
841 | this.checkTurnKBLightOff.Name = "checkTurnKBLightOff";
842 | this.checkTurnKBLightOff.Size = new System.Drawing.Size(436, 39);
843 | this.checkTurnKBLightOff.TabIndex = 58;
844 | this.checkTurnKBLightOff.Text = "Turn keyboard light off when applications go full screen (ideal for watching movi" +
845 | "es)";
846 | this.checkTurnKBLightOff.UseVisualStyleBackColor = true;
847 | this.checkTurnKBLightOff.CheckedChanged += new System.EventHandler(this.checkTurnKBLightOff_CheckedChanged);
848 | //
849 | // label14
850 | //
851 | this.label14.AutoSize = true;
852 | this.label14.Location = new System.Drawing.Point(17, 159);
853 | this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
854 | this.label14.Name = "label14";
855 | this.label14.Size = new System.Drawing.Size(62, 17);
856 | this.label14.TabIndex = 62;
857 | this.label14.Text = "Fn Lock:";
858 | //
859 | // button9
860 | //
861 | this.button9.Location = new System.Drawing.Point(339, 153);
862 | this.button9.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
863 | this.button9.Name = "button9";
864 | this.button9.Size = new System.Drawing.Size(100, 28);
865 | this.button9.TabIndex = 61;
866 | this.button9.Text = "Third state";
867 | this.button9.UseVisualStyleBackColor = true;
868 | this.button9.Click += new System.EventHandler(this.button9_Click);
869 | //
870 | // button10
871 | //
872 | this.button10.Location = new System.Drawing.Point(231, 153);
873 | this.button10.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
874 | this.button10.Name = "button10";
875 | this.button10.Size = new System.Drawing.Size(100, 28);
876 | this.button10.TabIndex = 60;
877 | this.button10.Text = "OFF";
878 | this.button10.UseVisualStyleBackColor = true;
879 | this.button10.Click += new System.EventHandler(this.button10_Click);
880 | //
881 | // button11
882 | //
883 | this.button11.Location = new System.Drawing.Point(123, 153);
884 | this.button11.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
885 | this.button11.Name = "button11";
886 | this.button11.Size = new System.Drawing.Size(100, 28);
887 | this.button11.TabIndex = 59;
888 | this.button11.Text = "ON";
889 | this.button11.UseVisualStyleBackColor = true;
890 | this.button11.Click += new System.EventHandler(this.button11_Click);
891 | //
892 | // checkHDDReadFn
893 | //
894 | this.checkHDDReadFn.AutoSize = true;
895 | this.checkHDDReadFn.Location = new System.Drawing.Point(21, 348);
896 | this.checkHDDReadFn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
897 | this.checkHDDReadFn.Name = "checkHDDReadFn";
898 | this.checkHDDReadFn.Size = new System.Drawing.Size(80, 21);
899 | this.checkHDDReadFn.TabIndex = 63;
900 | this.checkHDDReadFn.Text = "Fn Lock";
901 | this.checkHDDReadFn.UseVisualStyleBackColor = true;
902 | this.checkHDDReadFn.CheckedChanged += new System.EventHandler(this.checkHDDReadFn_CheckedChanged);
903 | //
904 | // checkHDDWriteFn
905 | //
906 | this.checkHDDWriteFn.AutoSize = true;
907 | this.checkHDDWriteFn.Location = new System.Drawing.Point(164, 348);
908 | this.checkHDDWriteFn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
909 | this.checkHDDWriteFn.Name = "checkHDDWriteFn";
910 | this.checkHDDWriteFn.Size = new System.Drawing.Size(80, 21);
911 | this.checkHDDWriteFn.TabIndex = 64;
912 | this.checkHDDWriteFn.Text = "Fn Lock";
913 | this.checkHDDWriteFn.UseVisualStyleBackColor = true;
914 | this.checkHDDWriteFn.CheckedChanged += new System.EventHandler(this.checkHDDWriteFn_CheckedChanged);
915 | //
916 | // checkHDDFn
917 | //
918 | this.checkHDDFn.AutoSize = true;
919 | this.checkHDDFn.Enabled = false;
920 | this.checkHDDFn.Location = new System.Drawing.Point(313, 348);
921 | this.checkHDDFn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
922 | this.checkHDDFn.Name = "checkHDDFn";
923 | this.checkHDDFn.Size = new System.Drawing.Size(80, 21);
924 | this.checkHDDFn.TabIndex = 65;
925 | this.checkHDDFn.Text = "Fn Lock";
926 | this.checkHDDFn.UseVisualStyleBackColor = true;
927 | //
928 | // checkCLFn
929 | //
930 | this.checkCLFn.AutoSize = true;
931 | this.checkCLFn.Location = new System.Drawing.Point(21, 585);
932 | this.checkCLFn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
933 | this.checkCLFn.Name = "checkCLFn";
934 | this.checkCLFn.Size = new System.Drawing.Size(80, 21);
935 | this.checkCLFn.TabIndex = 66;
936 | this.checkCLFn.Text = "Fn Lock";
937 | this.checkCLFn.UseVisualStyleBackColor = true;
938 | //
939 | // checkNLFn
940 | //
941 | this.checkNLFn.AutoSize = true;
942 | this.checkNLFn.Location = new System.Drawing.Point(164, 583);
943 | this.checkNLFn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
944 | this.checkNLFn.Name = "checkNLFn";
945 | this.checkNLFn.Size = new System.Drawing.Size(80, 21);
946 | this.checkNLFn.TabIndex = 67;
947 | this.checkNLFn.Text = "Fn Lock";
948 | this.checkNLFn.UseVisualStyleBackColor = true;
949 | //
950 | // checkInvertFn
951 | //
952 | this.checkInvertFn.AutoSize = true;
953 | this.checkInvertFn.Location = new System.Drawing.Point(313, 583);
954 | this.checkInvertFn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
955 | this.checkInvertFn.Name = "checkInvertFn";
956 | this.checkInvertFn.Size = new System.Drawing.Size(80, 21);
957 | this.checkInvertFn.TabIndex = 73;
958 | this.checkInvertFn.Text = "Fn Lock";
959 | this.checkInvertFn.UseVisualStyleBackColor = true;
960 | //
961 | // checkInvertSleep
962 | //
963 | this.checkInvertSleep.AutoSize = true;
964 | this.checkInvertSleep.Location = new System.Drawing.Point(313, 555);
965 | this.checkInvertSleep.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
966 | this.checkInvertSleep.Name = "checkInvertSleep";
967 | this.checkInvertSleep.Size = new System.Drawing.Size(105, 21);
968 | this.checkInvertSleep.TabIndex = 72;
969 | this.checkInvertSleep.Text = "Sleep moon";
970 | this.checkInvertSleep.UseVisualStyleBackColor = true;
971 | //
972 | // checkInvertMicrophone
973 | //
974 | this.checkInvertMicrophone.AutoSize = true;
975 | this.checkInvertMicrophone.Location = new System.Drawing.Point(313, 526);
976 | this.checkInvertMicrophone.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
977 | this.checkInvertMicrophone.Name = "checkInvertMicrophone";
978 | this.checkInvertMicrophone.Size = new System.Drawing.Size(104, 21);
979 | this.checkInvertMicrophone.TabIndex = 71;
980 | this.checkInvertMicrophone.Text = "Microphone";
981 | this.checkInvertMicrophone.UseVisualStyleBackColor = true;
982 | //
983 | // checkInvertDot
984 | //
985 | this.checkInvertDot.AutoSize = true;
986 | this.checkInvertDot.Location = new System.Drawing.Point(313, 498);
987 | this.checkInvertDot.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
988 | this.checkInvertDot.Name = "checkInvertDot";
989 | this.checkInvertDot.Size = new System.Drawing.Size(82, 21);
990 | this.checkInvertDot.TabIndex = 70;
991 | this.checkInvertDot.Text = "Red Dot";
992 | this.checkInvertDot.UseVisualStyleBackColor = true;
993 | //
994 | // checkInvertPower
995 | //
996 | this.checkInvertPower.AutoSize = true;
997 | this.checkInvertPower.Location = new System.Drawing.Point(313, 470);
998 | this.checkInvertPower.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
999 | this.checkInvertPower.Name = "checkInvertPower";
1000 | this.checkInvertPower.Size = new System.Drawing.Size(113, 21);
1001 | this.checkInvertPower.TabIndex = 69;
1002 | this.checkInvertPower.Text = "Power button";
1003 | this.checkInvertPower.UseVisualStyleBackColor = true;
1004 | //
1005 | // label15
1006 | //
1007 | this.label15.AutoSize = true;
1008 | this.label15.Location = new System.Drawing.Point(309, 446);
1009 | this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
1010 | this.label15.Name = "label15";
1011 | this.label15.Size = new System.Drawing.Size(89, 17);
1012 | this.label15.TabIndex = 68;
1013 | this.label15.Text = "Invert action:";
1014 | //
1015 | // button12
1016 | //
1017 | this.button12.Location = new System.Drawing.Point(239, 812);
1018 | this.button12.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
1019 | this.button12.Name = "button12";
1020 | this.button12.Size = new System.Drawing.Size(200, 28);
1021 | this.button12.TabIndex = 74;
1022 | this.button12.Text = "Choose driver";
1023 | this.button12.UseVisualStyleBackColor = true;
1024 | this.button12.Click += new System.EventHandler(this.button12_Click);
1025 | //
1026 | // Form1
1027 | //
1028 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
1029 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
1030 | this.ClientSize = new System.Drawing.Size(453, 895);
1031 | this.Controls.Add(this.button12);
1032 | this.Controls.Add(this.checkInvertFn);
1033 | this.Controls.Add(this.checkInvertSleep);
1034 | this.Controls.Add(this.checkInvertMicrophone);
1035 | this.Controls.Add(this.checkInvertDot);
1036 | this.Controls.Add(this.checkInvertPower);
1037 | this.Controls.Add(this.label15);
1038 | this.Controls.Add(this.checkNLFn);
1039 | this.Controls.Add(this.checkCLFn);
1040 | this.Controls.Add(this.checkHDDFn);
1041 | this.Controls.Add(this.checkHDDWriteFn);
1042 | this.Controls.Add(this.checkHDDReadFn);
1043 | this.Controls.Add(this.label14);
1044 | this.Controls.Add(this.button9);
1045 | this.Controls.Add(this.button10);
1046 | this.Controls.Add(this.button11);
1047 | this.Controls.Add(this.checkTurnKBLightOff);
1048 | this.Controls.Add(this.rememberKBD);
1049 | this.Controls.Add(this.button8);
1050 | this.Controls.Add(this.button7);
1051 | this.Controls.Add(this.button6);
1052 | this.Controls.Add(this.checkBox5);
1053 | this.Controls.Add(this.checkNLSleep);
1054 | this.Controls.Add(this.checkNLMicrophone);
1055 | this.Controls.Add(this.checkNLDot);
1056 | this.Controls.Add(this.checkNLPower);
1057 | this.Controls.Add(this.label13);
1058 | this.Controls.Add(this.button5);
1059 | this.Controls.Add(this.numericUpDown2);
1060 | this.Controls.Add(this.label12);
1061 | this.Controls.Add(this.button4);
1062 | this.Controls.Add(this.button3);
1063 | this.Controls.Add(this.button2);
1064 | this.Controls.Add(this.checkHDD);
1065 | this.Controls.Add(this.numericUpDown1);
1066 | this.Controls.Add(this.label11);
1067 | this.Controls.Add(this.checkCLSleep);
1068 | this.Controls.Add(this.checkCLMicrophone);
1069 | this.Controls.Add(this.checkCLDot);
1070 | this.Controls.Add(this.checkCLPower);
1071 | this.Controls.Add(this.label10);
1072 | this.Controls.Add(this.checkHDDSleep);
1073 | this.Controls.Add(this.checkHDDMicrophone);
1074 | this.Controls.Add(this.checkHDDDot);
1075 | this.Controls.Add(this.checkHDDPower);
1076 | this.Controls.Add(this.label9);
1077 | this.Controls.Add(this.checkHDDWriteSleep);
1078 | this.Controls.Add(this.checkHDDWriteMicrophone);
1079 | this.Controls.Add(this.checkHDDWriteDot);
1080 | this.Controls.Add(this.checkHDDWritePower);
1081 | this.Controls.Add(this.label8);
1082 | this.Controls.Add(this.button1);
1083 | this.Controls.Add(this.label7);
1084 | this.Controls.Add(this.checkHDDReadSleep);
1085 | this.Controls.Add(this.checkHDDReadMicrophone);
1086 | this.Controls.Add(this.checkHDDReadDot);
1087 | this.Controls.Add(this.checkHDDReadPower);
1088 | this.Controls.Add(this.label6);
1089 | this.Controls.Add(this.label5);
1090 | this.Controls.Add(this.label4);
1091 | this.Controls.Add(this.label3);
1092 | this.Controls.Add(this.sleepBlink);
1093 | this.Controls.Add(this.sleepOff);
1094 | this.Controls.Add(this.sleepOn);
1095 | this.Controls.Add(this.microphoneBlink);
1096 | this.Controls.Add(this.microphoneOff);
1097 | this.Controls.Add(this.microphoneOn);
1098 | this.Controls.Add(this.dotBlink);
1099 | this.Controls.Add(this.dotOff);
1100 | this.Controls.Add(this.dotOn);
1101 | this.Controls.Add(this.label2);
1102 | this.Controls.Add(this.powerBlink);
1103 | this.Controls.Add(this.label1);
1104 | this.Controls.Add(this.powerOff);
1105 | this.Controls.Add(this.powerOn);
1106 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
1107 | this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
1108 | this.MaximizeBox = false;
1109 | this.Name = "Form1";
1110 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
1111 | this.Text = "ThinkPad LEDs Control";
1112 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
1113 | this.contextMenuStrip1.ResumeLayout(false);
1114 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
1115 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
1116 | this.ResumeLayout(false);
1117 | this.PerformLayout();
1118 |
1119 | }
1120 |
1121 | #endregion
1122 |
1123 | private System.Windows.Forms.Button powerOn;
1124 | private System.Windows.Forms.Button powerOff;
1125 | private System.Windows.Forms.Label label1;
1126 | private System.Windows.Forms.Button powerBlink;
1127 | private System.Windows.Forms.Label label2;
1128 | private System.Windows.Forms.Button dotBlink;
1129 | private System.Windows.Forms.Button dotOff;
1130 | private System.Windows.Forms.Button dotOn;
1131 | private System.Windows.Forms.Button microphoneBlink;
1132 | private System.Windows.Forms.Button microphoneOff;
1133 | private System.Windows.Forms.Button microphoneOn;
1134 | private System.Windows.Forms.Button sleepBlink;
1135 | private System.Windows.Forms.Button sleepOff;
1136 | private System.Windows.Forms.Button sleepOn;
1137 | private System.Windows.Forms.Label label3;
1138 | private System.Windows.Forms.Label label4;
1139 | private System.Windows.Forms.Label label5;
1140 | private System.Windows.Forms.Label label6;
1141 | private System.Windows.Forms.CheckBox checkHDDReadPower;
1142 | private System.Windows.Forms.CheckBox checkHDDReadDot;
1143 | private System.Windows.Forms.CheckBox checkHDDReadMicrophone;
1144 | private System.Windows.Forms.CheckBox checkHDDReadSleep;
1145 | private System.Windows.Forms.Label label7;
1146 | private System.Windows.Forms.Button button1;
1147 | private System.ComponentModel.BackgroundWorker workerHDD;
1148 | private System.Windows.Forms.NotifyIcon NotifyIcon1;
1149 | private System.Windows.Forms.CheckBox checkHDDWriteSleep;
1150 | private System.Windows.Forms.CheckBox checkHDDWriteMicrophone;
1151 | private System.Windows.Forms.CheckBox checkHDDWriteDot;
1152 | private System.Windows.Forms.CheckBox checkHDDWritePower;
1153 | private System.Windows.Forms.Label label8;
1154 | private System.Windows.Forms.CheckBox checkHDDSleep;
1155 | private System.Windows.Forms.CheckBox checkHDDMicrophone;
1156 | private System.Windows.Forms.CheckBox checkHDDDot;
1157 | private System.Windows.Forms.CheckBox checkHDDPower;
1158 | private System.Windows.Forms.Label label9;
1159 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
1160 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
1161 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
1162 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
1163 | private System.Windows.Forms.CheckBox checkCLSleep;
1164 | private System.Windows.Forms.CheckBox checkCLMicrophone;
1165 | private System.Windows.Forms.CheckBox checkCLDot;
1166 | private System.Windows.Forms.CheckBox checkCLPower;
1167 | private System.Windows.Forms.Label label10;
1168 | private System.Windows.Forms.Label label11;
1169 | private System.Windows.Forms.NumericUpDown numericUpDown1;
1170 | private System.Windows.Forms.CheckBox checkHDD;
1171 | private System.Windows.Forms.Button button2;
1172 | private System.Windows.Forms.Button button3;
1173 | private System.Windows.Forms.Button button4;
1174 | private System.Windows.Forms.Label label12;
1175 | private System.Windows.Forms.NumericUpDown numericUpDown2;
1176 | private System.Windows.Forms.Button button5;
1177 | private System.Windows.Forms.CheckBox checkNLSleep;
1178 | private System.Windows.Forms.CheckBox checkNLMicrophone;
1179 | private System.Windows.Forms.CheckBox checkNLDot;
1180 | private System.Windows.Forms.CheckBox checkNLPower;
1181 | private System.Windows.Forms.Label label13;
1182 | private System.Windows.Forms.CheckBox checkBox5;
1183 | private System.Windows.Forms.Button button6;
1184 | private System.Windows.Forms.Timer timer1;
1185 | private System.Windows.Forms.Button button7;
1186 | private System.Windows.Forms.Button button8;
1187 | private System.Windows.Forms.CheckBox rememberKBD;
1188 | private System.Windows.Forms.Timer lightTimer;
1189 | private System.Windows.Forms.CheckBox checkTurnKBLightOff;
1190 | private System.Windows.Forms.Label label14;
1191 | private System.Windows.Forms.Button button9;
1192 | private System.Windows.Forms.Button button10;
1193 | private System.Windows.Forms.Button button11;
1194 | private System.Windows.Forms.CheckBox checkHDDReadFn;
1195 | private System.Windows.Forms.CheckBox checkHDDWriteFn;
1196 | private System.Windows.Forms.CheckBox checkHDDFn;
1197 | private System.Windows.Forms.CheckBox checkCLFn;
1198 | private System.Windows.Forms.CheckBox checkNLFn;
1199 | private System.Windows.Forms.CheckBox checkInvertFn;
1200 | private System.Windows.Forms.CheckBox checkInvertSleep;
1201 | private System.Windows.Forms.CheckBox checkInvertMicrophone;
1202 | private System.Windows.Forms.CheckBox checkInvertDot;
1203 | private System.Windows.Forms.CheckBox checkInvertPower;
1204 | private System.Windows.Forms.Label label15;
1205 | private System.Windows.Forms.Button button12;
1206 | }
1207 | }
1208 |
1209 |
--------------------------------------------------------------------------------
/LEDControl/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 132, 17
125 |
126 |
127 | 247, 17
128 |
129 |
130 | 402, 17
131 |
132 |
133 | 503, 17
134 |
135 |
--------------------------------------------------------------------------------
/LEDControl/LEDControl.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {C3AB624F-5637-42C4-9E84-55405F14AE80}
8 | WinExe
9 | Properties
10 | LEDControl
11 | LEDControl
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 | true
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 | true
36 |
37 |
38 | true
39 | bin\x86\Debug\
40 | DEBUG;TRACE
41 | true
42 | full
43 | x86
44 | prompt
45 | MinimumRecommendedRules.ruleset
46 | true
47 |
48 |
49 | bin\x86\Release\
50 | TRACE
51 | true
52 | pdbonly
53 | x86
54 | prompt
55 | MinimumRecommendedRules.ruleset
56 | true
57 | true
58 |
59 |
60 |
61 | .\CbtHook.dll
62 | False
63 |
64 |
65 | .\CoreAudioApi.dll
66 | False
67 |
68 |
69 | ..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll
70 | False
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | .\WindowsHook.dll
85 | False
86 |
87 |
88 |
89 |
90 | Form
91 |
92 |
93 | Custom.cs
94 |
95 |
96 |
97 | Form
98 |
99 |
100 | Form1.cs
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | Form
109 |
110 |
111 | Welcome.cs
112 |
113 |
114 | Custom.cs
115 |
116 |
117 | Form1.cs
118 |
119 |
120 | ResXFileCodeGenerator
121 | Resources.Designer.cs
122 | Designer
123 |
124 |
125 | True
126 | Resources.resx
127 | True
128 |
129 |
130 | Welcome.cs
131 |
132 |
133 |
134 | SettingsSingleFileGenerator
135 | Settings.Designer.cs
136 |
137 |
138 | True
139 | Settings.settings
140 | True
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
193 |
--------------------------------------------------------------------------------
/LEDControl/Microsoft.WindowsAPICodePack.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/Microsoft.WindowsAPICodePack.dll
--------------------------------------------------------------------------------
/LEDControl/MsgBoxCheck.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Drawing;
4 | using System.Windows.Forms;
5 | using System.Runtime.InteropServices;
6 | using MsdnMag; // For LocalCbtHook
7 | using Microsoft.Win32; // For RegKey
8 |
9 | namespace LEDControl
10 | {
11 | public class MessageBoxEx
12 | {
13 | protected LocalCbtHook m_cbt;
14 | protected IntPtr m_hwnd = IntPtr.Zero;
15 | protected IntPtr m_hwndBtn = IntPtr.Zero;
16 | protected bool m_bInit = false;
17 | protected bool m_bCheck = false;
18 | protected string m_strCheck;
19 |
20 | public MessageBoxEx()
21 | {
22 | m_cbt = new LocalCbtHook();
23 | m_cbt.WindowCreated += new LocalCbtHook.CbtEventHandler(WndCreated);
24 | m_cbt.WindowDestroyed += new LocalCbtHook.CbtEventHandler(WndDestroyed);
25 | m_cbt.WindowActivated += new LocalCbtHook.CbtEventHandler(WndActivated);
26 | }
27 |
28 | public DialogResult Show(string strKey, string strValue, DialogResult dr, string strCheck, string strText, string strTitle, MessageBoxButtons buttons, MessageBoxIcon icon)
29 | {
30 | m_strCheck = strCheck;
31 | m_cbt.Install();
32 | dr = System.Windows.Forms.MessageBox.Show(strText, strTitle, buttons, icon);
33 | m_cbt.Uninstall();
34 |
35 | Properties.Settings.Default[strKey] = m_bCheck;
36 | Properties.Settings.Default.Save();
37 |
38 | return dr;
39 | }
40 |
41 | public DialogResult Show(string strKey, string strValue, DialogResult dr, string strCheck, string strText, string strTitle, MessageBoxButtons buttons)
42 | {
43 | return Show(strKey, strValue, dr, strCheck, strText, strTitle, buttons, MessageBoxIcon.None);
44 | }
45 |
46 | public DialogResult Show(string strKey, string strValue, DialogResult dr, string strCheck, string strText, string strTitle)
47 | {
48 | return Show(strKey, strValue, dr, strCheck, strText, strTitle, MessageBoxButtons.OK, MessageBoxIcon.None);
49 | }
50 |
51 | public DialogResult Show(string strKey, string strValue, DialogResult dr, string strCheck, string strText)
52 | {
53 | return Show(strKey, strValue, dr, strCheck, strText, "", MessageBoxButtons.OK, MessageBoxIcon.None);
54 | }
55 |
56 | private void WndCreated(object sender, CbtEventArgs e)
57 | {
58 | if (e.IsDialogWindow)
59 | {
60 | m_bInit = false;
61 | m_hwnd = e.Handle;
62 | }
63 | }
64 |
65 | private void WndDestroyed(object sender, CbtEventArgs e)
66 | {
67 | if (e.Handle == m_hwnd)
68 | {
69 | m_bInit = false;
70 | m_hwnd = IntPtr.Zero;
71 | if (BST_CHECKED == (int)SendMessage(m_hwndBtn, BM_GETCHECK, IntPtr.Zero, IntPtr.Zero))
72 | m_bCheck = true;
73 | }
74 | }
75 |
76 | private void WndActivated(object sender, CbtEventArgs e)
77 | {
78 | if (m_hwnd != e.Handle)
79 | return;
80 |
81 | // Not the first time
82 | if (m_bInit)
83 | return;
84 | else
85 | m_bInit = true;
86 |
87 | // Get the current font, either from the static text window
88 | // or the message box itself
89 | IntPtr hFont;
90 | IntPtr hwndText = GetDlgItem(m_hwnd, 0xFFFF);
91 | if (hwndText != IntPtr.Zero)
92 | hFont = SendMessage(hwndText, WM_GETFONT, IntPtr.Zero, IntPtr.Zero);
93 | else
94 | hFont = SendMessage(m_hwnd, WM_GETFONT, IntPtr.Zero, IntPtr.Zero);
95 | Font fCur = Font.FromHfont(hFont);
96 |
97 | // Get the x coordinate for the check box. Align it with the icon if possible,
98 | // or one character height in
99 | int x = 0;
100 | IntPtr hwndIcon = GetDlgItem(m_hwnd, 0x0014);
101 | if (hwndIcon != IntPtr.Zero)
102 | {
103 | RECT rcIcon = new RECT();
104 | GetWindowRect(hwndIcon, rcIcon);
105 | POINT pt = new POINT();
106 | pt.x = rcIcon.left;
107 | pt.y = rcIcon.top;
108 | ScreenToClient(m_hwnd, pt);
109 | x = pt.x;
110 | }
111 | else
112 | x = (int)fCur.GetHeight();
113 |
114 | // Get the y coordinate for the check box, which is the bottom of the
115 | // current message box client area
116 | RECT rc = new RECT();
117 | GetClientRect(m_hwnd, rc);
118 | int y = rc.bottom - rc.top + 10;
119 |
120 | // Resize the message box with room for the check box
121 | GetWindowRect(m_hwnd, rc);
122 | MoveWindow(m_hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top + (int)fCur.GetHeight() * 2 + 10, true);
123 |
124 | m_hwndBtn = CreateWindowEx(0, "button", m_strCheck, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP,
125 | x, y, rc.right - rc.left - x, (int)fCur.GetHeight() + 10,
126 | m_hwnd, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
127 |
128 | SendMessage(m_hwndBtn, WM_SETFONT, hFont, new IntPtr(1));
129 | }
130 |
131 | #region Win32 Imports
132 | private const int WS_VISIBLE = 0x10000000;
133 | private const int WS_CHILD = 0x40000000;
134 | private const int WS_TABSTOP = 0x00010000;
135 | private const int WM_SETFONT = 0x00000030;
136 | private const int WM_GETFONT = 0x00000031;
137 | private const int BS_AUTOCHECKBOX = 0x00000003;
138 | private const int BM_GETCHECK = 0x00F0;
139 | private const int BST_CHECKED = 0x0001;
140 |
141 | [DllImport("user32.dll")]
142 | protected static extern void DestroyWindow(IntPtr hwnd);
143 |
144 | [DllImport("user32.dll")]
145 | protected static extern IntPtr GetDlgItem(IntPtr hwnd, int id);
146 |
147 | [DllImport("user32.dll")]
148 | protected static extern int GetWindowRect(IntPtr hwnd, RECT rc);
149 |
150 | [DllImport("user32.dll")]
151 | protected static extern int GetClientRect(IntPtr hwnd, RECT rc);
152 |
153 | [DllImport("user32.dll")]
154 | protected static extern void MoveWindow(IntPtr hwnd, int x, int y, int nWidth, int nHeight, bool bRepaint);
155 |
156 | [DllImport("user32.dll")]
157 | protected static extern int ScreenToClient(IntPtr hwnd, POINT pt);
158 |
159 | [DllImport("user32.dll", EntryPoint = "MessageBox")]
160 | protected static extern int _MessageBox(IntPtr hwnd, string text, string caption,
161 | int options);
162 |
163 | [DllImport("user32.dll")]
164 | protected static extern IntPtr SendMessage(IntPtr hwnd,
165 | int msg, IntPtr wParam, IntPtr lParam);
166 |
167 | [DllImport("user32.dll")]
168 | protected static extern IntPtr CreateWindowEx(
169 | int dwExStyle, // extended window style
170 | string lpClassName, // registered class name
171 | string lpWindowName, // window name
172 | int dwStyle, // window style
173 | int x, // horizontal position of window
174 | int y, // vertical position of window
175 | int nWidth, // window width
176 | int nHeight, // window height
177 | IntPtr hWndParent, // handle to parent or owner window
178 | IntPtr hMenu, // menu handle or child identifier
179 | IntPtr hInstance, // handle to application instance
180 | IntPtr lpParam // window-creation data
181 | );
182 |
183 | [StructLayout(LayoutKind.Sequential)]
184 | public class POINT
185 | {
186 | public int x;
187 | public int y;
188 | }
189 |
190 | [StructLayout(LayoutKind.Sequential)]
191 | public class RECT
192 | {
193 | public int left;
194 | public int top;
195 | public int right;
196 | public int bottom;
197 | }
198 |
199 | #endregion
200 | }
201 | }
202 |
--------------------------------------------------------------------------------
/LEDControl/OpenLibSys.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------------
2 | // Author : hiyohiyo
3 | // Mail : hiyohiyo@crystalmark.info
4 | // Web : http://openlibsys.org/
5 | // License : The modified BSD license
6 | //
7 | // Copyright 2007-2009 OpenLibSys.org. All rights reserved.
8 | //-----------------------------------------------------------------------------
9 | // This is support library for WinRing0 1.3.x.
10 |
11 | using System;
12 | using System.Runtime.InteropServices;
13 |
14 | namespace LEDControl
15 | {
16 | public class Ols : IDisposable
17 | {
18 | const string dllNameX64 = "WinRing0x64.dll";
19 | const string dllName = "WinRing0.dll";
20 |
21 | // for this support library
22 | public enum Status
23 | {
24 | NO_ERROR = 0,
25 | DLL_NOT_FOUND = 1,
26 | DLL_INCORRECT_VERSION = 2,
27 | DLL_INITIALIZE_ERROR = 3,
28 | }
29 |
30 | // for WinRing0
31 | public enum OlsDllStatus
32 | {
33 | OLS_DLL_NO_ERROR = 0,
34 | OLS_DLL_UNSUPPORTED_PLATFORM = 1,
35 | OLS_DLL_DRIVER_NOT_LOADED = 2,
36 | OLS_DLL_DRIVER_NOT_FOUND = 3,
37 | OLS_DLL_DRIVER_UNLOADED = 4,
38 | OLS_DLL_DRIVER_NOT_LOADED_ON_NETWORK = 5,
39 | OLS_DLL_UNKNOWN_ERROR = 9
40 | }
41 |
42 | // for WinRing0
43 | public enum OlsDriverType
44 | {
45 | OLS_DRIVER_TYPE_UNKNOWN = 0,
46 | OLS_DRIVER_TYPE_WIN_9X = 1,
47 | OLS_DRIVER_TYPE_WIN_NT = 2,
48 | OLS_DRIVER_TYPE_WIN_NT4 = 3, // Obsolete
49 | OLS_DRIVER_TYPE_WIN_NT_X64 = 4,
50 | OLS_DRIVER_TYPE_WIN_NT_IA64 = 5
51 | }
52 |
53 | // for WinRing0
54 | public enum OlsErrorPci : uint
55 | {
56 | OLS_ERROR_PCI_BUS_NOT_EXIST = 0xE0000001,
57 | OLS_ERROR_PCI_NO_DEVICE = 0xE0000002,
58 | OLS_ERROR_PCI_WRITE_CONFIG = 0xE0000003,
59 | OLS_ERROR_PCI_READ_CONFIG = 0xE0000004
60 | }
61 |
62 | // Bus Number, Device Number and Function Number to PCI Device Address
63 | public uint PciBusDevFunc(uint bus, uint dev, uint func)
64 | {
65 | return ((bus & 0xFF) << 8) | ((dev & 0x1F) << 3) | (func & 7);
66 | }
67 |
68 | // PCI Device Address to Bus Number
69 | public uint PciGetBus(uint address)
70 | {
71 | return ((address >> 8) & 0xFF);
72 | }
73 |
74 | // PCI Device Address to Device Number
75 | public uint PciGetDev(uint address)
76 | {
77 | return ((address >> 3) & 0x1F);
78 | }
79 |
80 | // PCI Device Address to Function Number
81 | public uint PciGetFunc(uint address)
82 | {
83 | return (address & 7);
84 | }
85 |
86 | [DllImport("kernel32")]
87 | public extern static IntPtr LoadLibrary(string lpFileName);
88 |
89 |
90 | [DllImport("kernel32", SetLastError = true)]
91 | private static extern bool FreeLibrary(IntPtr hModule);
92 |
93 | [DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = false)]
94 | private static extern IntPtr GetProcAddress(IntPtr hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);
95 |
96 | private IntPtr module = IntPtr.Zero;
97 | private uint status = (uint)Status.NO_ERROR;
98 |
99 | public Ols()
100 | {
101 | string fileName;
102 |
103 | if (System.IntPtr.Size == 8)
104 | {
105 | fileName = dllNameX64;
106 | }
107 | else
108 | {
109 | fileName = dllName;
110 | }
111 |
112 | module = Ols.LoadLibrary(fileName);
113 | if (module == IntPtr.Zero)
114 | {
115 | status = (uint)Status.DLL_NOT_FOUND;
116 | }
117 | else
118 | {
119 | GetDllStatus = (_GetDllStatus)GetDelegate("GetDllStatus", typeof(_GetDllStatus));
120 | GetDllVersion = (_GetDllVersion)GetDelegate("GetDllVersion", typeof(_GetDllVersion));
121 | GetDriverVersion = (_GetDriverVersion)GetDelegate("GetDriverVersion", typeof(_GetDriverVersion));
122 | GetDriverType = (_GetDriverType)GetDelegate("GetDriverType", typeof(_GetDriverType));
123 |
124 | InitializeOls = (_InitializeOls)GetDelegate("InitializeOls", typeof(_InitializeOls));
125 | DeinitializeOls = (_DeinitializeOls)GetDelegate("DeinitializeOls", typeof(_DeinitializeOls));
126 |
127 | IsCpuid = (_IsCpuid)GetDelegate("IsCpuid", typeof(_IsCpuid));
128 | IsMsr = (_IsMsr)GetDelegate("IsMsr", typeof(_IsMsr));
129 | IsTsc = (_IsTsc)GetDelegate("IsTsc", typeof(_IsTsc));
130 | Hlt = (_Hlt)GetDelegate("Hlt", typeof(_Hlt));
131 | HltTx = (_HltTx)GetDelegate("HltTx", typeof(_HltTx));
132 | HltPx = (_HltPx)GetDelegate("HltPx", typeof(_HltPx));
133 | Rdmsr = (_Rdmsr)GetDelegate("Rdmsr", typeof(_Rdmsr));
134 | RdmsrTx = (_RdmsrTx)GetDelegate("RdmsrTx", typeof(_RdmsrTx));
135 | RdmsrPx = (_RdmsrPx)GetDelegate("RdmsrPx", typeof(_RdmsrPx));
136 | Wrmsr = (_Wrmsr)GetDelegate("Wrmsr", typeof(_Wrmsr));
137 | WrmsrTx = (_WrmsrTx)GetDelegate("WrmsrTx", typeof(_WrmsrTx));
138 | WrmsrPx = (_WrmsrPx)GetDelegate("WrmsrPx", typeof(_WrmsrPx));
139 | Rdpmc = (_Rdpmc)GetDelegate("Rdpmc", typeof(_Rdpmc));
140 | RdpmcTx = (_RdpmcTx)GetDelegate("RdpmcTx", typeof(_RdpmcTx));
141 | RdpmcPx = (_RdpmcPx)GetDelegate("RdpmcPx", typeof(_RdpmcPx));
142 | Cpuid = (_Cpuid)GetDelegate("Cpuid", typeof(_Cpuid));
143 | CpuidTx = (_CpuidTx)GetDelegate("CpuidTx", typeof(_CpuidTx));
144 | CpuidPx = (_CpuidPx)GetDelegate("CpuidPx", typeof(_CpuidPx));
145 | Rdtsc = (_Rdtsc)GetDelegate("Rdtsc", typeof(_Rdtsc));
146 | RdtscTx = (_RdtscTx)GetDelegate("RdtscTx", typeof(_RdtscTx));
147 | RdtscPx = (_RdtscPx)GetDelegate("RdtscPx", typeof(_RdtscPx));
148 |
149 | ReadIoPortByte = (_ReadIoPortByte)GetDelegate("ReadIoPortByte", typeof(_ReadIoPortByte));
150 | ReadIoPortWord = (_ReadIoPortWord)GetDelegate("ReadIoPortWord", typeof(_ReadIoPortWord));
151 | ReadIoPortDword = (_ReadIoPortDword)GetDelegate("ReadIoPortDword", typeof(_ReadIoPortDword));
152 | ReadIoPortByteEx = (_ReadIoPortByteEx)GetDelegate("ReadIoPortByteEx", typeof(_ReadIoPortByteEx));
153 | ReadIoPortWordEx = (_ReadIoPortWordEx)GetDelegate("ReadIoPortWordEx", typeof(_ReadIoPortWordEx));
154 | ReadIoPortDwordEx = (_ReadIoPortDwordEx)GetDelegate("ReadIoPortDwordEx", typeof(_ReadIoPortDwordEx));
155 |
156 | WriteIoPortByte = (_WriteIoPortByte)GetDelegate("WriteIoPortByte", typeof(_WriteIoPortByte));
157 | WriteIoPortWord = (_WriteIoPortWord)GetDelegate("WriteIoPortWord", typeof(_WriteIoPortWord));
158 | WriteIoPortDword = (_WriteIoPortDword)GetDelegate("WriteIoPortDword", typeof(_WriteIoPortDword));
159 | WriteIoPortByteEx = (_WriteIoPortByteEx)GetDelegate("WriteIoPortByteEx", typeof(_WriteIoPortByteEx));
160 | WriteIoPortWordEx = (_WriteIoPortWordEx)GetDelegate("WriteIoPortWordEx", typeof(_WriteIoPortWordEx));
161 | WriteIoPortDwordEx = (_WriteIoPortDwordEx)GetDelegate("WriteIoPortDwordEx", typeof(_WriteIoPortDwordEx));
162 |
163 | SetPciMaxBusIndex = (_SetPciMaxBusIndex)GetDelegate("SetPciMaxBusIndex", typeof(_SetPciMaxBusIndex));
164 | ReadPciConfigByte = (_ReadPciConfigByte)GetDelegate("ReadPciConfigByte", typeof(_ReadPciConfigByte));
165 | ReadPciConfigWord = (_ReadPciConfigWord)GetDelegate("ReadPciConfigWord", typeof(_ReadPciConfigWord));
166 | ReadPciConfigDword = (_ReadPciConfigDword)GetDelegate("ReadPciConfigDword", typeof(_ReadPciConfigDword));
167 | ReadPciConfigByteEx = (_ReadPciConfigByteEx)GetDelegate("ReadPciConfigByteEx", typeof(_ReadPciConfigByteEx));
168 | ReadPciConfigWordEx = (_ReadPciConfigWordEx)GetDelegate("ReadPciConfigWordEx", typeof(_ReadPciConfigWordEx));
169 | ReadPciConfigDwordEx = (_ReadPciConfigDwordEx)GetDelegate("ReadPciConfigDwordEx", typeof(_ReadPciConfigDwordEx));
170 | WritePciConfigByte = (_WritePciConfigByte)GetDelegate("WritePciConfigByte", typeof(_WritePciConfigByte));
171 | WritePciConfigWord = (_WritePciConfigWord)GetDelegate("WritePciConfigWord", typeof(_WritePciConfigWord));
172 | WritePciConfigDword = (_WritePciConfigDword)GetDelegate("WritePciConfigDword", typeof(_WritePciConfigDword));
173 | WritePciConfigByteEx = (_WritePciConfigByteEx)GetDelegate("WritePciConfigByteEx", typeof(_WritePciConfigByteEx));
174 | WritePciConfigWordEx = (_WritePciConfigWordEx)GetDelegate("WritePciConfigWordEx", typeof(_WritePciConfigWordEx));
175 | WritePciConfigDwordEx = (_WritePciConfigDwordEx)GetDelegate("WritePciConfigDwordEx", typeof(_WritePciConfigDwordEx));
176 | FindPciDeviceById = (_FindPciDeviceById)GetDelegate("FindPciDeviceById", typeof(_FindPciDeviceById));
177 | FindPciDeviceByClass = (_FindPciDeviceByClass)GetDelegate("FindPciDeviceByClass", typeof(_FindPciDeviceByClass));
178 |
179 | #if _PHYSICAL_MEMORY_SUPPORT
180 | ReadDmiMemory = (_ReadDmiMemory)GetDelegate("ReadDmiMemory", typeof(_ReadDmiMemory));
181 | ReadPhysicalMemory = (_ReadPhysicalMemory)GetDelegate("ReadPhysicalMemory", typeof(_ReadPhysicalMemory));
182 | WritePhysicalMemory = (_WritePhysicalMemory)GetDelegate("WritePhysicalMemory", typeof(_WritePhysicalMemory));
183 | #endif
184 | if (!(
185 | GetDllStatus != null
186 | && GetDllVersion != null
187 | && GetDriverVersion != null
188 | && GetDriverType != null
189 | && InitializeOls != null
190 | && DeinitializeOls != null
191 | && IsCpuid != null
192 | && IsMsr != null
193 | && IsTsc != null
194 | && Hlt != null
195 | && HltTx != null
196 | && HltPx != null
197 | && Rdmsr != null
198 | && RdmsrTx != null
199 | && RdmsrPx != null
200 | && Wrmsr != null
201 | && WrmsrTx != null
202 | && WrmsrPx != null
203 | && Rdpmc != null
204 | && RdpmcTx != null
205 | && RdpmcPx != null
206 | && Cpuid != null
207 | && CpuidTx != null
208 | && CpuidPx != null
209 | && Rdtsc != null
210 | && RdtscTx != null
211 | && RdtscPx != null
212 | && ReadIoPortByte != null
213 | && ReadIoPortWord != null
214 | && ReadIoPortDword != null
215 | && ReadIoPortByteEx != null
216 | && ReadIoPortWordEx != null
217 | && ReadIoPortDwordEx != null
218 | && WriteIoPortByte != null
219 | && WriteIoPortWord != null
220 | && WriteIoPortDword != null
221 | && WriteIoPortByteEx != null
222 | && WriteIoPortWordEx != null
223 | && WriteIoPortDwordEx != null
224 | && SetPciMaxBusIndex != null
225 | && ReadPciConfigByte != null
226 | && ReadPciConfigWord != null
227 | && ReadPciConfigDword != null
228 | && ReadPciConfigByteEx != null
229 | && ReadPciConfigWordEx != null
230 | && ReadPciConfigDwordEx != null
231 | && WritePciConfigByte != null
232 | && WritePciConfigWord != null
233 | && WritePciConfigDword != null
234 | && WritePciConfigByteEx != null
235 | && WritePciConfigWordEx != null
236 | && WritePciConfigDwordEx != null
237 | && FindPciDeviceById != null
238 | && FindPciDeviceByClass != null
239 | #if _PHYSICAL_MEMORY_SUPPORT
240 | && ReadDmiMemory != null
241 | && ReadPhysicalMemory != null
242 | && WritePhysicalMemory != null
243 | #endif
244 | ))
245 | {
246 | status = (uint)Status.DLL_INCORRECT_VERSION;
247 | }
248 |
249 | if (InitializeOls() == 0)
250 | {
251 | status = (uint)Status.DLL_INITIALIZE_ERROR;
252 | }
253 | }
254 | }
255 |
256 | public uint GetStatus()
257 | {
258 | return status;
259 | }
260 |
261 | public void Dispose()
262 | {
263 | if (module != IntPtr.Zero)
264 | {
265 | DeinitializeOls();
266 | Ols.FreeLibrary(module);
267 | module = IntPtr.Zero;
268 | }
269 | }
270 |
271 | public Delegate GetDelegate(string procName, Type delegateType)
272 | {
273 | IntPtr ptr = GetProcAddress(module, procName);
274 | if (ptr != IntPtr.Zero)
275 | {
276 | Delegate d = Marshal.GetDelegateForFunctionPointer(ptr, delegateType);
277 | return d;
278 | }
279 |
280 | int result = Marshal.GetHRForLastWin32Error();
281 | throw Marshal.GetExceptionForHR(result);
282 | }
283 |
284 | //-----------------------------------------------------------------------------
285 | // DLL Information
286 | //-----------------------------------------------------------------------------
287 | public delegate uint _GetDllStatus();
288 | public delegate uint _GetDllVersion(ref byte major, ref byte minor, ref byte revision, ref byte release);
289 | public delegate uint _GetDriverVersion(ref byte major, ref byte minor, ref byte revision, ref byte release);
290 | public delegate uint _GetDriverType();
291 |
292 | public delegate int _InitializeOls();
293 | public delegate void _DeinitializeOls();
294 |
295 | public _GetDllStatus GetDllStatus = null;
296 | public _GetDriverType GetDriverType = null;
297 | public _GetDllVersion GetDllVersion = null;
298 | public _GetDriverVersion GetDriverVersion = null;
299 |
300 | public _InitializeOls InitializeOls = null;
301 | public _DeinitializeOls DeinitializeOls = null;
302 |
303 | //-----------------------------------------------------------------------------
304 | // CPU
305 | //-----------------------------------------------------------------------------
306 | public delegate int _IsCpuid();
307 | public delegate int _IsMsr();
308 | public delegate int _IsTsc();
309 | public delegate int _Hlt();
310 | public delegate int _HltTx(UIntPtr threadAffinityMask);
311 | public delegate int _HltPx(UIntPtr processAffinityMask);
312 | public delegate int _Rdmsr(uint index, ref uint eax, ref uint edx);
313 | public delegate int _RdmsrTx(uint index, ref uint eax, ref uint edx, UIntPtr threadAffinityMask);
314 | public delegate int _RdmsrPx(uint index, ref uint eax, ref uint edx, UIntPtr processAffinityMask);
315 | public delegate int _Wrmsr(uint index, uint eax, uint edx);
316 | public delegate int _WrmsrTx(uint index, uint eax, uint edx, UIntPtr threadAffinityMask);
317 | public delegate int _WrmsrPx(uint index, uint eax, uint edx, UIntPtr processAffinityMask);
318 | public delegate int _Rdpmc(uint index, ref uint eax, ref uint edx);
319 | public delegate int _RdpmcTx(uint index, ref uint eax, ref uint edx, UIntPtr threadAffinityMask);
320 | public delegate int _RdpmcPx(uint index, ref uint eax, ref uint edx, UIntPtr processAffinityMask);
321 | public delegate int _Cpuid(uint index, ref uint eax, ref uint ebx, ref uint ecx, ref uint edx);
322 | public delegate int _CpuidTx(uint index, ref uint eax, ref uint ebx, ref uint ecx, ref uint edx, UIntPtr threadAffinityMask);
323 | public delegate int _CpuidPx(uint index, ref uint eax, ref uint ebx, ref uint ecx, ref uint edx, UIntPtr processAffinityMask);
324 | public delegate int _Rdtsc(ref uint eax, ref uint edx);
325 | public delegate int _RdtscTx(ref uint eax, ref uint edx, UIntPtr threadAffinityMask);
326 | public delegate int _RdtscPx(ref uint eax, ref uint edx, UIntPtr processAffinityMask);
327 |
328 | public _IsCpuid IsCpuid = null;
329 | public _IsMsr IsMsr = null;
330 | public _IsTsc IsTsc = null;
331 | public _Hlt Hlt = null;
332 | public _HltTx HltTx = null;
333 | public _HltPx HltPx = null;
334 | public _Rdmsr Rdmsr = null;
335 | public _RdmsrTx RdmsrTx = null;
336 | public _RdmsrPx RdmsrPx = null;
337 | public _Wrmsr Wrmsr = null;
338 | public _WrmsrTx WrmsrTx = null;
339 | public _WrmsrPx WrmsrPx = null;
340 | public _Rdpmc Rdpmc = null;
341 | public _RdpmcTx RdpmcTx = null;
342 | public _RdpmcPx RdpmcPx = null;
343 | public _Cpuid Cpuid = null;
344 | public _CpuidTx CpuidTx = null;
345 | public _CpuidPx CpuidPx = null;
346 | public _Rdtsc Rdtsc = null;
347 | public _RdtscTx RdtscTx = null;
348 | public _RdtscPx RdtscPx = null;
349 |
350 | //-----------------------------------------------------------------------------
351 | // I/O
352 | //-----------------------------------------------------------------------------
353 | public delegate byte _ReadIoPortByte(ushort port);
354 | public delegate ushort _ReadIoPortWord(ushort port);
355 | public delegate uint _ReadIoPortDword(ushort port);
356 | public _ReadIoPortByte ReadIoPortByte;
357 | public _ReadIoPortWord ReadIoPortWord;
358 | public _ReadIoPortDword ReadIoPortDword;
359 |
360 | public delegate int _ReadIoPortByteEx(ushort port, ref byte value);
361 | public delegate int _ReadIoPortWordEx(ushort port, ref ushort value);
362 | public delegate int _ReadIoPortDwordEx(ushort port, ref uint value);
363 | public _ReadIoPortByteEx ReadIoPortByteEx;
364 | public _ReadIoPortWordEx ReadIoPortWordEx;
365 | public _ReadIoPortDwordEx ReadIoPortDwordEx;
366 |
367 | public delegate void _WriteIoPortByte(ushort port, byte value);
368 | public delegate void _WriteIoPortWord(ushort port, ushort value);
369 | public delegate void _WriteIoPortDword(ushort port, uint value);
370 | public _WriteIoPortByte WriteIoPortByte;
371 | public _WriteIoPortWord WriteIoPortWord;
372 | public _WriteIoPortDword WriteIoPortDword;
373 |
374 | public delegate int _WriteIoPortByteEx(ushort port, byte value);
375 | public delegate int _WriteIoPortWordEx(ushort port, ushort value);
376 | public delegate int _WriteIoPortDwordEx(ushort port, uint value);
377 | public _WriteIoPortByteEx WriteIoPortByteEx;
378 | public _WriteIoPortWordEx WriteIoPortWordEx;
379 | public _WriteIoPortDwordEx WriteIoPortDwordEx;
380 |
381 | //-----------------------------------------------------------------------------
382 | // PCI
383 | //-----------------------------------------------------------------------------
384 | public delegate void _SetPciMaxBusIndex(byte max);
385 | public _SetPciMaxBusIndex SetPciMaxBusIndex;
386 |
387 | public delegate byte _ReadPciConfigByte(uint pciAddress, byte regAddress);
388 | public delegate ushort _ReadPciConfigWord(uint pciAddress, byte regAddress);
389 | public delegate uint _ReadPciConfigDword(uint pciAddress, byte regAddress);
390 | public _ReadPciConfigByte ReadPciConfigByte;
391 | public _ReadPciConfigWord ReadPciConfigWord;
392 | public _ReadPciConfigDword ReadPciConfigDword;
393 |
394 | public delegate int _ReadPciConfigByteEx(uint pciAddress, uint regAddress, ref byte value);
395 | public delegate int _ReadPciConfigWordEx(uint pciAddress, uint regAddress, ref ushort value);
396 | public delegate int _ReadPciConfigDwordEx(uint pciAddress, uint regAddress, ref uint value);
397 | public _ReadPciConfigByteEx ReadPciConfigByteEx;
398 | public _ReadPciConfigWordEx ReadPciConfigWordEx;
399 | public _ReadPciConfigDwordEx ReadPciConfigDwordEx;
400 |
401 | public delegate void _WritePciConfigByte(uint pciAddress, byte regAddress, byte value);
402 | public delegate void _WritePciConfigWord(uint pciAddress, byte regAddress, ushort value);
403 | public delegate void _WritePciConfigDword(uint pciAddress, byte regAddress, uint value);
404 | public _WritePciConfigByte WritePciConfigByte;
405 | public _WritePciConfigWord WritePciConfigWord;
406 | public _WritePciConfigDword WritePciConfigDword;
407 |
408 | public delegate int _WritePciConfigByteEx(uint pciAddress, uint regAddress, byte value);
409 | public delegate int _WritePciConfigWordEx(uint pciAddress, uint regAddress, ushort value);
410 | public delegate int _WritePciConfigDwordEx(uint pciAddress, uint regAddress, uint value);
411 | public _WritePciConfigByteEx WritePciConfigByteEx;
412 | public _WritePciConfigWordEx WritePciConfigWordEx;
413 | public _WritePciConfigDwordEx WritePciConfigDwordEx;
414 |
415 | public delegate uint _FindPciDeviceById(ushort vendorId, ushort deviceId, byte index);
416 | public delegate uint _FindPciDeviceByClass(byte baseClass, byte subClass, byte programIf, byte index);
417 | public _FindPciDeviceById FindPciDeviceById;
418 | public _FindPciDeviceByClass FindPciDeviceByClass;
419 |
420 | //-----------------------------------------------------------------------------
421 | // Physical Memory (unsafe)
422 | //-----------------------------------------------------------------------------
423 | #if _PHYSICAL_MEMORY_SUPPORT
424 | public unsafe delegate uint _ReadDmiMemory(byte* buffer, uint count, uint unitSize);
425 | public _ReadDmiMemory ReadDmiMemory;
426 |
427 | public unsafe delegate uint _ReadPhysicalMemory(UIntPtr address, byte* buffer, uint count, uint unitSize);
428 | public unsafe delegate uint _WritePhysicalMemory(UIntPtr address, byte* buffer, uint count, uint unitSize);
429 |
430 | public _ReadPhysicalMemory ReadPhysicalMemory;
431 | public _WritePhysicalMemory WritePhysicalMemory;
432 | #endif
433 | }
434 | }
435 |
--------------------------------------------------------------------------------
/LEDControl/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using System.Runtime.InteropServices;
6 | using System.Threading.Tasks;
7 | using System.Windows.Forms;
8 |
9 | namespace LEDControl
10 | {
11 | static class Program
12 | {
13 | [DllImport("user32.dll", SetLastError = true)]
14 | static extern bool SetProcessDPIAware();
15 | ///
16 | /// The main entry point for the application.
17 | ///
18 | [STAThread]
19 | static void Main()
20 | {
21 | SetProcessDPIAware();
22 |
23 | const string resource1 = "LEDControl.CoreAudioApi.dll";
24 | const string resource2 = "LEDControl.Microsoft.WindowsAPICodePack.dll";
25 | const string resource3 = "LEDControl.CbtHook.dll";
26 | const string resource4 = "LEDControl.WindowsHook.dll";
27 | EmbeddedAssembly.Load(resource1, "CoreAudioApi.dll");
28 | EmbeddedAssembly.Load(resource2, "Microsoft.WindowsAPICodePack.dll");
29 | EmbeddedAssembly.Load(resource3, "CbtHook.dll");
30 | EmbeddedAssembly.Load(resource4, "WindowsHook.dll");
31 | AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
32 |
33 | Application.EnableVisualStyles();
34 | Application.SetCompatibleTextRenderingDefault(false);
35 |
36 | if (Properties.Settings.Default.UpgradeRequired)
37 | {
38 | Properties.Settings.Default.Upgrade();
39 | Properties.Settings.Default.UpgradeRequired = false;
40 | Properties.Settings.Default.Save();
41 | }
42 |
43 | if ((Properties.Settings.Default.FirstRun || Control.ModifierKeys == Keys.Shift) && !Environment.GetCommandLineArgs().Contains("driver"))
44 | {
45 | Welcome w = new Welcome();
46 | if (w.ShowDialog() == DialogResult.Cancel)
47 | {
48 | Environment.Exit(0);
49 | }
50 | }
51 |
52 | Application.Run(new Form1());
53 | }
54 | static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
55 | {
56 | return EmbeddedAssembly.Get(args.Name);
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/LEDControl/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ThinkPad LEDs Control")]
9 | [assembly: AssemblyDescription("ThinkPad LEDs Control")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("ValiNet (Valentin-Gabriel Radu)")]
12 | [assembly: AssemblyProduct("ThinkPad LEDs Control")]
13 | [assembly: AssemblyCopyright("Copyright © 2006-2016 ValiNet (Valentin-Gabriel Radu)")]
14 | [assembly: AssemblyTrademark("ThinkPad LEDs Control")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c3ab624f-5637-42c4-9e84-55405f14ae80")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.6.0.5")]
36 | [assembly: AssemblyFileVersion("1.6.0.5")]
37 |
--------------------------------------------------------------------------------
/LEDControl/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace LEDControl.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LEDControl.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
65 | ///
66 | internal static System.Drawing.Icon IdleIcon {
67 | get {
68 | object obj = ResourceManager.GetObject("IdleIcon", resourceCulture);
69 | return ((System.Drawing.Icon)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-16"?>
75 | ///<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
76 | /// <RegistrationInfo>
77 | /// <Date>2015-01-01T00:00:00</Date>
78 | /// <Author>.
79 | ///
80 | internal static string part1 {
81 | get {
82 | return ResourceManager.GetString("part1", resourceCulture);
83 | }
84 | }
85 |
86 | ///
87 | /// Looks up a localized string similar to </Author>
88 | /// </RegistrationInfo>
89 | /// <Triggers>
90 | /// <LogonTrigger>
91 | /// <StartBoundary>2015-01-27T18:30:00</StartBoundary>
92 | /// <Enabled>true</Enabled>
93 | /// </LogonTrigger>
94 | /// </Triggers>
95 | /// <Principals>
96 | /// <Principal id="Author">
97 | /// <UserId>.
98 | ///
99 | internal static string part2 {
100 | get {
101 | return ResourceManager.GetString("part2", resourceCulture);
102 | }
103 | }
104 |
105 | ///
106 | /// Looks up a localized string similar to </UserId>
107 | /// <LogonType>InteractiveToken</LogonType>
108 | /// <RunLevel>HighestAvailable</RunLevel>
109 | /// </Principal>
110 | /// </Principals>
111 | /// <Settings>
112 | /// <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
113 | /// <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
114 | /// <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
115 | /// <AllowHardTerminate>true</AllowHardTerminate>
116 | /// <StartWhenAvailable>false</StartWhenAvailable>
117 | /// <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable [rest of string was truncated]";.
118 | ///
119 | internal static string part3 {
120 | get {
121 | return ResourceManager.GetString("part3", resourceCulture);
122 | }
123 | }
124 |
125 | ///
126 | /// Looks up a localized string similar to "</Command>
127 | /// <Arguments>minimize</Arguments>
128 | /// </Exec>
129 | /// </Actions>
130 | ///</Task>.
131 | ///
132 | internal static string part4 {
133 | get {
134 | return ResourceManager.GetString("part4", resourceCulture);
135 | }
136 | }
137 |
138 | ///
139 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
140 | ///
141 | internal static System.Drawing.Icon ReadIcon {
142 | get {
143 | object obj = ResourceManager.GetObject("ReadIcon", resourceCulture);
144 | return ((System.Drawing.Icon)(obj));
145 | }
146 | }
147 |
148 | ///
149 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
150 | ///
151 | internal static System.Drawing.Icon RWIcon {
152 | get {
153 | object obj = ResourceManager.GetObject("RWIcon", resourceCulture);
154 | return ((System.Drawing.Icon)(obj));
155 | }
156 | }
157 |
158 | ///
159 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
160 | ///
161 | internal static System.Drawing.Icon WriteIcon {
162 | get {
163 | object obj = ResourceManager.GetObject("WriteIcon", resourceCulture);
164 | return ((System.Drawing.Icon)(obj));
165 | }
166 | }
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/LEDControl/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\IdleIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\ReadIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\RWIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | ..\Resources\WriteIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | ..\part1.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
135 |
136 |
137 | ..\part2.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
138 |
139 |
140 | ..\part3.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
141 |
142 |
143 | ..\part4.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
144 |
145 |
--------------------------------------------------------------------------------
/LEDControl/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace LEDControl.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
29 | public bool HDDReadPower {
30 | get {
31 | return ((bool)(this["HDDReadPower"]));
32 | }
33 | set {
34 | this["HDDReadPower"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
41 | public bool HDDWritePower {
42 | get {
43 | return ((bool)(this["HDDWritePower"]));
44 | }
45 | set {
46 | this["HDDWritePower"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
53 | public bool HDDReadDot {
54 | get {
55 | return ((bool)(this["HDDReadDot"]));
56 | }
57 | set {
58 | this["HDDReadDot"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
65 | public bool HDDWriteDot {
66 | get {
67 | return ((bool)(this["HDDWriteDot"]));
68 | }
69 | set {
70 | this["HDDWriteDot"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
77 | public bool HDDReadMicrophone {
78 | get {
79 | return ((bool)(this["HDDReadMicrophone"]));
80 | }
81 | set {
82 | this["HDDReadMicrophone"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
89 | public bool HDDWriteMicrophone {
90 | get {
91 | return ((bool)(this["HDDWriteMicrophone"]));
92 | }
93 | set {
94 | this["HDDWriteMicrophone"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
101 | public bool HDDReadSleep {
102 | get {
103 | return ((bool)(this["HDDReadSleep"]));
104 | }
105 | set {
106 | this["HDDReadSleep"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
113 | public bool HDDWriteSleep {
114 | get {
115 | return ((bool)(this["HDDWriteSleep"]));
116 | }
117 | set {
118 | this["HDDWriteSleep"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
125 | public bool CLPower {
126 | get {
127 | return ((bool)(this["CLPower"]));
128 | }
129 | set {
130 | this["CLPower"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
137 | public bool CLDot {
138 | get {
139 | return ((bool)(this["CLDot"]));
140 | }
141 | set {
142 | this["CLDot"] = value;
143 | }
144 | }
145 |
146 | [global::System.Configuration.UserScopedSettingAttribute()]
147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
148 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
149 | public bool CLMicrophone {
150 | get {
151 | return ((bool)(this["CLMicrophone"]));
152 | }
153 | set {
154 | this["CLMicrophone"] = value;
155 | }
156 | }
157 |
158 | [global::System.Configuration.UserScopedSettingAttribute()]
159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
160 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
161 | public bool CLSleep {
162 | get {
163 | return ((bool)(this["CLSleep"]));
164 | }
165 | set {
166 | this["CLSleep"] = value;
167 | }
168 | }
169 |
170 | [global::System.Configuration.UserScopedSettingAttribute()]
171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
172 | [global::System.Configuration.DefaultSettingValueAttribute("100")]
173 | public int CapsLockDelay {
174 | get {
175 | return ((int)(this["CapsLockDelay"]));
176 | }
177 | set {
178 | this["CapsLockDelay"] = value;
179 | }
180 | }
181 |
182 | [global::System.Configuration.UserScopedSettingAttribute()]
183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
184 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
185 | public bool HDDDisable {
186 | get {
187 | return ((bool)(this["HDDDisable"]));
188 | }
189 | set {
190 | this["HDDDisable"] = value;
191 | }
192 | }
193 |
194 | [global::System.Configuration.UserScopedSettingAttribute()]
195 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
196 | [global::System.Configuration.DefaultSettingValueAttribute("1")]
197 | public int HDDDelay {
198 | get {
199 | return ((int)(this["HDDDelay"]));
200 | }
201 | set {
202 | this["HDDDelay"] = value;
203 | }
204 | }
205 |
206 | [global::System.Configuration.UserScopedSettingAttribute()]
207 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
208 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
209 | public bool NLDot {
210 | get {
211 | return ((bool)(this["NLDot"]));
212 | }
213 | set {
214 | this["NLDot"] = value;
215 | }
216 | }
217 |
218 | [global::System.Configuration.UserScopedSettingAttribute()]
219 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
220 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
221 | public bool NLPower {
222 | get {
223 | return ((bool)(this["NLPower"]));
224 | }
225 | set {
226 | this["NLPower"] = value;
227 | }
228 | }
229 |
230 | [global::System.Configuration.UserScopedSettingAttribute()]
231 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
232 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
233 | public bool NLMicrophone {
234 | get {
235 | return ((bool)(this["NLMicrophone"]));
236 | }
237 | set {
238 | this["NLMicrophone"] = value;
239 | }
240 | }
241 |
242 | [global::System.Configuration.UserScopedSettingAttribute()]
243 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
244 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
245 | public bool NLSleep {
246 | get {
247 | return ((bool)(this["NLSleep"]));
248 | }
249 | set {
250 | this["NLSleep"] = value;
251 | }
252 | }
253 |
254 | [global::System.Configuration.UserScopedSettingAttribute()]
255 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
256 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
257 | public bool RememberKBD {
258 | get {
259 | return ((bool)(this["RememberKBD"]));
260 | }
261 | set {
262 | this["RememberKBD"] = value;
263 | }
264 | }
265 |
266 | [global::System.Configuration.UserScopedSettingAttribute()]
267 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
268 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
269 | public int KBDLevel {
270 | get {
271 | return ((int)(this["KBDLevel"]));
272 | }
273 | set {
274 | this["KBDLevel"] = value;
275 | }
276 | }
277 |
278 | [global::System.Configuration.UserScopedSettingAttribute()]
279 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
280 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
281 | public bool LightOffWhileFS {
282 | get {
283 | return ((bool)(this["LightOffWhileFS"]));
284 | }
285 | set {
286 | this["LightOffWhileFS"] = value;
287 | }
288 | }
289 |
290 | [global::System.Configuration.UserScopedSettingAttribute()]
291 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
292 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
293 | public bool HDDReadFn {
294 | get {
295 | return ((bool)(this["HDDReadFn"]));
296 | }
297 | set {
298 | this["HDDReadFn"] = value;
299 | }
300 | }
301 |
302 | [global::System.Configuration.UserScopedSettingAttribute()]
303 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
304 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
305 | public bool HDDWriteFn {
306 | get {
307 | return ((bool)(this["HDDWriteFn"]));
308 | }
309 | set {
310 | this["HDDWriteFn"] = value;
311 | }
312 | }
313 |
314 | [global::System.Configuration.UserScopedSettingAttribute()]
315 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
316 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
317 | public bool CLFn {
318 | get {
319 | return ((bool)(this["CLFn"]));
320 | }
321 | set {
322 | this["CLFn"] = value;
323 | }
324 | }
325 |
326 | [global::System.Configuration.UserScopedSettingAttribute()]
327 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
328 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
329 | public bool NLFn {
330 | get {
331 | return ((bool)(this["NLFn"]));
332 | }
333 | set {
334 | this["NLFn"] = value;
335 | }
336 | }
337 |
338 | [global::System.Configuration.UserScopedSettingAttribute()]
339 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
340 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
341 | public bool InvertPower {
342 | get {
343 | return ((bool)(this["InvertPower"]));
344 | }
345 | set {
346 | this["InvertPower"] = value;
347 | }
348 | }
349 |
350 | [global::System.Configuration.UserScopedSettingAttribute()]
351 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
352 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
353 | public bool InvertDot {
354 | get {
355 | return ((bool)(this["InvertDot"]));
356 | }
357 | set {
358 | this["InvertDot"] = value;
359 | }
360 | }
361 |
362 | [global::System.Configuration.UserScopedSettingAttribute()]
363 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
364 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
365 | public bool InvertMicrophone {
366 | get {
367 | return ((bool)(this["InvertMicrophone"]));
368 | }
369 | set {
370 | this["InvertMicrophone"] = value;
371 | }
372 | }
373 |
374 | [global::System.Configuration.UserScopedSettingAttribute()]
375 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
376 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
377 | public bool InvertSleep {
378 | get {
379 | return ((bool)(this["InvertSleep"]));
380 | }
381 | set {
382 | this["InvertSleep"] = value;
383 | }
384 | }
385 |
386 | [global::System.Configuration.UserScopedSettingAttribute()]
387 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
388 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
389 | public bool InvertFn {
390 | get {
391 | return ((bool)(this["InvertFn"]));
392 | }
393 | set {
394 | this["InvertFn"] = value;
395 | }
396 | }
397 |
398 | [global::System.Configuration.UserScopedSettingAttribute()]
399 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
400 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
401 | public bool UpgradeRequired {
402 | get {
403 | return ((bool)(this["UpgradeRequired"]));
404 | }
405 | set {
406 | this["UpgradeRequired"] = value;
407 | }
408 | }
409 |
410 | [global::System.Configuration.UserScopedSettingAttribute()]
411 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
412 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
413 | public int Driver {
414 | get {
415 | return ((int)(this["Driver"]));
416 | }
417 | set {
418 | this["Driver"] = value;
419 | }
420 | }
421 |
422 | [global::System.Configuration.UserScopedSettingAttribute()]
423 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
424 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
425 | public bool FirstRun {
426 | get {
427 | return ((bool)(this["FirstRun"]));
428 | }
429 | set {
430 | this["FirstRun"] = value;
431 | }
432 | }
433 |
434 | [global::System.Configuration.UserScopedSettingAttribute()]
435 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
436 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
437 | public bool DiskWarning {
438 | get {
439 | return ((bool)(this["DiskWarning"]));
440 | }
441 | set {
442 | this["DiskWarning"] = value;
443 | }
444 | }
445 | }
446 | }
447 |
--------------------------------------------------------------------------------
/LEDControl/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | True
7 |
8 |
9 | True
10 |
11 |
12 | False
13 |
14 |
15 | False
16 |
17 |
18 | False
19 |
20 |
21 | False
22 |
23 |
24 | False
25 |
26 |
27 | False
28 |
29 |
30 | False
31 |
32 |
33 | False
34 |
35 |
36 | False
37 |
38 |
39 | False
40 |
41 |
42 | 100
43 |
44 |
45 | False
46 |
47 |
48 | 1
49 |
50 |
51 | False
52 |
53 |
54 | False
55 |
56 |
57 | False
58 |
59 |
60 | False
61 |
62 |
63 | False
64 |
65 |
66 | 0
67 |
68 |
69 | True
70 |
71 |
72 | False
73 |
74 |
75 | False
76 |
77 |
78 | False
79 |
80 |
81 | False
82 |
83 |
84 | False
85 |
86 |
87 | False
88 |
89 |
90 | False
91 |
92 |
93 | False
94 |
95 |
96 | False
97 |
98 |
99 | True
100 |
101 |
102 | 0
103 |
104 |
105 | True
106 |
107 |
108 | False
109 |
110 |
111 |
--------------------------------------------------------------------------------
/LEDControl/Resources/IdleIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/Resources/IdleIcon.ico
--------------------------------------------------------------------------------
/LEDControl/Resources/RWIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/Resources/RWIcon.ico
--------------------------------------------------------------------------------
/LEDControl/Resources/ReadIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/Resources/ReadIcon.ico
--------------------------------------------------------------------------------
/LEDControl/Resources/WriteIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/Resources/WriteIcon.ico
--------------------------------------------------------------------------------
/LEDControl/TVicPort_Cs.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace LEDControl
3 | {
4 |
5 | using System;
6 | using System.IO;
7 | using System.Runtime.InteropServices;
8 |
9 | public class TVicPort
10 | {
11 |
12 | // - Ide Hdd hardware manufacturer info structure ---
13 |
14 | [StructLayout(LayoutKind.Explicit)]
15 | public struct TypeHddInfo
16 | {
17 | [FieldOffset(0)]
18 | public uint BufferSize;
19 | [FieldOffset(4)]
20 | public uint DoubleTransfer;
21 | [FieldOffset(8)]
22 | public uint ControllerType;
23 | [FieldOffset(12)]
24 | public uint ECCMode;
25 | [FieldOffset(16)]
26 | public uint SectorsPerInterrupt;
27 | [FieldOffset(20)]
28 | public uint Cylinders;
29 | [FieldOffset(24)]
30 | public uint Heads;
31 | [FieldOffset(28)]
32 | public uint SectorsPerTrack;
33 | [FieldOffset(32), MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)]
34 | public String Model;
35 | [FieldOffset(80), MarshalAs(UnmanagedType.ByValTStr, SizeConst = 24)]
36 | public String SerialNumber;
37 | [FieldOffset(104), MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
38 | public String Revision;
39 | }
40 |
41 | //----------------------------------------------------------------------------
42 | [DllImport("TVicPort.dll", EntryPoint = "OpenTVicPort", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
43 | public static extern unsafe uint OpenTVicPort();
44 | [DllImport("TVicPort.dll", EntryPoint = "CloseTVicPort", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
45 | public static extern void CloseTVicPort();
46 | [DllImport("TVicPort.dll", EntryPoint = "IsDriverOpened", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
47 | public static extern uint IsDriverOpened();
48 | //----------------------------------------------------------------------------
49 | [DllImport("TVicPort.dll", EntryPoint = "ReadPort", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
50 | public static extern byte ReadPort(ushort PortAddr);
51 | [DllImport("TVicPort.dll", EntryPoint = "ReadPortW", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
52 | public static extern UInt16 ReadPortW(ushort PortAddr);
53 | [DllImport("TVicPort.dll", EntryPoint = "ReadPortL", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
54 | public static extern uint ReadPortL(ushort PortAddr);
55 | [DllImport("TVicPort.dll", EntryPoint = "WritePort", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
56 | public static extern void WritePort(ushort PortAddr, byte bValue);
57 | [DllImport("TVicPort.dll", EntryPoint = "WritePortW", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
58 | public static extern void WritePortW(ushort PortAddr, UInt16 wValue);
59 | [DllImport("TVicPort.dll", EntryPoint = "WritePortL", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
60 | public static extern void WritePortL(ushort PortAddr, uint lValue);
61 | [DllImport("TVicPort.dll", EntryPoint = "SetHardAccess", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
62 | public static extern void SetHardAccess(uint newstate);
63 | [DllImport("TVicPort.dll", EntryPoint = "TestHardAccess", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
64 | public static extern uint SetHardAccess();
65 | //----------------------------------------------------------------------------
66 | [DllImport("TVicPort.dll", EntryPoint = "ReadPortFIFO", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
67 | public static extern unsafe void ReadPortFIFO(ushort PortAddr, ushort NumValues, byte* Buffer);
68 | [DllImport("TVicPort.dll", EntryPoint = "ReadPortWFIFO", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
69 | public static extern unsafe void ReadPortWFIFO(ushort PortAddr, ushort NumValues, ushort* Buffer);
70 | [DllImport("TVicPort.dll", EntryPoint = "ReadPortLFIFO", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
71 | public static extern unsafe void ReadPortLFIFO(ushort PortAddr, ushort NumValues, uint* Buffer);
72 | [DllImport("TVicPort.dll", EntryPoint = "WritePortFIFO", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
73 | public static extern unsafe void WritePortFIFO(ushort PortAddr, ushort NumValues, byte* Buffer);
74 | [DllImport("TVicPort.dll", EntryPoint = "WritePortWFIFO", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
75 | public static extern unsafe void WritePortWFIFO(ushort PortAddr, ushort NumValues, ushort* Buffer);
76 | [DllImport("TVicPort.dll", EntryPoint = "WritePortLFIFO", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
77 | public static extern unsafe void WritePortLFIFO(ushort PortAddr, ushort NumValues, uint* Buffer);
78 |
79 | //----------------------------------------------------------------------------
80 | [DllImport("TVicPort.dll", EntryPoint = "GetHDDInfoVb", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
81 | public static extern void GetHDDInfo(UInt16 IdeNumber, UInt16 Master, ref TypeHddInfo Rec);
82 |
83 | //----------------------------------------------------------------------------
84 | [DllImport("TVicPort.dll", EntryPoint = "GetLPTBasePort", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
85 | public static extern ushort GetLPTBasePort();
86 | [DllImport("TVicPort.dll", EntryPoint = "GetLPTNumPorts", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
87 | public static extern byte GetLPTNumPorts();
88 | [DllImport("TVicPort.dll", EntryPoint = "SetLPTNumber", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
89 | public static extern void SetLPTNumber(ushort LptN);
90 | [DllImport("TVicPort.dll", EntryPoint = "GetLPTNumber", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
91 | public static extern ushort GetLPTNumber();
92 | [DllImport("TVicPort.dll", EntryPoint = "GetPin", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
93 | public static extern uint GetPin(byte nPin);
94 | [DllImport("TVicPort.dll", EntryPoint = "SetPin", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
95 | public static extern void SetPin(byte nPin, uint State);
96 | //----------------------------------------------------------------------------
97 | [DllImport("TVicPort.dll", EntryPoint = "GetLPTAckwl", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
98 | public static extern uint GetLPTAckwl();
99 | [DllImport("TVicPort.dll", EntryPoint = "GetLPTBusy", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
100 | public static extern uint GetLPTBusy();
101 | [DllImport("TVicPort.dll", EntryPoint = "GetLPTError", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
102 | public static extern uint GetLPTError();
103 | [DllImport("TVicPort.dll", EntryPoint = "GetLPTPaperEnd", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
104 | public static extern uint GetLPTPaperEnd();
105 | [DllImport("TVicPort.dll", EntryPoint = "GetLPTSlct", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
106 | public static extern uint GetLPTSlct();
107 | //----------------------------------------------------------------------------
108 | [DllImport("TVicPort.dll", EntryPoint = "MapPhysToLinear", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
109 | public static extern unsafe void* MapPhysToLinear(uint PhysAddr, uint Len);
110 | [DllImport("TVicPort.dll", EntryPoint = "UnmapMemory", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
111 | public static extern void UnmapMemory(uint PhysAddr, uint Len);
112 |
113 | [DllImport("TVicPort.dll", EntryPoint = "LaunchWeb", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
114 | public static extern void LaunchWeb();
115 | [DllImport("TVicPort.dll", EntryPoint = "LaunchMail", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
116 | public static extern void LaunchMail();
117 | [DllImport("TVicPort.dll", EntryPoint = "EvaluationDaysLeft", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
118 | public static extern int EvaluationDaysLeft();
119 |
120 | }
121 | }
122 |
123 |
--------------------------------------------------------------------------------
/LEDControl/Welcome.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace LEDControl
2 | {
3 | partial class Welcome
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Welcome));
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.comboBox1 = new System.Windows.Forms.ComboBox();
34 | this.label2 = new System.Windows.Forms.Label();
35 | this.button1 = new System.Windows.Forms.Button();
36 | this.button2 = new System.Windows.Forms.Button();
37 | this.SuspendLayout();
38 | //
39 | // label1
40 | //
41 | this.label1.Location = new System.Drawing.Point(9, 7);
42 | this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
43 | this.label1.Name = "label1";
44 | this.label1.Size = new System.Drawing.Size(357, 78);
45 | this.label1.TabIndex = 1;
46 | this.label1.Text = resources.GetString("label1.Text");
47 | //
48 | // comboBox1
49 | //
50 | this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
51 | this.comboBox1.FormattingEnabled = true;
52 | this.comboBox1.Items.AddRange(new object[] {
53 | "WinRing0 from OpenLibSys.org (Default)",
54 | "TVicPort from EnTech Taiwan (Obsolete)"});
55 | this.comboBox1.Location = new System.Drawing.Point(11, 88);
56 | this.comboBox1.Margin = new System.Windows.Forms.Padding(2);
57 | this.comboBox1.Name = "comboBox1";
58 | this.comboBox1.Size = new System.Drawing.Size(349, 21);
59 | this.comboBox1.TabIndex = 2;
60 | //
61 | // label2
62 | //
63 | this.label2.Location = new System.Drawing.Point(9, 117);
64 | this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
65 | this.label2.Name = "label2";
66 | this.label2.Size = new System.Drawing.Size(357, 293);
67 | this.label2.TabIndex = 3;
68 | this.label2.Text = resources.GetString("label2.Text");
69 | //
70 | // button1
71 | //
72 | this.button1.Location = new System.Drawing.Point(181, 413);
73 | this.button1.Margin = new System.Windows.Forms.Padding(2);
74 | this.button1.Name = "button1";
75 | this.button1.Size = new System.Drawing.Size(87, 27);
76 | this.button1.TabIndex = 4;
77 | this.button1.Text = "&OK";
78 | this.button1.UseVisualStyleBackColor = true;
79 | this.button1.Click += new System.EventHandler(this.button1_Click);
80 | //
81 | // button2
82 | //
83 | this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
84 | this.button2.Location = new System.Drawing.Point(272, 413);
85 | this.button2.Margin = new System.Windows.Forms.Padding(2);
86 | this.button2.Name = "button2";
87 | this.button2.Size = new System.Drawing.Size(87, 27);
88 | this.button2.TabIndex = 5;
89 | this.button2.Text = "&Cancel";
90 | this.button2.UseVisualStyleBackColor = true;
91 | this.button2.Click += new System.EventHandler(this.button2_Click);
92 | //
93 | // Welcome
94 | //
95 | this.AcceptButton = this.button1;
96 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
97 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
98 | this.CancelButton = this.button2;
99 | this.ClientSize = new System.Drawing.Size(368, 447);
100 | this.Controls.Add(this.button2);
101 | this.Controls.Add(this.button1);
102 | this.Controls.Add(this.label2);
103 | this.Controls.Add(this.comboBox1);
104 | this.Controls.Add(this.label1);
105 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
106 | this.Margin = new System.Windows.Forms.Padding(2);
107 | this.MaximizeBox = false;
108 | this.Name = "Welcome";
109 | this.ShowIcon = false;
110 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
111 | this.Text = "ThinkPad LEDs Control";
112 | this.ResumeLayout(false);
113 |
114 | }
115 |
116 | #endregion
117 |
118 | private System.Windows.Forms.Label label1;
119 | private System.Windows.Forms.Label label2;
120 | private System.Windows.Forms.Button button1;
121 | private System.Windows.Forms.Button button2;
122 | public System.Windows.Forms.ComboBox comboBox1;
123 | }
124 | }
--------------------------------------------------------------------------------
/LEDControl/Welcome.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace LEDControl
12 | {
13 | public partial class Welcome : Form
14 | {
15 | public Welcome()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | protected override void OnLoad(EventArgs e)
21 | {
22 | base.OnLoad(e);
23 | if (comboBox1.SelectedIndex == -1) comboBox1.SelectedIndex = 0;
24 | }
25 |
26 | private void button2_Click(object sender, EventArgs e)
27 | {
28 | this.DialogResult = DialogResult.Cancel;
29 | }
30 |
31 | private void button1_Click(object sender, EventArgs e)
32 | {
33 | Properties.Settings.Default.Driver = comboBox1.SelectedIndex;
34 | Properties.Settings.Default.FirstRun = false;
35 | Properties.Settings.Default.Save();
36 | this.DialogResult = DialogResult.OK;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/LEDControl/Welcome.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | Welcome to ThinkPad LEDs Control. This application helps you tailor the LEDs on your ThinkPad machine to your preference.
122 |
123 | Before you begin, please choose the driver you would like the application to use:
124 |
125 |
126 | Both of these device drivers allow the application to communicate with the embedded control of the computer, the place used to control the LEDs. While both serve the purpose well, each come with advantages and disadvantages summarized bellow:
127 |
128 | WinRing0 - comes with a digitally signed device driver, which requires applications accessing its features to be run with higher privileges (as administrator), thus providing a great level of security. This application has to be always run as administrator, if choosing to run using this driver. This driver is distributed with this application, and requires no installation.
129 | TVicPort0 - once installed, this driver exposes its features to all applications run on the system, not only the ones run as administrator, thus enhancing the security risks. A malicious app could randomly write data in sensitive parts of the computer firmware without requesting permission to do so, after the device driver was installed. This application will be able to run without administrative privileges, but running with higher privileges is still recommended in order to provide better functionality for unrelated features of the application. This driver is not distributed with this application, and has to be already present on your computer. It can be installed either from the author's web site, or with an application that bundles and uses the driver, like TPFanControl.
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/LEDControl/WinRing0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/WinRing0.dll
--------------------------------------------------------------------------------
/LEDControl/WinRing0.sys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/WinRing0.sys
--------------------------------------------------------------------------------
/LEDControl/WinRing0.vxd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/WinRing0.vxd
--------------------------------------------------------------------------------
/LEDControl/WinRing0x64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/WinRing0x64.dll
--------------------------------------------------------------------------------
/LEDControl/WinRing0x64.sys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/WinRing0x64.sys
--------------------------------------------------------------------------------
/LEDControl/WindowsHook.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/valinet/ThinkPadLEDControl/98104c1fad78982097bd1335e2d948180183de21/LEDControl/WindowsHook.dll
--------------------------------------------------------------------------------
/LEDControl/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/LEDControl/part1.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2015-01-01T00:00:00
5 |
--------------------------------------------------------------------------------
/LEDControl/part2.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 2015-01-27T18:30:00
6 | true
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/LEDControl/part3.txt:
--------------------------------------------------------------------------------
1 |
2 | InteractiveToken
3 | HighestAvailable
4 |
5 |
6 |
7 | IgnoreNew
8 | false
9 | false
10 | true
11 | false
12 | false
13 |
14 | true
15 | false
16 |
17 | true
18 | true
19 | false
20 | false
21 | false
22 | PT0S
23 | 7
24 |
25 |
26 |
27 | "
--------------------------------------------------------------------------------
/LEDControl/part4.txt:
--------------------------------------------------------------------------------
1 | "
2 | minimize
3 |
4 |
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | ISC License
2 |
3 | Copyright (c) 2020 Valentin-Gabriel Radu
4 |
5 | Permission to use, copy, modify, and distribute this software for any
6 | purpose with or without fee is hereby granted, provided that the above
7 | copyright notice and this permission notice appear in all copies.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ThinkPad LED Control
2 |
3 | ThinkPad LED Control is a Microsoft Windows application that allows controlling the various LEDs present on ThinkPad laptops and linking them to various system events (disk activity, key presses etc.).
4 |
5 | ## Download
6 |
7 | Binaries are available in [Releases](https://github.com/valinet/ThinkPadLEDControl/releases). All other places where these may have been stored (Google Drive, Google Firebase) may be discontinued in the future, and removed at any time, although I will do my best to provide a redirect to this new location when possible.
8 |
9 | ## Features
10 |
11 | Current features of the application are:
12 |
13 | * Individually turn on/off, or into the third state (which is usually just blink) four LEDs present on current ThinkPads: power, the back red dot (on the i from ThinkPad), microphone mute LED, and sleep
14 | * Turn each of the LEDs on/off separately for read, respectively write operations on the disks. This way, each of the LEDs can become a R/W LED for your ThinkPad; or you can use 2 LEDs for this function: one for R, one for W
15 | * Toggle LED states from the command line; the available commands are:
16 | * minimize - starts the application minimized
17 | * exit - imediatly terminates the application
18 | * on - turns on the LED corresponding to the previous word, which should be LEDPower, LEDRedDot, LEDMicrophone, LEDSleep
19 | * off - same as on, but turns them off
20 | * third - same as on, but turns them to third state (usually blink)
21 | * Possibility to show a virtual LED icon in the notification area, which distinctevly highlights R/W/RW/none operations on the disk(s).
22 | * Monitor changes to Caps Lock and/or NumLock keys, and toggle various LEDs
23 | * Start automatically at boot
24 |
25 | ## Command line
26 |
27 | An example for calling the application from command line is:
28 |
29 | ```
30 | LEDControl.exe minimize LEDPower off LEDMicrophone third exit
31 | ```
32 |
33 | The application will start minimized, toggle the power LED off, make the microphone LED blink, and then terminates.
34 |
35 | ## Driver
36 |
37 | In order to change the status of the LEDs, the application needs to interface with the embedded controller on the ThinkPad computers. It does this by using either one of these two kernel drivers: WinRing0 or TVicPort:
38 | * WinRing0 is a more secure choice, because it is an open-source driver which allows only applications that are run as administrator to interface with it.
39 | * TVicPort is an old, insecure driver which is popular because it is being used by [TPFanControl](https://thinkwiki.de/TPFanControl), a well-known application that allows controlling the fan speed on ThinkPad computers. Because it allows arbitrary applications to interface with it, it is highly not recommended to use it.
40 |
41 | ## About
42 |
43 | The application is free software. It uses the TVicPort freeware, code from open source TPFanControl (C++), and an HDD monitor example from Microsoft (VB.NET). The application is written in C# 5.0. Currently it is compiled against the .NET Framework 4.5.2, but it works starting even from Framework 2.0 I believe, you can recompile it from source and see, I just left it on 4.5.2 as that is the default in Visual Studio 2015.
44 |
45 | ## License
46 |
47 | The software is available under ISC license (https://en.wikipedia.org/wiki/ISC_license). The text of the license is available at [LICENSE](https://github.com/valinet/ThinkPadLEDControl/blob/master/LICENSE).
48 |
49 | ## Changelog
50 |
51 | Changelog can be found at [CHANGELOG](https://github.com/valinet/ThinkPadLEDControl/blob/master/CHANGELOG). There is also a [Reddit thread](https://www.reddit.com/r/thinkpad/comments/49wtqw/hdd_led_for_all_thinkpads_hopefully/) where this application has been discussed extensively.
52 |
--------------------------------------------------------------------------------