@@ -18,7 +18,7 @@ import (
18
18
19
19
type MyMainWindow struct {
20
20
* walk.MainWindow
21
- * walk.NumberEdit // NumberEdit1
21
+ * walk.NumberEdit
22
22
}
23
23
24
24
var (
@@ -121,7 +121,6 @@ func main() {
121
121
PushButton {
122
122
Text : "Start" ,
123
123
OnClicked : func () {
124
- label .SetText ("Starting..." )
125
124
start ()
126
125
},
127
126
},
@@ -156,21 +155,16 @@ func start() {
156
155
NtSetTimerRes (TIMERRES )
157
156
}
158
157
if DISABLE_IDLE {
159
- err := exec .Command ("powercfg" , "-setacvalueindex" , "scheme_current" , "sub_processor" , "5d76a2ca-e8c0-402f-a133-2158492d58ad" , "1" ).Start ()
160
- if err != nil {
161
- fmt .Printf ("Could not disable idle: %v\n " , err )
162
- }
158
+ exec .Command ("powercfg" , "-setacvalueindex" , "scheme_current" , "sub_processor" , "5d76a2ca-e8c0-402f-a133-2158492d58ad" , "1" ).Start ()
159
+ exec .Command ("powercfg" , "-setactive" , "scheme_current" ).Start ()
163
160
}
164
161
if KILL_DWM {
165
162
// Kill explorer and other processes
166
- fmt .Println ("Killing DWM.." )
167
163
p2k := []string {"explorer.exe" , "searchapp.exe" , "shellexperiencehost.exe" , "searchui.exe" , "runtimebroker.exe" , "textinputhost.exe" , "dllhost.exe" , "wmiprvse.exe" }
168
164
pids := wp .findProcessIDByNames (p2k )
169
165
fmt .Println ("p2k" , pids )
170
166
killProcesses (pids )
171
-
172
167
// Suspend winlogon
173
- fmt .Println ("Suspending winlogon.." )
174
168
pids = wp .findProcessIDByNames ([]string {"winlogon.exe" })
175
169
fmt .Println ("winlogon" , pids )
176
170
pidUint , _ := strconv .ParseUint (pids [0 ], 10 , 32 )
@@ -191,14 +185,11 @@ func restore() {
191
185
// restore explorer, resume winlogon, dwm etc.
192
186
// timer resolution will be returned back to previous value after process is closed
193
187
if DISABLE_IDLE {
194
- err := exec .Command ("powercfg" , "-setacvalueindex" , "scheme_current" , "sub_processor" , "5d76a2ca-e8c0-402f-a133-2158492d58ad" , "0" ).Start ()
195
- if err != nil {
196
- fmt .Printf ("Could not enable idle: %v\n " , err )
197
- }
188
+ exec .Command ("powercfg" , "-setacvalueindex" , "scheme_current" , "sub_processor" , "5d76a2ca-e8c0-402f-a133-2158492d58ad" , "0" ).Start ()
189
+ exec .Command ("powercfg" , "-setactive" , "scheme_current" ).Start ()
198
190
}
199
191
if KILL_DWM {
200
192
// Resume winlogon
201
- fmt .Println ("Resuming winlogon.." )
202
193
pids := wp .findProcessIDByNames ([]string {"winlogon.exe" })
203
194
for _ , pid := range pids {
204
195
pidUint , err := strconv .ParseUint (pid , 10 , 32 )
@@ -222,7 +213,6 @@ func restore() {
222
213
}()
223
214
}
224
215
if KILL_EXPLORER {
225
- fmt .Println ("Starting explorer.." )
226
216
pids := wp .findProcessIDByNames ([]string {"explorer.exe" })
227
217
killProcesses (pids )
228
218
ch := make (chan os.Signal )
0 commit comments