├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ └── ncc.yml ├── .gitignore ├── .gitmodules ├── Assets ├── icon.ico └── icon.png ├── GUI_Concepts ├── Form2.kxf ├── NotCPUCores_KODAConcept.au3 ├── NotCPUCores_METROConcept.au3 ├── includes │ ├── MetroGUI_UDF.au3 │ ├── MetroThemes.au3 │ └── MetroUDF-Required │ │ ├── SSCtrlHover.au3 │ │ └── StringSize.au3 └── parent.au3 ├── Includes ├── _Bitwise.au3 ├── _Bitwise64.au3 ├── _Core.au3 ├── _ExtendedFunctions.au3 ├── _FreezeToStock.au3 ├── _GetEnvironment.au3 ├── _GetLanguage.au3 ├── _ModeSelect.au3 └── _WMIC.au3 ├── LICENSE.md ├── Lang ├── 07.ini ├── 09.ini ├── 0A.ini ├── 15.ini ├── 19.ini ├── Languages.md ├── Old │ └── 1.7.0.0 │ │ ├── 04.ini │ │ ├── 07.ini │ │ └── 19.ini └── Template.ini ├── NotCPUCores.au3 ├── Plugins └── child.au3 ├── README.md ├── Settings.ini ├── installer.nsi └── r └── rcmaehl └── NotCPUCores └── 1.7.3.0 ├── rcmaehl.NotCPUCores.installer.yaml ├── rcmaehl.NotCPUCores.locale.en-US.yaml └── rcmaehl.NotCPUCores.yaml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: 'rcmaehl' 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: 'paypal.me/rhsky' 13 | -------------------------------------------------------------------------------- /.github/workflows/ncc.yml: -------------------------------------------------------------------------------- 1 | name: ncc 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - '.github/**' 7 | - '!.github/workflows/**' 8 | - '*.md' 9 | - 'GUI_Concepts/**' 10 | - 'Lang/**' 11 | 12 | jobs: 13 | build: 14 | runs-on: windows-latest 15 | steps: 16 | - uses: actions/checkout@v2 17 | with: 18 | submodules: true 19 | - name: Cache tools 20 | uses: actions/cache@v2 21 | id: cache 22 | with: 23 | path: | 24 | autoit-v3-setup.exe 25 | SciTE4AutoIt3.exe 26 | C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper 27 | key: v2 28 | - name: Download tools 29 | if: steps.cache.outputs.cache-hit != 'true' 30 | run: | 31 | curl -sSfL https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe -o autoit-v3-setup.exe ` 32 | -sSfL https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe -o SciTE4AutoIt3.exe ` 33 | -sSfLO https://www.autoitscript.com/autoit3/scite/download/Au3Stripper.zip 34 | Expand-Archive Au3Stripper.zip "${env:ProgramFiles(x86)}\AutoIt3\SciTE\Au3Stripper" 35 | - name: Install tools 36 | run: | 37 | Start-Process autoit-v3-setup.exe -ArgumentList /S -NoNewWindow -Wait 38 | Start-Process SciTE4AutoIt3.exe -ArgumentList /S -NoNewWindow -Wait 39 | - name: Compile 40 | run: | 41 | Start-Process "${env:ProgramFiles(x86)}\AutoIt3\AutoIt3.exe" "`"${env:ProgramFiles(x86)}\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3`" /NoStatus /prod /in NotCPUCores.au3" -NoNewWindow -Wait 42 | sha256sum -b NotCPUCores*.exe > checksums.sha256 43 | - uses: actions/upload-artifact@v2 44 | with: 45 | name: NCC 46 | path: | 47 | NotCPUCores*.exe 48 | checksums.sha256 49 | if-no-files-found: error 50 | - name: Zip package 51 | if: startsWith(github.ref, 'refs/tags/') 52 | run: 7z a NotCPUCores.zip NotCPUCores*.exe checksums.sha256 53 | - name: Release 54 | uses: softprops/action-gh-release@v1 55 | if: startsWith(github.ref, 'refs/tags/') 56 | with: 57 | files: | 58 | NotCPUCores*.exe 59 | NotCPUCores.zip 60 | checksums.sha256 61 | env: 62 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | workspace.au3 3 | NotCPUCores.exe 4 | NotCPUCores_x64.exe 5 | includes/Console.au3 6 | *.crt 7 | *.ncc 8 | NotCPUCores.zip 9 | Optional Languages.zip 10 | cert-key-20190522-121211.p12 11 | 2.0/includes/_Core.exe 12 | *.exe 13 | NotCPUCores_stripped.au3 14 | *.zip 15 | Includes/Test.au3 16 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "_GetSteam"] 2 | path = Includes/_GetSteam 3 | url = https://github.com/rcmaehl/_GetSteam 4 | branch = main -------------------------------------------------------------------------------- /Assets/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcmaehl/NotCPUCores/eb1a360973f0a5584f519a410d061e36f55a19af/Assets/icon.ico -------------------------------------------------------------------------------- /Assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcmaehl/NotCPUCores/eb1a360973f0a5584f519a410d061e36f55a19af/Assets/icon.png -------------------------------------------------------------------------------- /GUI_Concepts/Form2.kxf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 200 5 | 135 6 | 540 7 | 460 8 | NotCPUCores - GUI Redesign Concept 1 9 | clBtnFace 10 | DEFAULT_CHARSET 11 | clWindowText 12 | -11 13 | MS Sans Serif 14 | 15 | Menu1 16 | False 17 | True 18 | -1798701056 19 | 256 20 | 1.04 21 | A Dual List Dialog. 22 | False 23 | False 24 | False 25 | False 26 | 0 27 | 1 28 | 0 29 | 0 30 | 31 | 96 32 | 13 33 | 34 | 35 | 36 | 37 | 3 38 | 5 39 | 28 40 | 28 41 | Owner 42 | MainMenu1 43 | 44 | 45 | 46 | 47 | 48 | 10 49 | 30 50 | 135 51 | 201 52 | 512 53 | 1350762499 54 | 13 55 | 56 | 57 |
  • --------------
  • 58 |
  • GOG Game 1
  • 59 |
  • Process 1
  • 60 |
  • Process 2
  • 61 |
  • Process 3
  • 62 |
  • Process 4
  • 63 |
  • Steam Game 2
  • 64 |
  • Steam Game 3
  • 65 |
  • Steam Game 4
  • 66 |
    67 |
    68 | 0 69 | 1352859649 70 | 512 71 | 72 |
    73 | 74 |
    75 | 76 | 77 | 455 78 | 205 79 | 60 80 | 25 81 | Load 82 | 1342242816 83 | 1 84 | clBtnFace 85 | 1342373888 86 | 0 87 | DockWidth, DockHeight 88 | 89 | 90 | 91 | 92 | 93 | 455 94 | 30 95 | 60 96 | 25 97 | Prioritize 98 | 1342242816 99 | 2 100 | clBtnFace 101 | 1342373888 102 | 0 103 | DockWidth, DockHeight 104 | 105 | 106 | 107 | 108 | 109 | 160 110 | 30 111 | 135 112 | 201 113 | 512 114 | 1350762499 115 | 13 116 | 117 | 118 |
  • Steam Game 1
  • 119 |
    120 |
    121 | 3 122 | 1352859651 123 | 512 124 | 125 |
    126 | 127 |
    128 | 129 | 130 | 455 131 | 90 132 | 60 133 | 25 134 | Exclude 135 | 1342242816 136 | 4 137 | clBtnFace 138 | 1342373888 139 | 0 140 | DockWidth, DockHeight 141 | 142 | 143 | 144 | 145 | 146 | 455 147 | 60 148 | 60 149 | 25 150 | Remove 151 | 1342242816 152 | 5 153 | clBtnFace 154 | 1342373888 155 | 0 156 | DockWidth, DockHeight 157 | 158 | 159 | 160 | 161 | 162 | 310 163 | 30 164 | 135 165 | 201 166 | 512 167 | 1350762499 168 | 13 169 | 170 | 171 |
  • Process 5
  • 172 |
  • Process 6
  • 173 |
    174 |
    175 | 6 176 | 1352859651 177 | 512 178 | 179 |
    180 | 181 |
    182 | 183 | 184 | 455 185 | 175 186 | 60 187 | 25 188 | Save 189 | 1342242816 190 | 7 191 | clBtnFace 192 | 1342373888 193 | 0 194 | DockWidth, DockHeight 195 | 196 | 197 | 198 | 199 | 200 | 10 201 | 10 202 | 67 203 | 17 204 | All Processes 205 | 8 206 | False 207 | 1342308608 208 | 0 209 | 210 | 211 | 212 | 213 | 214 | 215 | 160 216 | 10 217 | 107 218 | 17 219 | Processes to Prioritize 220 | 9 221 | False 222 | 1342308608 223 | 0 224 | 225 | 226 | 227 | 228 | 229 | 230 | 310 231 | 10 232 | 114 233 | 17 234 | Optimization Exclusions 235 | 10 236 | False 237 | 1342308608 238 | 0 239 | 240 | 241 | 242 | 243 | 244 | 245 | 10 246 | 240 247 | 505 248 | 155 249 | 1342308359 250 | 0 251 | Options 252 | 11 253 | 254 | 255 | 256 | 257 | 258 | 10 259 | 15 260 | 130 261 | 130 262 | 1342308359 263 | 0 264 | Prioritization 265 | 0 266 | 267 | 268 | 269 | 270 | 271 | 10 272 | 20 273 | 110 274 | 20 275 | False 276 | Resource Assignment 277 | 0 278 | False 279 | 1342308609 280 | 0 281 | 282 | 283 | 284 | 285 | 286 | 287 | 10 288 | 40 289 | 110 290 | 25 291 | 16 292 | 1 293 | 16 294 | 1 295 | 18 296 | 1342308353 297 | 0 298 | DockWidth, DockHeight 299 | 300 | 301 | 302 | 303 | 304 | 10 305 | 75 306 | 110 307 | 17 308 | False 309 | Process Priority 310 | 2 311 | False 312 | 1342308609 313 | 0 314 | 315 | 316 | 317 | 318 | 319 | 320 | 10 321 | 90 322 | 110 323 | 25 324 | 4 325 | 1 326 | 4 327 | 3 328 | 18 329 | 1342308353 330 | 0 331 | DockWidth, DockHeight 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 150 340 | 15 341 | 140 342 | 130 343 | 1342308359 344 | 0 345 | Streaming 346 | 6 347 | 348 | 349 | 350 | 351 | 352 | 10 353 | 20 354 | 120 355 | 20 356 | Enabled 357 | True 358 | cbChecked 359 | 0 360 | 1342242819 361 | 0 362 | DockHeight 363 | 364 | 365 | 366 | 367 | 368 | 10 369 | 40 370 | 120 371 | 25 372 | crDrag 373 | 13 374 | 1 375 | OBS 376 | 1342374466 377 | 0 378 | DockHeight 379 | 380 | 381 | 382 | 383 | 384 | 10 385 | 75 386 | 120 387 | 17 388 | Resource Assignment 389 | 2 390 | False 391 | 1342308609 392 | 0 393 | 394 | 395 | 396 | 397 | 398 | 399 | 10 400 | 90 401 | 120 402 | 25 403 | 16 404 | 1 405 | 16 406 | 3 407 | 18 408 | 1342308353 409 | 0 410 | DockWidth, DockHeight 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 300 419 | 40 420 | 190 421 | 20 422 | Disable Unneeded Services 423 | 2 424 | 1342242819 425 | 0 426 | DockHeight 427 | 428 | 429 | 430 | 431 | 432 | 300 433 | 60 434 | 190 435 | 20 436 | Set Power Plan to Max Performance 437 | 3 438 | 1342242819 439 | 0 440 | DockHeight 441 | 442 | 443 | 444 | 445 | 446 | 300 447 | 120 448 | 190 449 | 20 450 | Automatically Check for Updates 451 | 5 452 | 1342242819 453 | 0 454 | DockHeight 455 | 456 | 457 | 458 | 459 | 460 | 300 461 | 100 462 | 190 463 | 20 464 | Enable Debug Log 465 | 4 466 | 1342242819 467 | 0 468 | DockHeight 469 | 470 | 471 | 472 | 473 | 474 | 300 475 | 20 476 | 190 477 | 20 478 | Optimize Child Processes 479 | 1 480 | 1342242819 481 | 0 482 | DockHeight 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | &File 494 | 495 | 496 | 497 | 498 | 499 | &Options 500 | 501 | 502 | 503 | 504 | 505 | &Help 506 | 507 | 508 | 509 | 510 | 511 |
    512 |
    -------------------------------------------------------------------------------- /GUI_Concepts/NotCPUCores_KODAConcept.au3: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #Region ### START Koda GUI section ### Form=form2.kxf 10 | $Concept1 = GUICreate("NotCPUCores - GUI Redesign Concept 1", 525, 423, 200, 135) 11 | $MenuItem1 = GUICtrlCreateMenu("&File") 12 | $MenuItem2 = GUICtrlCreateMenu("&Options") 13 | $MenuItem3 = GUICtrlCreateMenu("&Help") 14 | $ListBox1 = GUICtrlCreateList("", 10, 30, 135, 201, BitOR($LBS_NOTIFY,$WS_VSCROLL,$WS_BORDER)) 15 | GUICtrlSetData(-1, "--------------|GOG Game 1|Process 1|Process 2|Process 3|Process 4|Steam Game 2|Steam Game 3|Steam Game 4") 16 | $Button3 = GUICtrlCreateButton("Load", 455, 205, 60, 25) 17 | $Button4 = GUICtrlCreateButton("Prioritize", 455, 30, 60, 25) 18 | $ListBox2 = GUICtrlCreateList("", 160, 30, 135, 201) 19 | GUICtrlSetData(-1, "Steam Game 1") 20 | $Button1 = GUICtrlCreateButton("Exclude", 455, 90, 60, 25) 21 | $Button2 = GUICtrlCreateButton("Remove", 455, 60, 60, 25) 22 | $List1 = GUICtrlCreateList("", 310, 30, 135, 201) 23 | GUICtrlSetData(-1, "Process 5|Process 6") 24 | $Button6 = GUICtrlCreateButton("Save", 455, 175, 60, 25) 25 | $Label1 = GUICtrlCreateLabel("All Processes", 10, 10, 67, 17) 26 | $Label2 = GUICtrlCreateLabel("Processes to Prioritize", 160, 10, 107, 17) 27 | $Label3 = GUICtrlCreateLabel("Optimization Exclusions", 310, 10, 114, 17) 28 | $Group1 = GUICtrlCreateGroup("Options", 10, 240, 505, 155) 29 | $Group2 = GUICtrlCreateGroup("Prioritization", 20, 255, 130, 130) 30 | $Label4 = GUICtrlCreateLabel("Resource Assignment", 30, 275, 110, 20, $SS_CENTER) 31 | $Slider1 = GUICtrlCreateSlider(30, 295, 110, 25) 32 | _GUICtrlSlider_SetTicFreq(-1,1) 33 | GUICtrlSetLimit(-1, 16, 1) 34 | GUICtrlSetData(-1, 16) 35 | $Label5 = GUICtrlCreateLabel("Process Priority", 30, 330, 110, 17, $SS_CENTER) 36 | $Slider2 = GUICtrlCreateSlider(30, 345, 110, 25) 37 | _GUICtrlSlider_SetTicFreq(-1,1) 38 | GUICtrlSetLimit(-1, 4, 1) 39 | GUICtrlSetData(-1, 4) 40 | GUICtrlCreateGroup("", -99, -99, 1, 1) 41 | $Checkbox6 = GUICtrlCreateCheckbox("Optimize Child Processes", 310, 260, 190, 20) 42 | $Checkbox1 = GUICtrlCreateCheckbox("Disable Unneeded Services", 310, 280, 190, 20) 43 | $Checkbox3 = GUICtrlCreateCheckbox("Set Power Plan to Max Performance", 310, 300, 190, 20) 44 | $Checkbox4 = GUICtrlCreateCheckbox("Enable Debug Log", 310, 340, 190, 20) 45 | $Checkbox5 = GUICtrlCreateCheckbox("Automatically Check for Updates", 310, 360, 190, 20) 46 | $Group3 = GUICtrlCreateGroup("Streaming", 160, 255, 140, 130) 47 | $Checkbox2 = GUICtrlCreateCheckbox("Enabled", 170, 275, 120, 20) 48 | GUICtrlSetState(-1, $GUI_CHECKED) 49 | $Combo2 = GUICtrlCreateCombo("OBS", 170, 295, 120, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) 50 | GUICtrlSetCursor (-1, 2) 51 | $Label6 = GUICtrlCreateLabel("Resource Assignment", 170, 330, 107, 17, $SS_CENTER) 52 | $Slider3 = GUICtrlCreateSlider(170, 345, 120, 25) 53 | _GUICtrlSlider_SetTicFreq(-1,1) 54 | GUICtrlSetLimit(-1, 16, 1) 55 | GUICtrlSetData(-1, 16) 56 | GUICtrlCreateGroup("", -99, -99, 1, 1) 57 | GUICtrlCreateGroup("", -99, -99, 1, 1) 58 | GUISetState(@SW_SHOW) 59 | #EndRegion ### END Koda GUI section ### 60 | 61 | While 1 62 | $nMsg = GUIGetMsg() 63 | Switch $nMsg 64 | Case $GUI_EVENT_CLOSE 65 | Exit 66 | 67 | EndSwitch 68 | WEnd 69 | -------------------------------------------------------------------------------- /GUI_Concepts/NotCPUCores_METROConcept.au3: -------------------------------------------------------------------------------- 1 | #RequireAdmin 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include ".\Includes\_Core.au3" 15 | #include ".\Includes\_WMIC.au3" 16 | ;#include ".\Includes\_ModeSelect.au3" 17 | #include ".\Includes\_GetEnvironment.au3" 18 | 19 | #include ".\includes\Console.au3" 20 | #include ".\includes\MetroGUI_UDF.au3" 21 | 22 | ModeSelect() 23 | 24 | Func _CreateButton($sText, $iLeft, $iTop, $iWidth = -1, $iHeight = -1, $iStyle = -1) 25 | Local $hCreated 26 | 27 | Switch @OSVersion 28 | Case "WIN_10", "WIN_81", "WIN_8" 29 | $hCreated = _Metro_CreateButton($sText, $iLeft, $iTop, $iWidth, $iHeight, $iStyle) 30 | Case Else 31 | $hCreated = GUICtrlCreateButton($sText, $iLeft, $iTop, $iWidth, $iHeight) 32 | EndSwitch 33 | 34 | Return $hCreated 35 | EndFunc 36 | 37 | Func _GetChildProcesses($i_pid) ; First level children processes only 38 | Local Const $TH32CS_SNAPPROCESS = 0x00000002 39 | 40 | Local $a_tool_help = DllCall("Kernel32.dll", "long", "CreateToolhelp32Snapshot", "int", $TH32CS_SNAPPROCESS, "int", 0) 41 | If IsArray($a_tool_help) = 0 Or $a_tool_help[0] = -1 Then Return SetError(1, 0, $i_pid) 42 | 43 | Local $tagPROCESSENTRY32 = _ 44 | DllStructCreate _ 45 | ( _ 46 | "dword dwsize;" & _ 47 | "dword cntUsage;" & _ 48 | "dword th32ProcessID;" & _ 49 | "uint th32DefaultHeapID;" & _ 50 | "dword th32ModuleID;" & _ 51 | "dword cntThreads;" & _ 52 | "dword th32ParentProcessID;" & _ 53 | "long pcPriClassBase;" & _ 54 | "dword dwFlags;" & _ 55 | "char szExeFile[260]" _ 56 | ) 57 | DllStructSetData($tagPROCESSENTRY32, 1, DllStructGetSize($tagPROCESSENTRY32)) 58 | 59 | Local $p_PROCESSENTRY32 = DllStructGetPtr($tagPROCESSENTRY32) 60 | 61 | Local $a_pfirst = DllCall("Kernel32.dll", "int", "Process32First", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32) 62 | If IsArray($a_pfirst) = 0 Then Return SetError(2, 0, $i_pid) 63 | 64 | Local $a_pnext, $a_children[11][2] = [[10]], $i_child_pid, $i_parent_pid, $i_add = 0 65 | $i_child_pid = DllStructGetData($tagPROCESSENTRY32, "th32ProcessID") 66 | If $i_child_pid <> $i_pid Then 67 | $i_parent_pid = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID") 68 | If $i_parent_pid = $i_pid Then 69 | $i_add += 1 70 | $a_children[$i_add][0] = $i_child_pid 71 | $a_children[$i_add][1] = DllStructGetData($tagPROCESSENTRY32, "szExeFile") 72 | EndIf 73 | EndIf 74 | 75 | While 1 76 | $a_pnext = DLLCall("Kernel32.dll", "int", "Process32Next", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32) 77 | If IsArray($a_pnext) And $a_pnext[0] = 0 Then ExitLoop 78 | $i_child_pid = DllStructGetData($tagPROCESSENTRY32, "th32ProcessID") 79 | If $i_child_pid <> $i_pid Then 80 | $i_parent_pid = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID") 81 | If $i_parent_pid = $i_pid Then 82 | If $i_add = $a_children[0][0] Then 83 | ReDim $a_children[$a_children[0][0] + 11][2] 84 | $a_children[0][0] = $a_children[0][0] + 10 85 | EndIf 86 | $i_add += 1 87 | $a_children[$i_add][0] = $i_child_pid 88 | $a_children[$i_add][1] = DllStructGetData($tagPROCESSENTRY32, "szExeFile") 89 | EndIf 90 | EndIf 91 | WEnd 92 | 93 | If $i_add <> 0 Then 94 | ReDim $a_children[$i_add + 1][2] 95 | $a_children[0][0] = $i_add 96 | EndIf 97 | 98 | DllCall("Kernel32.dll", "int", "CloseHandle", "long", $a_tool_help[0]) 99 | If $i_add Then Return $a_children 100 | Return SetError(3, 0, 0) 101 | EndFunc 102 | 103 | Func _GetProcessList($hControl) 104 | 105 | _GUICtrlListView_DeleteAllItems($hControl) 106 | Local $aWindows = WinList() 107 | Do 108 | $Delete = _ArraySearch($aWindows, "Default IME") 109 | _ArrayDelete($aWindows, $Delete) 110 | Until _ArraySearch($aWindows, "Default IME") = -1 111 | $aWindows[0][0] = UBound($aWindows) 112 | For $Loop = 1 To $aWindows[0][0] - 1 113 | $aWindows[$Loop][1] = _ProcessGetName(WinGetProcess($aWindows[$Loop][1])) 114 | GUICtrlCreateListViewItem($aWindows[$Loop][1] & "|" & $aWindows[$Loop][0], $hControl) 115 | Next 116 | _ArrayDelete($aWindows, 0) 117 | For $i = 0 To _GUICtrlListView_GetColumnCount($hControl) Step 1 118 | _GUICtrlListView_SetColumnWidth($hControl, $i, $LVSCW_AUTOSIZE_USEHEADER) 119 | Next 120 | _GUICtrlListView_SortItems($hControl, GUICtrlGetState($hControl)) 121 | 122 | EndFunc 123 | 124 | Func _IsChecked($idControlID) 125 | Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED 126 | EndFunc ;==>_IsChecked 127 | 128 | Func Manage() 129 | Switch @OSVersion 130 | Case "WIN_10", "WIN_81", "WIN_8" 131 | _SetTheme("DarkBlue") 132 | _Metro_EnableHighDPIScaling() 133 | $hGUI = _Metro_CreateGUI("NotCPUCores", 640, 480, -1, -1) 134 | $aControl_Buttons = _Metro_AddControlButtons(True,False,False,False) 135 | $hGUI_CLOSE_BUTTON = $aControl_Buttons[0] 136 | Case Else 137 | $hGUI = GUICreate("NotCPUCores", 640, 480, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) 138 | $hGUI_CLOSE_BUTTON = $GUI_EVENT_CLOSE 139 | EndSwitch 140 | 141 | GUISetState(@SW_SHOW, $hGUI) 142 | 143 | While 1 144 | 145 | $hMsg = GUIGetMsg() 146 | 147 | Select 148 | 149 | Case $hMsg = $GUI_EVENT_CLOSE or $hMsg = $hGUI_CLOSE_BUTTON 150 | GUIDelete($hGUI) 151 | Exit 152 | 153 | EndSelect 154 | WEnd 155 | EndFunc 156 | 157 | Func ModeSelect() 158 | Local $hGUI 159 | 160 | Switch @OSVersion 161 | Case "WIN_10", "WIN_81", "WIN_8" 162 | _SetTheme("DarkBlue") 163 | _Metro_EnableHighDPIScaling() 164 | GUICtrlSetDefColor(0xFFFFFF) 165 | $hGUI = _Metro_CreateGUI("NotCPUCores", 640, 160, -1, -1, False) 166 | $aControl_Buttons = _Metro_AddControlButtons(True,False,False,False) 167 | $hGUI_CLOSE_BUTTON = $aControl_Buttons[0] 168 | $iHOffset = 25 169 | Case Else 170 | $hGUI = GUICreate("NotCPUCores", 640, 140, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) 171 | $hGUI_CLOSE_BUTTON = $GUI_EVENT_CLOSE 172 | $iHOffset = 0 173 | EndSwitch 174 | ; GUICtrlCreateGroup("What Would You Like To Do?", 5, 5 + $iHOffset, 630, 110 + $iHOffset) 175 | ; GUICtrlSetColor(-1, 0xFFFFFF) 176 | ; $hOptimize = _CreateButton("Optimize A Game", 10, 20 + $iHOffset, 200, 110, BitXOR($BS_ICON,$BS_TOP)) 177 | ; $hManageSet = _CreateButton("Manage Auto Optimizes", 220, 20 + $iHOffset, 200, 110, BitXOR($BS_ICON,$BS_TOP)) 178 | ; $hCleanPC = _CreateButton("Optimize PC", 430, 20 + $iHOffset, 200, 110, BitXOR($BS_ICON,$BS_TOP)) 179 | 180 | GUISetState(@SW_SHOW, $hGUI) 181 | 182 | While 1 183 | 184 | $hMsg = GUIGetMsg() 185 | 186 | Select 187 | 188 | Case $hMsg = $GUI_EVENT_CLOSE or $hMsg = $hGUI_CLOSE_BUTTON 189 | GUIDelete($hGUI) 190 | Exit 191 | #cs 192 | Case $hMsg = $hOptimize 193 | GUIDelete($hGUI) 194 | OptimizeGame() 195 | 196 | Case $hMsg = $hManageSet 197 | GUIDelete($hGUI) 198 | Manage() 199 | 200 | Case $hMsg = $hCleanPC 201 | GUIDelete($hGUI) 202 | OptimizePC() 203 | #ce 204 | EndSelect 205 | 206 | WEnd 207 | 208 | EndFunc 209 | 210 | Func OptimizeGame() 211 | Local $hGUI 212 | 213 | Switch @OSVersion 214 | Case "WIN_10", "WIN_81", "WIN_8" 215 | _SetTheme("DarkBlue") 216 | _Metro_EnableHighDPIScaling() 217 | $hGUI = _Metro_CreateGUI("NotCPUCores", 640, 480, -1, -1) 218 | $aControl_Buttons = _Metro_AddControlButtons(True,False,False,False) 219 | $hGUI_CLOSE_BUTTON = $aControl_Buttons[0] 220 | Case Else 221 | $hGUI = GUICreate("NotCPUCores", 640, 480, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) 222 | $hGUI_CLOSE_BUTTON = $GUI_EVENT_CLOSE 223 | EndSwitch 224 | 225 | GUISetState(@SW_SHOW, $hGUI) 226 | 227 | While 1 228 | 229 | $hMsg = GUIGetMsg() 230 | 231 | Select 232 | 233 | Case $hMsg = $GUI_EVENT_CLOSE or $hMsg = $hGUI_CLOSE_BUTTON 234 | GUIDelete($hGUI) 235 | Exit 236 | 237 | EndSelect 238 | WEnd 239 | EndFunc 240 | 241 | Func OptimizePC() 242 | Local $hGUI 243 | 244 | Switch @OSVersion 245 | Case "WIN_10", "WIN_81", "WIN_8" 246 | _SetTheme("DarkBlue") 247 | _Metro_EnableHighDPIScaling() 248 | $hGUI = _Metro_CreateGUI("NotCPUCores", 640, 480, -1, -1) 249 | $aControl_Buttons = _Metro_AddControlButtons(True,False,False,False) 250 | $hGUI_CLOSE_BUTTON = $aControl_Buttons[0] 251 | Case Else 252 | $hGUI = GUICreate("NotCPUCores", 640, 480, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) 253 | $hGUI_CLOSE_BUTTON = $GUI_EVENT_CLOSE 254 | EndSwitch 255 | 256 | GUISetState(@SW_SHOW, $hGUI) 257 | 258 | While 1 259 | 260 | $hMsg = GUIGetMsg() 261 | 262 | Select 263 | 264 | Case $hMsg = $GUI_EVENT_CLOSE or $hMsg = $hGUI_CLOSE_BUTTON 265 | GUIDelete($hGUI) 266 | Exit 267 | 268 | EndSelect 269 | WEnd 270 | EndFunc -------------------------------------------------------------------------------- /GUI_Concepts/includes/MetroThemes.au3: -------------------------------------------------------------------------------- 1 | #include-once 2 | #cs ---------------------------------------------------------------------------- 3 | Author: BB_19 4 | Material Themes for MetroGUI UDF 5 | If you want to create your own themes, check out flatcolors.net, you can find there many random material/flat colors :) 6 | #ce ---------------------------------------------------------------------------- 7 | 8 | ;#Set Default Theme 9 | Global $GUIThemeColor = "0x13161C" ; GUI Background Color 10 | Global $FontThemeColor = "0xFFFFFF" ; Font Color 11 | Global $GUIBorderColor = "0x2D2D2D" ; GUI Border Color 12 | Global $ButtonBKColor = "0x00796b" ; Metro Button BacKground Color 13 | Global $ButtonTextColor = "0xFFFFFF" ; Metro Button Text Color 14 | Global $CB_Radio_Color = "0xFFFFFF" ;Checkbox and Radio Color (Box/Circle) 15 | Global $GUI_Theme_Name = "DarkTealV2" ;Theme Name (For internal usage) 16 | Global $CB_Radio_Hover_Color = "0xD8D8D8" ; Checkbox and Radio Hover Color (Box/Circle) 17 | Global $CB_Radio_CheckMark_Color = "0x1a1a1a" ; Checkbox and Radio checkmark color 18 | 19 | Func _SetTheme($ThemeSelect = "DarkTeal") 20 | $GUI_Theme_Name = $ThemeSelect 21 | Switch ($ThemeSelect) 22 | Case "LightTeal" 23 | $GUIThemeColor = "0xcccccc" 24 | $FontThemeColor = "0x000000" 25 | $GUIBorderColor = "0xD8D8D8" 26 | $ButtonBKColor = "0x00796b" 27 | $ButtonTextColor = "0xFFFFFF" 28 | $CB_Radio_Color = "0xFFFFFF" 29 | $CB_Radio_Hover_Color = "0xE8E8E8" 30 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 31 | Case "DarkTeal" 32 | $GUIThemeColor = "0x191919" 33 | $FontThemeColor = "0xFFFFFF" 34 | $GUIBorderColor = "0x2D2D2D" 35 | $ButtonBKColor = "0x00796b" 36 | $ButtonTextColor = "0xFFFFFF" 37 | $CB_Radio_Color = "0xFFFFFF" 38 | $CB_Radio_Hover_Color = "0xD8D8D8" 39 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 40 | Case "DarkTealV2" 41 | $GUIThemeColor = "0x13161C" 42 | $FontThemeColor = "0xFFFFFF" 43 | $GUIBorderColor = "0x2D2D2D" 44 | $ButtonBKColor = "0x35635B" 45 | $ButtonTextColor = "0xFFFFFF" 46 | $CB_Radio_Color = "0xFFFFFF" 47 | $CB_Radio_Hover_Color = "0xD8D8D8" 48 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 49 | Case "DarkRuby" 50 | $GUIThemeColor = "0x191919" 51 | $FontThemeColor = "0xFFFFFF" 52 | $GUIBorderColor = "0x2D2D2D" 53 | $ButtonBKColor = "0x712043" 54 | $ButtonTextColor = "0xFFFFFF" 55 | $CB_Radio_Color = "0xFFFFFF" 56 | $CB_Radio_Hover_Color = "0xD8D8D8" 57 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 58 | Case "DarkMidnightTeal" 59 | $GUIThemeColor = "0x0A0D16" 60 | $FontThemeColor = "0xFFFFFF" 61 | $GUIBorderColor = "0x242B47" 62 | $ButtonBKColor = "0x336058" 63 | $ButtonTextColor = "0xFFFFFF" 64 | $CB_Radio_Color = "0xFFFFFF" 65 | $CB_Radio_Hover_Color = "0xD8D8D8" 66 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 67 | Case "DarkMidnightCyan" 68 | $GUIThemeColor = "0x0A0D16" 69 | $FontThemeColor = "0xFFFFFF" 70 | $GUIBorderColor = "0x242B47" 71 | $ButtonBKColor = "0x0D5C63" 72 | $ButtonTextColor = "0xFFFFFF" 73 | $CB_Radio_Color = "0xFFFFFF" 74 | $CB_Radio_Hover_Color = "0xD8D8D8" 75 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 76 | Case "DarkMidnightBlue" 77 | $GUIThemeColor = "0x0A0D16" 78 | $FontThemeColor = "0xFFFFFF" 79 | $GUIBorderColor = "0x242B47" 80 | $ButtonBKColor = "0x1A4F70" 81 | $ButtonTextColor = "0xFFFFFF" 82 | $CB_Radio_Color = "0xFFFFFF" 83 | $CB_Radio_Hover_Color = "0xD8D8D8" 84 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 85 | Case "DarkMidnight" 86 | $GUIThemeColor = "0x0A0D16" 87 | $FontThemeColor = "0xFFFFFF" 88 | $GUIBorderColor = "0x242B47" 89 | $ButtonBKColor = "0x3C4D66" 90 | $ButtonTextColor = "0xFFFFFF" 91 | $CB_Radio_Color = "0xFFFFFF" 92 | $CB_Radio_Hover_Color = "0xD8D8D8" 93 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 94 | Case "DarkBlue" 95 | $GUIThemeColor = "0x191919" 96 | $FontThemeColor = "0xFFFFFF" 97 | $GUIBorderColor = "0x303030" 98 | $ButtonBKColor = "0x1E648C" 99 | $ButtonTextColor = "0xFFFFFF" 100 | $CB_Radio_Color = "0xFFFFFF" 101 | $CB_Radio_Hover_Color = "0xD8D8D8" 102 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 103 | Case "DarkBlueV2" 104 | $GUIThemeColor = "0x040D11" 105 | $FontThemeColor = "0xFFFFFF" 106 | $GUIBorderColor = "0x303030" 107 | $ButtonBKColor = "0x1E648C" 108 | $ButtonTextColor = "0xFFFFFF" 109 | $CB_Radio_Color = "0xFFFFFF" 110 | $CB_Radio_Hover_Color = "0xD8D8D8" 111 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 112 | Case "LightBlue" 113 | $GUIThemeColor = "0xcccccc" 114 | $FontThemeColor = "0x000000" 115 | $GUIBorderColor = "0xD8D8D8" 116 | $ButtonBKColor = "0x244E80" 117 | $ButtonTextColor = "0xFFFFFF" 118 | $CB_Radio_Color = "0xFFFFFF" 119 | $CB_Radio_Hover_Color = "0xE8E8E8" 120 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 121 | Case "LightCyan" 122 | $GUIThemeColor = "0xD7D7D7" 123 | $FontThemeColor = "0x000000" 124 | $GUIBorderColor = "0xD8D8D8" 125 | $ButtonBKColor = "0x00838f" 126 | $ButtonTextColor = "0xFFFFFF" 127 | $CB_Radio_Color = "0xFFFFFF" 128 | $CB_Radio_Hover_Color = "0xE8E8E8" 129 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 130 | Case "DarkCyan" 131 | $GUIThemeColor = "0x191919" 132 | $FontThemeColor = "0xFFFFFF" 133 | $GUIBorderColor = "0x2D2D2D" 134 | $ButtonBKColor = "0x00838f" 135 | $ButtonTextColor = "0xFFFFFF" 136 | $CB_Radio_Color = "0xFFFFFF" 137 | $CB_Radio_Hover_Color = "0xD8D8D8" 138 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 139 | Case "LightGray" 140 | $GUIThemeColor = "0xcccccc" 141 | $FontThemeColor = "0x000000" 142 | $GUIBorderColor = "0xD8D8D8" 143 | $ButtonBKColor = "0x3F5863" 144 | $ButtonTextColor = "0xFFFFFF" 145 | $CB_Radio_Color = "0xFFFFFF" 146 | $CB_Radio_Hover_Color = "0xE8E8E8" 147 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 148 | Case "LightGreen" 149 | $GUIThemeColor = "0xD7D7D7" 150 | $FontThemeColor = "0x000000" 151 | $GUIBorderColor = "0xD8D8D8" 152 | $ButtonBKColor = "0x2E7D32" 153 | $ButtonTextColor = "0xFFFFFF" 154 | $CB_Radio_Color = "0xFFFFFF" 155 | $CB_Radio_Hover_Color = "0xE8E8E8" 156 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 157 | Case "DarkGreen" 158 | $GUIThemeColor = "0x191919" 159 | $FontThemeColor = "0xFFFFFF" 160 | $GUIBorderColor = "0x2D2D2D" 161 | $ButtonBKColor = "0x5E8763" 162 | $ButtonTextColor = "0xFFFFFF" 163 | $CB_Radio_Color = "0xFFFFFF" 164 | $CB_Radio_Hover_Color = "0xD8D8D8" 165 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 166 | Case "DarkGreenV2" 167 | $GUIThemeColor = "0x061319" 168 | $FontThemeColor = "0xFFFFFF" 169 | $GUIBorderColor = "0x242B47" 170 | $ButtonBKColor = "0x5E8763" 171 | $ButtonTextColor = "0xFFFFFF" 172 | $CB_Radio_Color = "0xFFFFFF" 173 | $CB_Radio_Hover_Color = "0xD8D8D8" 174 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 175 | Case "LightRed" 176 | $GUIThemeColor = "0xD7D7D7" 177 | $FontThemeColor = "0x000000" 178 | $GUIBorderColor = "0xD8D8D8" 179 | $ButtonBKColor = "0xc62828" 180 | $ButtonTextColor = "0xFFFFFF" 181 | $CB_Radio_Color = "0xFFFFFF" 182 | $CB_Radio_Hover_Color = "0xE8E8E8" 183 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 184 | Case "DarkGray" 185 | $GUIThemeColor = "0x1B2428" 186 | $FontThemeColor = "0xFFFFFF" 187 | $GUIBorderColor = "0x4F6772" 188 | $ButtonBKColor = "0x607D8B" 189 | $ButtonTextColor = "0xFFFFFF" 190 | $CB_Radio_Color = "0xFFFFFF" 191 | $CB_Radio_Hover_Color = "0xD8D8D8" 192 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 193 | Case "DarkAmber" 194 | $GUIThemeColor = "0x191919" 195 | $FontThemeColor = "0xFFFFFF" 196 | $GUIBorderColor = "0x2D2D2D" 197 | $ButtonBKColor = "0xffa000" 198 | $ButtonTextColor = "0xFFFFFF" 199 | $CB_Radio_Color = "0xFFFFFF" 200 | $CB_Radio_Hover_Color = "0xD8D8D8" 201 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 202 | Case "LightOrange" 203 | $GUIThemeColor = "0xD7D7D7" 204 | $FontThemeColor = "0x000000" 205 | $GUIBorderColor = "0xD8D8D8" 206 | $ButtonBKColor = "0xBC5E05" 207 | $ButtonTextColor = "0xFFFFFF" 208 | $CB_Radio_Color = "0xFFFFFF" 209 | $CB_Radio_Hover_Color = "0xE8E8E8" 210 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 211 | Case "DarkOrange" 212 | $GUIThemeColor = "0x191919" 213 | $FontThemeColor = "0xFFFFFF" 214 | $GUIBorderColor = "0x2D2D2D" 215 | $ButtonBKColor = "0xC76810" 216 | $ButtonTextColor = "0xFFFFFF" 217 | $CB_Radio_Color = "0xFFFFFF" 218 | $CB_Radio_Hover_Color = "0xD8D8D8" 219 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 220 | Case "LightPurple" 221 | $GUIThemeColor = "0xD7D7D7" 222 | $FontThemeColor = "0x000000" 223 | $GUIBorderColor = "0xD8D8D8" 224 | $ButtonBKColor = "0x512DA8" 225 | $ButtonTextColor = "0xFFFFFF" 226 | $CB_Radio_Color = "0xFFFFFF" 227 | $CB_Radio_Hover_Color = "0xE8E8E8" 228 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 229 | Case "DarkPurple" 230 | $GUIThemeColor = "0x191919" 231 | $FontThemeColor = "0xFFFFFF" 232 | $GUIBorderColor = "0x2D2D2D" 233 | $ButtonBKColor = "0x512DA8" 234 | $ButtonTextColor = "0xFFFFFF" 235 | $CB_Radio_Color = "0xFFFFFF" 236 | $CB_Radio_Hover_Color = "0xD8D8D8" 237 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 238 | Case "LightPink" 239 | $GUIThemeColor = "0xD7D7D7" 240 | $FontThemeColor = "0x000000" 241 | $GUIBorderColor = "0xD8D8D8" 242 | $ButtonBKColor = "0xE91E63" 243 | $ButtonTextColor = "0xFFFFFF" 244 | $CB_Radio_Color = "0xFFFFFF" 245 | $CB_Radio_Hover_Color = "0xE8E8E8" 246 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 247 | Case Else 248 | ConsoleWrite("Metro-UDF-Error: Theme not found, using default theme." & @CRLF) 249 | $GUIThemeColor = "0x191919" 250 | $FontThemeColor = "0xFFFFFF" 251 | $GUIBorderColor = "0x2D2D2D" 252 | $ButtonBKColor = "0x00796b" 253 | $ButtonTextColor = "0xFFFFFF" 254 | $CB_Radio_Color = "0xFFFFFF" 255 | $CB_Radio_Hover_Color = "0xD8D8D8" 256 | $CB_Radio_CheckMark_Color = "0x1a1a1a" 257 | $GUI_Theme_Name = "DarkTealV2" 258 | EndSwitch 259 | EndFunc ;==>_SetTheme 260 | -------------------------------------------------------------------------------- /GUI_Concepts/includes/MetroUDF-Required/SSCtrlHover.au3: -------------------------------------------------------------------------------- 1 | ;====================================== 2 | ;~ Author : binhnx 3 | ;~ Created : 2014/10/20 4 | ;====================================== 5 | ;~ Modified : BB_19 6 | ;~ Last modified : 2017/10/07 7 | ;====================================== 8 | 9 | #include-once 10 | #include 11 | #include 12 | Local $_cHvr_aData[0] 13 | 14 | 15 | Local Const $_cHvr_HDLLCOMCTL32 = _WinAPI_LoadLibrary('comctl32.dll') 16 | Assert($_cHvr_HDLLCOMCTL32 <> 0, 'This UDF requires comctl32.dll') 17 | Local Const $_cHvr_PDEFSUBCLASSPROC = _WinAPI_GetProcAddress($_cHvr_HDLLCOMCTL32, 'DefSubclassProc') 18 | Local Const $_cHvr_PINTERNALSUBCLASS_DLL = DllCallbackRegister('_cHvr_iProc', 'NONE', 'HWND;UINT;WPARAM;LPARAM;DWORD') 19 | Local Const $_cHvr_PINTERNALSUBCLASS = DllCallbackGetPtr($_cHvr_PINTERNALSUBCLASS_DLL) 20 | 21 | OnAutoItExitRegister("_cHvr_Finalize") 22 | Local Const $_cHvr_TSUBCLASSEXE = Call(@AutoItX64 ? '_cHvr_CSCP_X64' : '_cHvr_CSCP_X86') 23 | Local Const $_cHvr_HEXECUTABLEHEAP = DllCall('kernel32.dll', 'HANDLE', 'HeapCreate', 'DWORD', 0x00040000, 'ULONG_PTR', 0, 'ULONG_PTR', 0)[0] 24 | Assert($_cHvr_HEXECUTABLEHEAP <> 0, 'Failed to create executable heap object') 25 | Local Const $_cHvr_PSUBCLASSEXE = _cHvr_ExecutableFromStruct(Call(@AutoItX64 ? '_cHvr_CSCP_X64' : '_cHvr_CSCP_X86')) 26 | 27 | 28 | Func _cHvr_Register($idCtrl, $fnHovOff = '', $fnHoverOn = '', $fnClick = '', $fnDblClk = '', $HoverData = 0,$ClickData = 0,$fnRightClick = '') 29 | Local $hWnd = GUICtrlGetHandle($idCtrl) 30 | If (Not (IsHWnd($hWnd))) Then Return SetError(1, 0, -1) 31 | Local $nIndex = _cHvr_GetNewIndex($hWnd) 32 | Local $aData[13] 33 | $aData[0] = $hWnd;Control Hwnd 34 | $aData[1] = $idCtrl; Control handle 35 | $aData[3] = $fnHovOff;Hover Off func 36 | $aData[4] = $HoverData;Hover Off Data 37 | $aData[5] = $fnHoverOn;Hover ON func 38 | $aData[6] = $HoverData;Hover ON Data 39 | $aData[7] = $fnRightClick;RClick func 40 | $aData[8] = $ClickData; click data 41 | $aData[9] = $fnClick;Click func 42 | $aData[10] = $ClickData; click data 43 | $aData[11] = $fnDblClk;DB click func 44 | $aData[12] = $ClickData;DB click data 45 | $_cHvr_aData[$nIndex] = $aData 46 | _WinAPI_SetWindowSubclass($hWnd, $_cHvr_PSUBCLASSEXE, $hWnd, $nIndex) 47 | Return $nIndex 48 | EndFunc ;==>_cHvr_Register 49 | 50 | Func _cHvr_iProc($hWnd, $uMsg, $wParam, $lParam, $cIndex) 51 | Switch $uMsg 52 | Case 0x0200;Hover 53 | GUISetCursor(2, 1) 54 | _cHvr_cMove($_cHvr_aData[$cIndex], $hWnd, $uMsg, $wParam, $lParam) 55 | Case 0x0201;Leftclick 56 | _cHvr_cDown($_cHvr_aData[$cIndex], $hWnd, $uMsg, $wParam, $lParam) 57 | Case 0x0202 58 | _cHvr_cUp($_cHvr_aData[$cIndex], $hWnd, $uMsg, $wParam, $lParam) 59 | Return False 60 | Case 0x0203;Doubleclick 61 | _cHvr_cDblClk($_cHvr_aData[$cIndex], $hWnd, $uMsg, $wParam, $lParam) 62 | Case 0x0204;Rightclick 63 | _cHvr_cRightClk($_cHvr_aData[$cIndex], $hWnd, $uMsg, $wParam, $lParam) 64 | Case 0x02A3;Hover leave 65 | _cHvr_cLeave($_cHvr_aData[$cIndex], $hWnd, $uMsg, $wParam, $lParam) 66 | Case 0x0082;Deleted 67 | _cHvr_UnRegisterInternal($cIndex, $hWnd) 68 | EndSwitch 69 | Return True 70 | EndFunc ;==>_cHvr_iProc 71 | 72 | Func _cHvr_cDown(ByRef $aCtrlData, $hWnd, $uMsg, ByRef $wParam, ByRef $lParam) 73 | _WinAPI_SetCapture($hWnd) 74 | _cHvr_CallFunc($aCtrlData, 9) 75 | EndFunc ;==>_cHvr_cDown 76 | 77 | Func _cHvr_cMove(ByRef $aCtrlData, $hWnd, $uMsg, ByRef $wParam, ByRef $lParam) 78 | If (_WinAPI_GetCapture() = $hWnd) Then 79 | Local $bIn = _cHvr_IsInClient($hWnd, $lParam) 80 | If Not $aCtrlData[2] Then 81 | If $bIn Then 82 | $aCtrlData[2] = 1 83 | _cHvr_CallFunc($aCtrlData, 9) 84 | EndIf 85 | Else 86 | If Not $bIn Then 87 | $aCtrlData[2] = 0 88 | _cHvr_CallFunc($aCtrlData, 3) 89 | EndIf 90 | EndIf 91 | ElseIf Not $aCtrlData[2] Then 92 | $aCtrlData[2] = 1 93 | _cHvr_CallFunc($aCtrlData, 5) 94 | Local $tTME = DllStructCreate('DWORD;DWORD;HWND;DWORD') 95 | DllStructSetData($tTME, 1, DllStructGetSize($tTME)) 96 | DllStructSetData($tTME, 2, 2) ;$TME_LEAVE 97 | DllStructSetData($tTME, 3, $hWnd) 98 | DllCall('user32.dll', 'BOOL', 'TrackMouseEvent', 'STRUCT*', $tTME) 99 | EndIf 100 | EndFunc ;==>_cHvr_cMove 101 | 102 | Func _cHvr_cUp(ByRef $aCtrlData, $hWnd, $uMsg, ByRef $wParam, ByRef $lParam) 103 | Local $lRet = _WinAPI_DefSubclassProc($hWnd, $uMsg, $wParam, $lParam) 104 | If (_WinAPI_GetCapture() = $hWnd) Then 105 | _WinAPI_ReleaseCapture() 106 | If _cHvr_IsInClient($hWnd, $lParam) Then 107 | _cHvr_CallFunc($aCtrlData, 9) 108 | EndIf 109 | EndIf 110 | Return $lRet 111 | EndFunc ;==>_cHvr_cUp 112 | 113 | Func _cHvr_cDblClk(ByRef $aCtrlData, $hWnd, $uMsg, ByRef $wParam, ByRef $lParam) 114 | _cHvr_CallFunc($aCtrlData, 11) 115 | EndFunc ;==>_cHvr_cDblClk 116 | 117 | Func _cHvr_cRightClk(ByRef $aCtrlData, $hWnd, $uMsg, ByRef $wParam, ByRef $lParam) 118 | _cHvr_CallFunc($aCtrlData, 7) 119 | EndFunc ;==>_cHvr_cDblClk 120 | 121 | Func _cHvr_cLeave(ByRef $aCtrlData, $hWnd, $uMsg, ByRef $wParam, ByRef $lParam) 122 | $aCtrlData[2] = 0 123 | _cHvr_CallFunc($aCtrlData, 3) 124 | EndFunc ;==>_cHvr_cLeave 125 | 126 | Func _cHvr_CallFunc(ByRef $aCtrlData, $iCallType) 127 | Call($aCtrlData[$iCallType], $aCtrlData[1], $aCtrlData[$iCallType + 1]) 128 | EndFunc ;==>_cHvr_CallFunc 129 | 130 | Func _cHvr_ArrayPush(ByRef $aStackArr, Const $vSrc1 = Default, Const $vSrc2 = Default, Const $vSrc3 = Default, Const $vSrc4 = Default, Const $vSrc5 = Default) 131 | While (UBound($aStackArr) < ($aStackArr[0] + @NumParams)) 132 | ReDim $aStackArr[UBound($aStackArr) * 2] 133 | WEnd 134 | 135 | If Not ($vSrc1 = Default) Then 136 | $aStackArr[0] += 1 137 | $aStackArr[$aStackArr[0]] = $vSrc1 138 | EndIf 139 | If Not ($vSrc2 = Default) Then 140 | $aStackArr[0] += 1 141 | $aStackArr[$aStackArr[0]] = $vSrc2 142 | EndIf 143 | If Not ($vSrc3 = Default) Then 144 | $aStackArr[0] += 1 145 | $aStackArr[$aStackArr[0]] = $vSrc3 146 | EndIf 147 | If Not ($vSrc4 = Default) Then 148 | $aStackArr[0] += 1 149 | $aStackArr[$aStackArr[0]] = $vSrc4 150 | EndIf 151 | If Not ($vSrc5 = Default) Then 152 | $aStackArr[0] += 1 153 | $aStackArr[$aStackArr[0]] = $vSrc5 154 | EndIf 155 | EndFunc ;==>_cHvr_ArrayPush 156 | 157 | Func _cHvr_IsInClient($hWnd, $lParam) 158 | Local $iX = BitShift(BitShift($lParam, -16), 16) 159 | Local $iY = BitShift($lParam, 16) 160 | Local $aSize = WinGetClientSize($hWnd) 161 | Return Not ($iX < 0 Or $iY < 0 Or $iX > $aSize[0] Or $iY > $aSize[1]) 162 | EndFunc ;==>_cHvr_IsInClient 163 | 164 | Func _cHvr_CSCP_X86() ;Create Subclass Process x86 165 | ; $hWnd HWND size: 4 ESP+4 EBP+8 166 | ; $uMsg UINT size: 4 ESP+8 EBP+12 167 | ; $wParam WPARAM size: 4 ESP+12 EBP+16 168 | ; $lParam LPARAM size: 4 ESP+16 EBP+20 169 | ; $uIdSubclass UINT_PTR size: 4 ESP+20 EBP+24 170 | ; $dwRefData DWORD_PTR size: 4 ESP+24 EBP+28 Total: 24 171 | 172 | ; NERVER FORGET ADDING align 1 OR YOU WILL SPEND HOURS TO FIND WHAT CAUSE 0xC0000005 Access Violation 173 | Local $sExe = 'align 1;' 174 | Local $aOpCode[100] 175 | $aOpCode[0] = 0 176 | Local $nAddrOffset[5] 177 | Local $nElemOffset[5] 178 | 179 | ; Func ; __stdcall 180 | $sExe &= 'BYTE;BYTE;BYTE;' 181 | _cHvr_ArrayPush($aOpCode, 0x55) ;push ebp 182 | _cHvr_ArrayPush($aOpCode, 0x8B, 0xEC) ;mov ebp, esp 183 | 184 | ; Save un-modified params to nv register 185 | $sExe &= 'BYTE;' ;push ebx 186 | _cHvr_ArrayPush($aOpCode, 0x53) ;53 187 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov ebx, DWORD PTR [ebp+16] 188 | _cHvr_ArrayPush($aOpCode, 0x8B, 0x5D, 16) ;8b 5d 10 189 | $sExe &= 'BYTE;' ;push esi 190 | _cHvr_ArrayPush($aOpCode, 0x56) ;56 191 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov esi, DWORD PTR [ebp+12] 192 | _cHvr_ArrayPush($aOpCode, 0x8B, 0x75, 12) ;8b 75 0c 193 | $sExe &= 'BYTE;' ;push edi 194 | _cHvr_ArrayPush($aOpCode, 0x57) ;57 195 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov ebx, DWORD PTR [ebp+20] 196 | _cHvr_ArrayPush($aOpCode, 0x8B, 0x7D, 20) ;8b 7d 14 197 | 198 | ; If ($uMsg = 0x0082) Then Goto WndProcInternal ;WM_NCDESTROY 199 | $sExe &= 'BYTE;BYTE;DWORD;' ;cmp esi, 0x82 200 | _cHvr_ArrayPush($aOpCode, 0x81, 0xFE, 0x82) ;81 fe 82 00 00 00 201 | $sExe &= 'BYTE;BYTE;' ;je short WndProcInternal 202 | _cHvr_ArrayPush($aOpCode, 0x74, 0) ;74 BYTE_OFFSET 203 | $nAddrOffset[0] = DllStructGetSize(DllStructCreate($sExe)) 204 | $nElemOffset[0] = $aOpCode[0] 205 | 206 | ; ElseIf ($uMsg = 0x02A3) Then Goto WndProcInternal ;WM_MOUSELEAVE 207 | $sExe &= 'BYTE;BYTE;DWORD;' ;cmp esi, 0x2A3 208 | _cHvr_ArrayPush($aOpCode, 0x81, 0xFE, 0x2A3) ;81 fe a3 02 00 00 209 | $sExe &= 'BYTE;BYTE;' ;je short WndProcInternal 210 | _cHvr_ArrayPush($aOpCode, 0x74, 0) ;74 BYTE_OFFSET 211 | $nAddrOffset[1] = DllStructGetSize(DllStructCreate($sExe)) 212 | $nElemOffset[1] = $aOpCode[0] 213 | 214 | ; ElseIf ($uMsg < 0x200 Or $uMsg > 0x203) Then Goto DefaultWndProc 215 | $sExe &= 'BYTE;BYTE;BYTE;' ;lea eax, DWORD PTR [esi-0x200] 216 | _cHvr_ArrayPush($aOpCode, 0x8D, 0x86, -0x200) ;8d 86 00 02 00 00 217 | $sExe &= 'BYTE;BYTE;BYTE;' ;cmp eax, 3 218 | _cHvr_ArrayPush($aOpCode, 0x83, 0xF8, 3) ;83 f8 03 219 | $sExe &= 'BYTE;BYTE;' ;ja short DefaultWndProc 220 | _cHvr_ArrayPush($aOpCode, 0x77, 0) ;77 BYTE_OFFSET 221 | $nAddrOffset[2] = DllStructGetSize(DllStructCreate($sExe)) 222 | $nElemOffset[2] = $aOpCode[0] 223 | 224 | ; :WndProcInternal (HWND, UINT, WPARAM, LPARAM, DWORD) 225 | $aOpCode[$nElemOffset[0]] = $nAddrOffset[2] - $nAddrOffset[0] 226 | $aOpCode[$nElemOffset[1]] = $nAddrOffset[2] - $nAddrOffset[1] 227 | 228 | ; Prepare stack 229 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov ecx, DWORD PTR [ebp+28] 230 | _cHvr_ArrayPush($aOpCode, 0x8B, 0x4D, 28) ;8b 4d 1c 231 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov edx, DWORD PTR [ebp+8] 232 | _cHvr_ArrayPush($aOpCode, 0x8B, 0x55, 8) ;8b 55 08 233 | $sExe &= 'BYTE;' ;push ecx 234 | _cHvr_ArrayPush($aOpCode, 0x51) ;51 235 | $sExe &= 'BYTE;' ;push edi 236 | _cHvr_ArrayPush($aOpCode, 0x57) ;57 237 | $sExe &= 'BYTE;' ;push ebx 238 | _cHvr_ArrayPush($aOpCode, 0x53) ;53 239 | $sExe &= 'BYTE;' ;push esi 240 | _cHvr_ArrayPush($aOpCode, 0x56) ;56 241 | $sExe &= 'BYTE;' ;push edx 242 | _cHvr_ArrayPush($aOpCode, 0x52) ;52 243 | 244 | ; Call 245 | $sExe &= 'BYTE;PTR;' ;mov eax, _cHvr_iProc 246 | _cHvr_ArrayPush($aOpCode, 0xB8, $_cHvr_PINTERNALSUBCLASS) 247 | $sExe &= 'BYTE;BYTE;' ;call near eax 248 | _cHvr_ArrayPush($aOpCode, 0xFF, 0xD0) ;ff 75 8 249 | 250 | ; If (WndProcInternal() = 0) Then Return 251 | $sExe &= 'BYTE;BYTE;' ;test eax, eax 252 | _cHvr_ArrayPush($aOpCode, 0x85, 0xC0) ;85 c0 253 | $sExe &= 'BYTE;BYTE;' ;jz short Return 254 | _cHvr_ArrayPush($aOpCode, 0x74, 0) ;74 BYTE_OFFSET 255 | $nAddrOffset[3] = DllStructGetSize(DllStructCreate($sExe)) 256 | $nElemOffset[3] = $aOpCode[0] 257 | 258 | ; :DefaultWndProc (HWND, UINT, WPARAM, LPARAM) 259 | $aOpCode[$nElemOffset[2]] = $nAddrOffset[3] - $nAddrOffset[2] 260 | 261 | ; Prepare stack 262 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov eax, DWORD PTR [ebp+8] 263 | _cHvr_ArrayPush($aOpCode, 0x8B, 0x45, 8) 264 | $sExe &= 'BYTE;' ;push edi 265 | _cHvr_ArrayPush($aOpCode, 0x57) ;57 266 | $sExe &= 'BYTE;' ;push ebx 267 | _cHvr_ArrayPush($aOpCode, 0x53) ;53 268 | $sExe &= 'BYTE;' ;push esi 269 | _cHvr_ArrayPush($aOpCode, 0x56) ;56 270 | $sExe &= 'BYTE;' ;push eax 271 | _cHvr_ArrayPush($aOpCode, 0x50) ;50 272 | 273 | ;Call 274 | $sExe &= 'BYTE;PTR;' ;mov eax,COMCTL32.DefSubclassProc 275 | _cHvr_ArrayPush($aOpCode, 0xB8, $_cHvr_PDEFSUBCLASSPROC) 276 | $sExe &= 'BYTE;BYTE;' ;call near eax 277 | _cHvr_ArrayPush($aOpCode, 0xFF, 0xD0) ;ff 75 8 278 | $nAddrOffset[4] = DllStructGetSize(DllStructCreate($sExe)) 279 | 280 | ; :Return 281 | $aOpCode[$nElemOffset[3]] = $nAddrOffset[4] - $nAddrOffset[3] 282 | 283 | ; Restore nv-register 284 | $sExe &= 'BYTE;BYTE;BYTE;' 285 | _cHvr_ArrayPush($aOpCode, 0x5F) ;pop edi 286 | _cHvr_ArrayPush($aOpCode, 0x5E) ;pop esi 287 | _cHvr_ArrayPush($aOpCode, 0x5B) ;pop ebx 288 | 289 | 290 | ; EndFunc 291 | $sExe &= 'BYTE;BYTE;BYTE;WORD' 292 | _cHvr_ArrayPush($aOpCode, 0x5D) ;pop ebp 293 | _cHvr_ArrayPush($aOpCode, 0xC2, 24) ;ret 24 294 | 295 | Return _cHvr_PopulateOpcode($sExe, $aOpCode) 296 | EndFunc ;==>_cHvr_CSCP_X86 297 | 298 | Func _cHvr_CSCP_X64() ;Create Subclass Process x64 299 | ; First four INT and UINT has size = 8 instead of 4 because they are stored in RCX, RDX, R8, R9 300 | ; $hWnd HWND size: 8 RCX RSP+8 301 | ; $uMsg UINT size: 8 EDX RSP+16 302 | ; $wParam WPARAM size: 8 R8 RSP+24 303 | ; $lParam LPARAM size: 8 R9 RSP+32 304 | ; $uIdSubclass UINT_PTR size: 8 RSP+40 305 | ; $dwRefData DWORD_PTR size: 8 RSP+48 Total: 48 306 | Local $sExe = 'align 1;' 307 | Local $aOpCode[100] 308 | $aOpCode[0] = 0 309 | Local $nAddrOffset[5] 310 | Local $nElemOffset[5] 311 | 312 | ; If ($uMsg = 0x0082) Then Goto WndProcInternal ;WM_NCDESTROY 313 | $sExe &= 'BYTE;BYTE;DWORD;' ;cmp edx, 0x82 314 | _cHvr_ArrayPush($aOpCode, 0x81, 0xFA, 0x82) ;81 fa 82 00 00 00 315 | $sExe &= 'BYTE;BYTE;' ;je short WndProcInternal 316 | _cHvr_ArrayPush($aOpCode, 0x74, 0) ;74 BYTE_OFFSET 317 | $nAddrOffset[0] = DllStructGetSize(DllStructCreate($sExe)) 318 | $nElemOffset[0] = $aOpCode[0] 319 | 320 | ; ElseIf ($uMsg = 0x02A3) Then Goto WndProcInternal ;WM_MOUSELEAVE 321 | $sExe &= 'BYTE;BYTE;DWORD;' ;cmp edx, 0x2A3 322 | _cHvr_ArrayPush($aOpCode, 0x81, 0xFA, 0x2A3) ;81 fa a3 02 00 00 323 | $sExe &= 'BYTE;BYTE;' ;je short WndProcInternal 324 | _cHvr_ArrayPush($aOpCode, 0x74, 0) ;74 BYTE_OFFSET 325 | $nAddrOffset[1] = DllStructGetSize(DllStructCreate($sExe)) 326 | $nElemOffset[1] = $aOpCode[0] 327 | 328 | ; ElseIf ($uMsg < 0x200 Or $uMsg > 0x203) Then Goto DefaultWndProc 329 | $sExe &= 'BYTE;BYTE;DWORD;' ;lea eax, DWORD PTR [rdx-0x200] 330 | _cHvr_ArrayPush($aOpCode, 0x8D, 0x82, -0x200) ;8d 82 00 02 00 00 331 | $sExe &= 'BYTE;BYTE;BYTE;' ;cmp eax, 3 332 | _cHvr_ArrayPush($aOpCode, 0x83, 0xF8, 3) ;83 f8 03 333 | $sExe &= 'BYTE;BYTE;' ;ja short DefaultWndProc 334 | _cHvr_ArrayPush($aOpCode, 0x77, 0) ;77 BYTE_OFFSET 335 | $nAddrOffset[2] = DllStructGetSize(DllStructCreate($sExe)) 336 | $nElemOffset[2] = $aOpCode[0] 337 | $aOpCode[$nElemOffset[0]] = $nAddrOffset[2] - $nAddrOffset[0] 338 | $aOpCode[$nElemOffset[1]] = $nAddrOffset[2] - $nAddrOffset[1] 339 | 340 | 341 | ; :WndProcInternal (HWND rsp+8, UINT +16, WPARAM +24, LPARAM +32, DWORD +40) 342 | ; $dwRefData = [ESP+48+48(sub rsp, 48)+8(push rdi)] = [ESP+104] 343 | ; Save base registers: 344 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;BYTE;' ;mov QWORD PTR [rsp+8], rbx 345 | _cHvr_ArrayPush($aOpCode, 0x48, 0x89, 0x5C, 0x24, 8) ;48 89 5c 24 08 346 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;BYTE;' ;mov QWORD PTR [rsp+16], rbp 347 | _cHvr_ArrayPush($aOpCode, 0x48, 0x89, 0x6C, 0x24, 16) ;48 89 6c 24 10 348 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;BYTE;' ;mov QWORD PTR [rsp+24], rsi 349 | _cHvr_ArrayPush($aOpCode, 0x48, 0x89, 0x74, 0x24, 24) ;48 89 74 24 18 350 | $sExe &= 'BYTE;' ;push rdi 351 | _cHvr_ArrayPush($aOpCode, 0x57) ;57 352 | ; Max sub-routine params = 5 (size = 5*8 = 40), + 8 bytes for return value = 48. 353 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;' ;sub rsp, 48 354 | _cHvr_ArrayPush($aOpCode, 0x48, 0x83, 0xEC, 48) ;48 83 ec 30 355 | ; rbx, rbp, rsi now at [ESP+8+56], [ESP+16+56], [ESP+24+56] 356 | 357 | ; Save the parameters: 358 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov rdi, r9 359 | _cHvr_ArrayPush($aOpCode, 0x49, 0x8B, 0xF9) ;49 8b f9 360 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov rsi, r8 361 | _cHvr_ArrayPush($aOpCode, 0x49, 0x8B, 0xF0) ;49 8b f0 362 | $sExe &= 'BYTE;BYTE;' ;mov ebx, edx 363 | _cHvr_ArrayPush($aOpCode, 0x8B, 0xDA) ;8b da 364 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov rbp, rcx 365 | _cHvr_ArrayPush($aOpCode, 0x48, 0x8B, 0xE9) ;48 8b e9 366 | 367 | ; Prepare additional parameter for internal WndProc 368 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;BYTE;' ;mov rax, QWORD PTR [rsp+104] 369 | _cHvr_ArrayPush($aOpCode, 0x48, 0x8B, 0x44, 0x24, 104) ;48 8b 44 24 68 370 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;BYTE;' ;mov QWORD PTR [rsp+32], Rax] 371 | _cHvr_ArrayPush($aOpCode, 0x48, 0x89, 0x44, 0x24, 32) ;48 89 44 24 20 372 | 373 | ; Call internal WndProc 374 | $sExe &= 'BYTE;BYTE;PTR;' ;mov rax, QWORD PTR _cHvr_iProc 375 | _cHvr_ArrayPush($aOpCode, 0x48, 0xB8, $_cHvr_PINTERNALSUBCLASS) 376 | ;movabs rax, _cHvr_iProc ;48 b8 QWORD_PTR 377 | $sExe &= 'BYTE;BYTE;' ;call rax 378 | _cHvr_ArrayPush($aOpCode, 0xFF, 0xD0) ;ff d0 379 | 380 | ; If (WndProcInternal() = 0) Then Return 381 | $sExe &= 'BYTE;BYTE;BYTE;' ;cmp edx, 0x2A3 382 | _cHvr_ArrayPush($aOpCode, 0x48, 0x85, 0xC0) ;48 85 c0 383 | $sExe &= 'BYTE;BYTE;' ;je short WndProcInternal 384 | _cHvr_ArrayPush($aOpCode, 0x74, 0) 385 | $nAddrOffset[3] = DllStructGetSize(DllStructCreate($sExe)) 386 | $nElemOffset[3] = $aOpCode[0] 387 | 388 | ; Restore parameters for DefSubclassProc call 389 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov r9, rdi 390 | _cHvr_ArrayPush($aOpCode, 0x4C, 0x8B, 0xCF) ;4c 8b cf 391 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov r8, rsi 392 | _cHvr_ArrayPush($aOpCode, 0x4C, 0x8B, 0xC6) ;4c 8b c6 393 | $sExe &= 'BYTE;BYTE;' ;mov edx, ebx 394 | _cHvr_ArrayPush($aOpCode, 0x8B, 0xD3) ;8b d3 395 | $sExe &= 'BYTE;BYTE;BYTE;' ;mov rcx, rbp 396 | _cHvr_ArrayPush($aOpCode, 0x48, 0x8B, 0xCD) ;48 8b cd 397 | 398 | ; Restore registers value 399 | $aOpCode[$nElemOffset[3]] = DllStructGetSize(DllStructCreate($sExe)) - $nAddrOffset[3] 400 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;BYTE;' ;mov rbx, QWORD PTR [rsp+64] 401 | _cHvr_ArrayPush($aOpCode, 0x48, 0x8B, 0x5C, 0x24, 64) ;48 8b 5c 24 40 402 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;BYTE;' ;mov rbp, QWORD PTR [rsp+72] 403 | _cHvr_ArrayPush($aOpCode, 0x48, 0x8B, 0x6C, 0x24, 72) ;48 8b 6c 24 48 404 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;BYTE;' ;mov rsi, QWORD PTR [rsp+80] 405 | _cHvr_ArrayPush($aOpCode, 0x48, 0x8B, 0x74, 0x24, 80) ;48 8b 74 24 50 406 | $sExe &= 'BYTE;BYTE;BYTE;BYTE;' ;add rsp, 48 407 | _cHvr_ArrayPush($aOpCode, 0x48, 0x83, 0xc4, 48) ;48 83 c4 30 408 | $sExe &= 'BYTE;' ;pop rdi 409 | _cHvr_ArrayPush($aOpCode, 0x5F) ;5f 410 | $sExe &= 'BYTE;BYTE;BYTE;' ;cmp edx, 0x2A3 411 | _cHvr_ArrayPush($aOpCode, 0x48, 0x85, 0xC0) ;48 85 c0 412 | $sExe &= 'BYTE;BYTE;' ;je short WndProcInternal 413 | _cHvr_ArrayPush($aOpCode, 0x74, 0) 414 | $nAddrOffset[4] = DllStructGetSize(DllStructCreate($sExe)) 415 | $nElemOffset[4] = $aOpCode[0] 416 | $aOpCode[$nElemOffset[2]] = DllStructGetSize(DllStructCreate($sExe)) - $nAddrOffset[2] 417 | 418 | ; :DefaultWndProc (HWND, UINT, WPARAM, LPARAM) 419 | $sExe &= 'BYTE;BYTE;PTR;' 420 | _cHvr_ArrayPush($aOpCode, 0x48, 0xB8, $_cHvr_PDEFSUBCLASSPROC) 421 | $sExe &= 'BYTE;BYTE;' 422 | _cHvr_ArrayPush($aOpCode, 0xFF, 0xE0) 423 | 424 | ; :Return 425 | $aOpCode[$nElemOffset[4]] = DllStructGetSize(DllStructCreate($sExe)) - $nAddrOffset[4] 426 | $sExe &= 'BYTE;' ;ret 0 427 | _cHvr_ArrayPush($aOpCode, 0xC3) 428 | 429 | Return _cHvr_PopulateOpcode($sExe, $aOpCode) 430 | EndFunc ;==>_cHvr_CSCP_X64 431 | 432 | Func _cHvr_PopulateOpcode(ByRef $sExe, ByRef $aOpCode) 433 | Local $tExe = DllStructCreate($sExe) 434 | Assert(@error = 0, 'DllStrucCreate Failed With Error = ' & @error) 435 | For $i = 1 To $aOpCode[0] 436 | DllStructSetData($tExe, $i, $aOpCode[$i]) 437 | Next 438 | Return $tExe 439 | EndFunc ;==>_cHvr_PopulateOpcode 440 | 441 | Func _cHvr_ExecutableFromStruct($tExe) 442 | Local $pExe = DllCall('kernel32.dll', 'PTR', 'HeapAlloc', 'HANDLE', $_cHvr_HEXECUTABLEHEAP, 'DWORD', 8, 'ULONG_PTR', DllStructGetSize($tExe))[0] 443 | Assert($pExe <> 0, 'Allocate memory failed') 444 | DllCall("kernel32.dll", "none", "RtlMoveMemory", "PTR", $pExe, "PTR", DllStructGetPtr($tExe), "ULONG_PTR", DllStructGetSize($tExe)) 445 | Assert(@error = 0, 'Failed to copy memory') 446 | Return $pExe 447 | EndFunc ;==>_cHvr_ExecutableFromStruct 448 | 449 | Func _cHvr_UnRegisterInternal($cIndex, $hWnd) 450 | _WinAPI_RemoveWindowSubclass($hWnd, $_cHvr_PSUBCLASSEXE, $hWnd) 451 | Local $aData=$_cHvr_aData[$cIndex] 452 | $_cHvr_aData[$cIndex] = 0 453 | Call( "_iControlDelete",$aData[1]) 454 | EndFunc ;==>_cHvr_UnRegisterInternal 455 | 456 | Func _cHvr_Finalize() 457 | DllCallbackFree($_cHvr_PINTERNALSUBCLASS_DLL) 458 | _WinAPI_FreeLibrary($_cHvr_HDLLCOMCTL32) 459 | If ($_cHvr_HEXECUTABLEHEAP <> 0) Then 460 | If ($_cHvr_PSUBCLASSEXE <> 0) Then 461 | DllCall('kernel32.dll', 'BOOL', 'HeapFree', 'HANDLE', $_cHvr_HEXECUTABLEHEAP, 'DWORD', 0, 'PTR', $_cHvr_PSUBCLASSEXE) 462 | EndIf 463 | DllCall('kernel32.dll', 'BOOL', 'HeapDestroy', 'HANDLE', $_cHvr_HEXECUTABLEHEAP) 464 | EndIf 465 | EndFunc ;==>_cHvr_Finalize 466 | 467 | Func Assert($bExpression, $sMsg = '', $sScript = @ScriptName, $sScriptPath = @ScriptFullPath, $iLine = @ScriptLineNumber, $iError = @error, $iExtend = @extended) 468 | If (Not ($bExpression)) Then 469 | MsgBox(BitOR(1, 0x10), 'Assertion Error!', _ 470 | @CRLF & 'Script' & @TAB & ': ' & $sScript _ 471 | & @CRLF & 'Path' & @TAB & ': ' & $sScriptPath _ 472 | & @CRLF & 'Line' & @TAB & ': ' & $iLine _ 473 | & @CRLF & 'Error' & @TAB & ': ' & ($iError > 0x7FFF ? Hex($iError) : $iError) _ 474 | & ($iExtend <> 0 ? ' (Extended : ' & ($iExtend > 0x7FFF ? Hex($iExtend) : $iExtend) & ')' : '') _ 475 | & @CRLF & 'Message' & @TAB & ': ' & $sMsg _ 476 | & @CRLF & @CRLF & 'OK: Exit Script' & @TAB & 'Cancel: Continue') 477 | Exit 478 | EndIf 479 | EndFunc ;==>Assert 480 | 481 | Func _cHvr_GetNewIndex($hWnd) 482 | ;Try to assign index from previously deleted control 483 | For $i = 0 To UBound($_cHvr_aData) - 1 Step +1 484 | If Not IsArray($_cHvr_aData[$i]) Then 485 | Return $i 486 | EndIf 487 | Next 488 | 489 | ReDim $_cHvr_aData[UBound($_cHvr_aData) + 1] 490 | Return UBound($_cHvr_aData) - 1 491 | EndFunc ;==>_cHvr_GetNewIndex 492 | 493 | Func _WinAPI_GetCapture() 494 | Return DllCall("user32.dll", "HWND", "GetCapture")[0] 495 | EndFunc ;==>_WinAPI_GetCapture 496 | -------------------------------------------------------------------------------- /GUI_Concepts/includes/MetroUDF-Required/StringSize.au3: -------------------------------------------------------------------------------- 1 | #include-once 2 | 3 | ; #INDEX# ============================================================================================================ 4 | ; Title .........: _StringSize 5 | ; AutoIt Version : v3.2.12.1 or higher 6 | ; Language ......: English 7 | ; Description ...: Returns size of rectangle required to display string - maximum width can be chosen 8 | ; Remarks .......: 9 | ; Note ..........: 10 | ; Author(s) .....: Melba23 - thanks to trancexx for the default DC code 11 | ; ==================================================================================================================== 12 | 13 | ;#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 14 | 15 | ; #CURRENT# ========================================================================================================== 16 | ; _StringSize: Returns size of rectangle required to display string - maximum width can be chosen 17 | ; ==================================================================================================================== 18 | 19 | ; #INTERNAL_USE_ONLY#================================================================================================= 20 | ; _StringSize_Error_Close: Releases DC and deletes font object after error 21 | ; _StringSize_DefaultFontName: Determines Windows default font 22 | ; ==================================================================================================================== 23 | 24 | ; #FUNCTION# ========================================================================================================= 25 | ; Name...........: _StringSize 26 | ; Description ...: Returns size of rectangle required to display string - maximum permitted width can be chosen 27 | ; Syntax ........: _StringSize($sText[, $iSize[, $iWeight[, $iAttrib[, $sName[, $iWidth[, $hWnd]]]]]]) 28 | ; Parameters ....: $sText - String to display 29 | ; $iSize - [optional] Font size in points - (default = 8.5) 30 | ; $iWeight - [optional] Font weight - (default = 400 = normal) 31 | ; $iAttrib - [optional] Font attribute (0-Normal (default), 2-Italic, 4-Underline, 8 Strike) 32 | ; + 1 if tabs are to be expanded before sizing 33 | ; $sName - [optional] Font name - (default = Tahoma) 34 | ; $iWidth - [optional] Max width for rectangle - (default = 0 => width of original string) 35 | ; $hWnd - [optional] GUI in which string will be displayed - (default 0 => normally not required) 36 | ; Requirement(s) : v3.2.12.1 or higher 37 | ; Return values .: Success - Returns 4-element array: ($iWidth set // $iWidth not set) 38 | ; |$array[0] = String reformatted with additonal @CRLF // Original string 39 | ; |$array[1] = Height of single line in selected font // idem 40 | ; |$array[2] = Width of rectangle required for reformatted // original string 41 | ; |$array[3] = Height of rectangle required for reformatted // original string 42 | ; Failure - Returns 0 and sets @error: 43 | ; |1 - Incorrect parameter type (@extended = parameter index) 44 | ; |2 - DLL call error - extended set as follows: 45 | ; |1 - GetDC failure 46 | ; |2 - SendMessage failure 47 | ; |3 - GetDeviceCaps failure 48 | ; |4 - CreateFont failure 49 | ; |5 - SelectObject failure 50 | ; |6 - GetTextExtentPoint32 failure 51 | ; |3 - Font too large for chosen max width - a word will not fit 52 | ; Author ........: Melba23 - thanks to trancexx for the default DC code 53 | ; Modified ......: 54 | ; Remarks .......: The use of the $hWnd parameter is not normally necessary - it is only required if the UDF does not 55 | ; return correct dimensions without it. 56 | ; Related .......: 57 | ; Link ..........: 58 | ; Example .......: Yes 59 | ;===================================================================================================================== 60 | Func _StringSize($sText, $iSize = 8.5, $iWeight = 400, $iAttrib = 0, $sName = "", $iMaxWidth = 0, $hWnd = 0) 61 | 62 | ; Set parameters passed as Default 63 | If $iSize = Default Then $iSize = 8.5 64 | If $iWeight = Default Then $iWeight = 400 65 | If $iAttrib = Default Then $iAttrib = 0 66 | If $sName = "" Or $sName = Default Then $sName = _StringSize_DefaultFontName() 67 | 68 | ; Check parameters are correct type 69 | If Not IsString($sText) Then Return SetError(1, 1, 0) 70 | If Not IsNumber($iSize) Then Return SetError(1, 2, 0) 71 | If Not IsInt($iWeight) Then Return SetError(1, 3, 0) 72 | If Not IsInt($iAttrib) Then Return SetError(1, 4, 0) 73 | If Not IsString($sName) Then Return SetError(1, 5, 0) 74 | If Not IsNumber($iMaxWidth) Then Return SetError(1, 6, 0) 75 | If Not IsHwnd($hWnd) And $hWnd <> 0 Then Return SetError(1, 7, 0) 76 | 77 | Local $aRet, $hDC, $hFont, $hLabel = 0, $hLabel_Handle 78 | 79 | ; Check for tab expansion flag 80 | Local $iExpTab = BitAnd($iAttrib, 1) 81 | ; Remove possible tab expansion flag from font attribute value 82 | $iAttrib = BitAnd($iAttrib, BitNot(1)) 83 | 84 | ; If GUI handle was passed 85 | If IsHWnd($hWnd) Then 86 | ; Create label outside GUI borders 87 | $hLabel = GUICtrlCreateLabel("", -10, -10, 10, 10) 88 | $hLabel_Handle = GUICtrlGetHandle(-1) 89 | GUICtrlSetFont(-1, $iSize, $iWeight, $iAttrib, $sName) 90 | ; Create DC 91 | $aRet = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hLabel_Handle) 92 | If @error Or $aRet[0] = 0 Then 93 | GUICtrlDelete($hLabel) 94 | Return SetError(2, 1, 0) 95 | EndIf 96 | $hDC = $aRet[0] 97 | $aRet = DllCall("user32.dll", "lparam", "SendMessage", "hwnd", $hLabel_Handle, "int", 0x0031, "wparam", 0, "lparam", 0) ; $WM_GetFont 98 | If @error Or $aRet[0] = 0 Then 99 | GUICtrlDelete($hLabel) 100 | Return SetError(2, _StringSize_Error_Close(2, $hDC), 0) 101 | EndIf 102 | $hFont = $aRet[0] 103 | Else 104 | ; Get default DC 105 | $aRet = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hWnd) 106 | If @error Or $aRet[0] = 0 Then Return SetError(2, 1, 0) 107 | $hDC = $aRet[0] 108 | ; Create required font 109 | $aRet = DllCall("gdi32.dll", "int", "GetDeviceCaps", "handle", $hDC, "int", 90) ; $LOGPIXELSY 110 | If @error Or $aRet[0] = 0 Then Return SetError(2, _StringSize_Error_Close(3, $hDC), 0) 111 | Local $iInfo = $aRet[0] 112 | $aRet = DllCall("gdi32.dll", "handle", "CreateFontW", "int", -$iInfo * $iSize / 72, "int", 0, "int", 0, "int", 0, _ 113 | "int", $iWeight, "dword", BitAND($iAttrib, 2), "dword", BitAND($iAttrib, 4), "dword", BitAND($iAttrib, 8), "dword", 0, "dword", 0, _ 114 | "dword", 0, "dword", 5, "dword", 0, "wstr", $sName) 115 | If @error Or $aRet[0] = 0 Then Return SetError(2, _StringSize_Error_Close(4, $hDC), 0) 116 | $hFont = $aRet[0] 117 | EndIf 118 | 119 | ; Select font and store previous font 120 | $aRet = DllCall("gdi32.dll", "handle", "SelectObject", "handle", $hDC, "handle", $hFont) 121 | If @error Or $aRet[0] = 0 Then Return SetError(2, _StringSize_Error_Close(5, $hDC, $hFont, $hLabel), 0) 122 | Local $hPrevFont = $aRet[0] 123 | 124 | ; Declare variables 125 | Local $avSize_Info[4], $iLine_Length, $iLine_Height = 0, $iLine_Count = 0, $iLine_Width = 0, $iWrap_Count, $iLast_Word, $sTest_Line 126 | ; Declare and fill Size structure 127 | Local $tSize = DllStructCreate("int X;int Y") 128 | DllStructSetData($tSize, "X", 0) 129 | DllStructSetData($tSize, "Y", 0) 130 | 131 | ; Ensure EoL is @CRLF and break text into lines 132 | $sText = StringRegExpReplace($sText, "((? $iLine_Width Then $iLine_Width = DllStructGetData($tSize, "X") 146 | If DllStructGetData($tSize, "Y") > $iLine_Height Then $iLine_Height = DllStructGetData($tSize, "Y") 147 | Next 148 | 149 | ; Check if $iMaxWidth has been both set and exceeded 150 | If $iMaxWidth <> 0 And $iLine_Width > $iMaxWidth Then ; Wrapping required 151 | ; For each Line 152 | For $j = 1 To $asLines[0] 153 | ; Size line unwrapped 154 | $iLine_Length = StringLen($asLines[$j]) 155 | DllCall("gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $hDC, "wstr", $asLines[$j], "int", $iLine_Length, "ptr", DllStructGetPtr($tSize)) 156 | If @error Then Return SetError(2, _StringSize_Error_Close(6, $hDC, $hFont, $hLabel), 0) 157 | ; Check wrap status 158 | If DllStructGetData($tSize, "X") < $iMaxWidth - 4 Then 159 | ; No wrap needed so count line and store 160 | $iLine_Count += 1 161 | $avSize_Info[0] &= $asLines[$j] & @CRLF 162 | Else 163 | ; Wrap needed so zero counter for wrapped lines 164 | $iWrap_Count = 0 165 | ; Build line to max width 166 | While 1 167 | ; Zero line width 168 | $iLine_Width = 0 169 | ; Initialise pointer for end of word 170 | $iLast_Word = 0 171 | ; Add characters until EOL or maximum width reached 172 | For $i = 1 To StringLen($asLines[$j]) 173 | ; Is this just past a word ending? 174 | If StringMid($asLines[$j], $i, 1) = " " Then $iLast_Word = $i - 1 175 | ; Increase line by one character 176 | $sTest_Line = StringMid($asLines[$j], 1, $i) 177 | ; Get line length 178 | $iLine_Length = StringLen($sTest_Line) 179 | DllCall("gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $hDC, "wstr", $sTest_Line, "int", $iLine_Length, "ptr", DllStructGetPtr($tSize)) 180 | If @error Then Return SetError(2, _StringSize_Error_Close(6, $hDC, $hFont, $hLabel), 0) 181 | $iLine_Width = DllStructGetData($tSize, "X") 182 | ; If too long exit the loop 183 | If $iLine_Width >= $iMaxWidth - 4 Then ExitLoop 184 | Next 185 | ; End of the line of text? 186 | If $i > StringLen($asLines[$j]) Then 187 | ; Yes, so add final line to count 188 | $iWrap_Count += 1 189 | ; Store line 190 | $avSize_Info[0] &= $sTest_Line & @CRLF 191 | ExitLoop 192 | Else 193 | ; No, but add line just completed to count 194 | $iWrap_Count += 1 195 | ; Check at least 1 word completed or return error 196 | If $iLast_Word = 0 Then Return SetError(3, _StringSize_Error_Close(0, $hDC, $hFont, $hLabel), 0) 197 | ; Store line up to end of last word 198 | $avSize_Info[0] &= StringLeft($sTest_Line, $iLast_Word) & @CRLF 199 | ; Strip string to point reached 200 | $asLines[$j] = StringTrimLeft($asLines[$j], $iLast_Word) 201 | ; Trim leading whitespace 202 | $asLines[$j] = StringStripWS($asLines[$j], 1) 203 | ; Repeat with remaining characters in line 204 | EndIf 205 | WEnd 206 | ; Add the number of wrapped lines to the count 207 | $iLine_Count += $iWrap_Count 208 | EndIf 209 | Next 210 | ; Reset any tab expansions 211 | If $iExpTab Then 212 | $avSize_Info[0] = StringRegExpReplace($avSize_Info[0], "\x20?XXXXXXXX", @TAB) 213 | EndIf 214 | ; Complete return array 215 | $avSize_Info[1] = $iLine_Height 216 | $avSize_Info[2] = $iMaxWidth 217 | ; Convert lines to pixels and add drop margin 218 | $avSize_Info[3] = ($iLine_Count * $iLine_Height) + 4 219 | Else ; No wrapping required 220 | ; Create return array (add drop margin to height) 221 | Local $avSize_Info[4] = [$sText, $iLine_Height, $iLine_Width, ($asLines[0] * $iLine_Height) + 4] 222 | EndIf 223 | 224 | ; Clear up 225 | DllCall("gdi32.dll", "handle", "SelectObject", "handle", $hDC, "handle", $hPrevFont) 226 | DllCall("gdi32.dll", "bool", "DeleteObject", "handle", $hFont) 227 | DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "handle", $hDC) 228 | If $hLabel Then GUICtrlDelete($hLabel) 229 | 230 | Return $avSize_Info 231 | 232 | EndFunc ;==>_StringSize 233 | 234 | ; #INTERNAL_USE_ONLY#============================================================================================================ 235 | ; Name...........: _StringSize_Error_Close 236 | ; Description ...: Releases DC and deleted font object if required after error 237 | ; Syntax ........: _StringSize_Error_Close ($iExtCode, $hDC, $hGUI) 238 | ; Parameters ....: $iExtCode - code to return 239 | ; $hDC, $hGUI - handles as set in _StringSize function 240 | ; Return value ..: $iExtCode as passed 241 | ; Author ........: Melba23 242 | ; Modified.......: 243 | ; Remarks .......: This function is used internally by _StringSize 244 | ; =============================================================================================================================== 245 | Func _StringSize_Error_Close($iExtCode, $hDC = 0, $hFont = 0, $hLabel = 0) 246 | 247 | If $hFont <> 0 Then DllCall("gdi32.dll", "bool", "DeleteObject", "handle", $hFont) 248 | If $hDC <> 0 Then DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "handle", $hDC) 249 | If $hLabel Then GUICtrlDelete($hLabel) 250 | 251 | Return $iExtCode 252 | 253 | EndFunc ;=>_StringSize_Error_Close 254 | 255 | ; #INTERNAL_USE_ONLY#============================================================================================================ 256 | ; Name...........: _StringSize_DefaultFontName 257 | ; Description ...: Determines Windows default font 258 | ; Syntax ........: _StringSize_DefaultFontName() 259 | ; Parameters ....: None 260 | ; Return values .: Success - Returns name of system default font 261 | ; Failure - Returns "Tahoma" 262 | ; Author ........: Melba23, based on some original code by Larrydalooza 263 | ; Modified.......: 264 | ; Remarks .......: This function is used internally by _StringSize 265 | ; =============================================================================================================================== 266 | Func _StringSize_DefaultFontName() 267 | 268 | ; Get default system font data 269 | Local $tNONCLIENTMETRICS = DllStructCreate("uint;int;int;int;int;int;byte[60];int;int;byte[60];int;int;byte[60];byte[60];byte[60]") 270 | DLLStructSetData($tNONCLIENTMETRICS, 1, DllStructGetSize($tNONCLIENTMETRICS)) 271 | DLLCall("user32.dll", "int", "SystemParametersInfo", "int", 41, "int", DllStructGetSize($tNONCLIENTMETRICS), "ptr", DllStructGetPtr($tNONCLIENTMETRICS), "int", 0) 272 | Local $tLOGFONT = DllStructCreate("long;long;long;long;long;byte;byte;byte;byte;byte;byte;byte;byte;char[32]", DLLStructGetPtr($tNONCLIENTMETRICS, 13)) 273 | If IsString(DllStructGetData($tLOGFONT, 14)) Then 274 | Return DllStructGetData($tLOGFONT, 14) 275 | Else 276 | Return "Tahoma" 277 | EndIf 278 | 279 | EndFunc ;=>_StringSize_DefaultFontName 280 | -------------------------------------------------------------------------------- /GUI_Concepts/parent.au3: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | Local $aPlugins[1] = ["child.exe"] 5 | 6 | _LoadPlugins($aPlugins) 7 | 8 | Func _LoadPlugins($aPlugins) 9 | Local $aChildren[0] 10 | _ArrayDisplay($aPlugins) 11 | MsgBox(0, "Array Size", UBound($aChildren)) 12 | For $i = 0 To UBound($aPlugins) - 1 Step 1 13 | ReDim $aChildren[UBound($aChildren) + 1] 14 | MsgBox(0, "Array Size", UBound($aChildren)) 15 | MsgBox(0, "WorkingDir", @WorkingDir) 16 | $aChildren[$i] = Run(".\Plugins\" & $aPlugins[$i], @WorkingDir, "", $STDIN_CHILD+$STDOUT_CHILD) 17 | MsgBox(0, "Element " & $i, $aChildren[$i]) 18 | Next 19 | StdinWrite($aChildren[0], InputBox("StdinWrite", "Input", "test")) 20 | Exit 21 | EndFunc -------------------------------------------------------------------------------- /Includes/_Bitwise.au3: -------------------------------------------------------------------------------- 1 | #include-once 2 | 3 | #include 4 | #include 5 | 6 | Global $_iBits = 48 7 | 8 | ; #FUNCTION# ==================================================================================================================== 9 | ; Name ..........: _BitLimit 10 | ; Description ...: Sets BitLimts on other UDF functions 11 | ; Syntax ........: _BitLimit($iBits) 12 | ; Parameters ....: $iBits - Max Bit Length for _BitAND, _BitNOT, _BitOR, and _BitXOR 13 | ; Return values .: None 14 | ; Author ........: rcmaehl (Robert Maehl) 15 | ; Modified ......: 12/07/2020 16 | ; Remarks .......: AutoIt uses the SIGNED 64 bit integer limit 17 | ; Related .......: 18 | ; Link ..........: 19 | ; Example .......: No 20 | ; =============================================================================================================================== 21 | Func _BitLimit($iBits) 22 | 23 | Select 24 | 25 | Case Not IsInt($iBits) 26 | 27 | Case $iBits < 1 28 | 29 | ; Bits over 48 have tricky math that needs to be done to avoid Loose Typing shenanigans 30 | Case $iBits > 48 31 | 32 | Case $iBits > 64 33 | 34 | Case Else 35 | $_iBits = $iBits 36 | 37 | EndSelect 38 | 39 | EndFunc 40 | 41 | 42 | ; #FUNCTION# ==================================================================================================================== 43 | ; Name ..........: _BitAND 44 | ; Description ...: Variable Bit Implementation of BitAND() 45 | ; Syntax ........: _BitAND($iNum1, $iNum2) 46 | ; Parameters ....: $iNum1 - an integer value. 47 | ; $iNum2 - an integer value. 48 | ; Return values .: BitAND of $iNum1 and $iNum2 49 | ; Author ........: rcmaehl (Robert Maehl) 50 | ; Modified ......: 12/07/2020 51 | ; Remarks .......: AutoIt uses the SIGNED 64 bit integer limit 52 | ; Related .......: 53 | ; Link ..........: 54 | ; Example .......: No 55 | ; =============================================================================================================================== 56 | Func _BitAND($iNum1, $iNum2) 57 | 58 | ; Create Arrays of bits 59 | Local $aNum1[$_iBits] 60 | Local $aNum2[$_iBits] 61 | Local $iTemp = -1 62 | Local $iIndex = 0 63 | 64 | ; Fill Arrays with 0s 65 | For $iLoop = 0 To $_iBits - 1 Step 1 66 | $aNum1[$iLoop] = 0 67 | $aNum2[$iLoop] = 0 68 | Next 69 | 70 | $iTemp = $iNum1 71 | $iIndex = 0 72 | Do 73 | $aNum1[$iIndex] = Mod($iTemp, 2) 74 | $iTemp = Floor($iTemp / 2) 75 | $iIndex += 1 76 | Until $iTemp = 1 77 | 78 | $iTemp = $iNum2 79 | $iIndex = 0 80 | Do 81 | $aNum2[$iIndex] = Mod($iTemp, 2) 82 | $iTemp = Floor($iTemp / 2) 83 | $iIndex += 1 84 | Until $iTemp = 0 85 | 86 | $iTemp = 0 87 | For $iLoop = 0 To $_iBits - 1 Step 1 88 | If $aNum1[$iLoop] And $aNum2[$iLoop] Then $iTemp += 2^$iLoop 89 | Next 90 | 91 | Return $iTemp 92 | 93 | EndFunc 94 | 95 | ; #FUNCTION# ==================================================================================================================== 96 | ; Name ..........: _BitNOT 97 | ; Description ...: Variable Bit Implementation of BitNOT() 98 | ; Syntax ........: _BitNOT($iNum1) 99 | ; Parameters ....: $iNum1 - an integer value. 100 | ; Return values .: BitNOT of $iNum1 101 | ; Author ........: rcmaehl (Robert Maehl) 102 | ; Modified ......: 12/07/2020 103 | ; Remarks .......: AutoIt uses the SIGNED 64 bit integer limit 104 | ; Related .......: 105 | ; Link ..........: 106 | ; Example .......: No 107 | ; =============================================================================================================================== 108 | Func _BitNOT($iNum1) 109 | 110 | ; Create Array of bits 111 | Local $aNum1[$_iBits] 112 | Local $iTemp = -1 113 | Local $iIndex = 0 114 | 115 | ; Fill Array with 0s 116 | For $iLoop = 0 To $_iBits - 1 Step 1 117 | $aNum1[$iLoop] = 0 118 | Next 119 | 120 | 121 | $iTemp = $iNum1 122 | $iIndex = 0 123 | Do 124 | $aNum1[$iIndex] = Mod($iTemp, 2) 125 | $iTemp = Floor($iTemp / 2) 126 | $iIndex += 1 127 | Until $iTemp = 0 128 | 129 | $iTemp = 0 130 | For $iLoop = 0 To $_iBits - 1 Step 1 131 | If Not $aNum1[$iLoop] Then $iTemp += 2^$iLoop 132 | Next 133 | 134 | Return $iTemp 135 | 136 | EndFunc 137 | 138 | ; #FUNCTION# ==================================================================================================================== 139 | ; Name ..........: _BitOR 140 | ; Description ...: Variable Bit Implementation of BitOR() 141 | ; Syntax ........: _BitOR($iNum1, $iNum2) 142 | ; Parameters ....: $iNum1 - an integer value. 143 | ; $iNum2 - an integer value. 144 | ; Return values .: BitOR of $iNum1 and $iNum2 145 | ; Author ........: rcmaehl (Robert Maehl) 146 | ; Modified ......: 12/07/2020 147 | ; Remarks .......: AutoIt uses the SIGNED 64 bit integer limit 148 | ; Related .......: 149 | ; Link ..........: 150 | ; Example .......: No 151 | ; =============================================================================================================================== 152 | Func _BitOR($iNum1, $iNum2) 153 | 154 | ; Create Arrays of bits 155 | Local $aNum1[$_iBits] 156 | Local $aNum2[$_iBits] 157 | Local $iTemp = -1 158 | Local $iIndex = 0 159 | 160 | ; Fill Arrays with 0s 161 | For $iLoop = 0 To $_iBits - 1 Step 1 162 | $aNum1[$iLoop] = 0 163 | $aNum2[$iLoop] = 0 164 | Next 165 | 166 | $iTemp = $iNum1 167 | $iIndex = 0 168 | Do 169 | $aNum1[$iIndex] = Mod($iTemp, 2) 170 | $iTemp = Floor($iTemp / 2) 171 | $iIndex += 1 172 | Until $iTemp = 0 173 | 174 | $iTemp = $iNum2 175 | $iIndex = 0 176 | Do 177 | $aNum2[$iIndex] = Mod($iTemp, 2) 178 | $iTemp = Floor($iTemp / 2) 179 | $iIndex += 1 180 | Until $iTemp = 0 181 | 182 | $iTemp = 0 183 | For $iLoop = 0 To $_iBits - 1 Step 1 184 | If $aNum1[$iLoop] Or $aNum2[$iLoop] Then $iTemp += 2^$iLoop 185 | Next 186 | 187 | Return $iTemp 188 | 189 | EndFunc 190 | 191 | ; #FUNCTION# ==================================================================================================================== 192 | ; Name ..........: _BitXOR 193 | ; Description ...: Variable Bit Implementation of BitXOR() 194 | ; Syntax ........: _BitXOR($iNum1, $iNum2) 195 | ; Parameters ....: $iNum1 - an integer value. 196 | ; $iNum2 - an integer value. 197 | ; Return values .: BitXOR of $iNum1 and $iNum2 198 | ; Author ........: rcmaehl (Robert Maehl) 199 | ; Modified ......: 12/07/2020 200 | ; Remarks .......: AutoIt uses the SIGNED 64 bit integer limit 201 | ; Related .......: 202 | ; Link ..........: 203 | ; Example .......: No 204 | ; =============================================================================================================================== 205 | Func _BitXOR($iNum1, $iNum2) 206 | 207 | ; Create Arrays of bits 208 | Local $aNum1[$_iBits] 209 | Local $aNum2[$_iBits] 210 | Local $iTemp = -1 211 | Local $iIndex = 0 212 | 213 | ; Fill Arrays with 0s 214 | For $iLoop = 0 To $_iBits - 1 Step 1 215 | $aNum1[$iLoop] = 0 216 | $aNum2[$iLoop] = 0 217 | Next 218 | 219 | $iTemp = $iNum1 220 | $iIndex = 0 221 | Do 222 | $aNum1[$iIndex] = Mod($iTemp, 2) 223 | $iTemp = Floor($iTemp / 2) 224 | $iIndex += 1 225 | Until $iTemp = 0 226 | 227 | $iTemp = $iNum2 228 | $iIndex = 0 229 | Do 230 | $aNum2[$iIndex] = Mod($iTemp, 2) 231 | $iTemp = Floor($iTemp / 2) 232 | $iIndex += 1 233 | Until $iTemp = 0 234 | 235 | $iTemp = 0 236 | For $iLoop = 0 To $_iBits - 1 Step 1 237 | If Not $aNum1[$iLoop] = $aNum2[$iLoop] Then $iTemp += 2^$iLoop 238 | Next 239 | 240 | Return $iTemp 241 | 242 | EndFunc -------------------------------------------------------------------------------- /Includes/_Bitwise64.au3: -------------------------------------------------------------------------------- 1 | Func _BitAND64($iValue1, $iValue2) 2 | If VarGetType($iValue1) <> "Int64" And VarGetType($iValue2) <> "Int64" Then Return BitAND($iValue1, $iValue2) 3 | $iValue1 = __DecToBin64($iValue1) 4 | $iValue2 = __DecToBin64($iValue2) 5 | Local $aValueANDed[64] 6 | For $i = 0 To 63 7 | $aValueANDed[$i] = ($iValue1[$i] And $iValue2[$i]) ? 1 : 0 8 | Next 9 | Return __BinToDec64($aValueANDed) 10 | EndFunc ;==>_BitAND64 11 | 12 | Func _BitOR64($iValue1, $iValue2) 13 | If VarGetType($iValue1) <> "Int64" And VarGetType($iValue2) <> "Int64" Then Return BitOR($iValue1, $iValue2) 14 | $iValue1 = __DecToBin64($iValue1) 15 | $iValue2 = __DecToBin64($iValue2) 16 | Local $aValueORed[64] 17 | For $i = 0 To 63 18 | $aValueORed[$i] = ($iValue1[$i] Or $iValue2[$i]) ? 1 : 0 19 | Next 20 | Return __BinToDec64($aValueORed) 21 | EndFunc ;==>_BitOR64 22 | 23 | Func _BitXOR64($iValue1, $iValue2) 24 | If VarGetType($iValue1) <> "Int64" And VarGetType($iValue2) <> "Int64" Then Return BitXOR($iValue1, $iValue2) 25 | $iValue1 = __DecToBin64($iValue1) 26 | $iValue2 = __DecToBin64($iValue2) 27 | Local $aValueXORed[64] 28 | For $i = 0 To 63 29 | $aValueXORed[$i] = (($iValue1[$i] And (Not $iValue2[$i])) Or ((Not $iValue1[$i]) And $iValue2[$i])) ? 1 : 0 30 | Next 31 | Return __BinToDec64($aValueXORed) 32 | EndFunc ;==>_BitXOR64 33 | 34 | Func _BitNOT64($iValue) 35 | If Not VarGetType($iValue) = "Int64" Then Return BitNOT($iValue) 36 | $iValue = __DecToBin64($iValue) 37 | For $i = 0 To 63 38 | $iValue[$i] = Not $iValue[$i] 39 | Next 40 | Return __BinToDec64($iValue) 41 | EndFunc ;==>_BitNOT64 42 | 43 | Func _BitRotate64($iValue, $iShift) 44 | If VarGetType($iValue) <> "Int64" Then Return BitRotate($iValue, $iShift, "D") 45 | $iValue = __DecToBin64($iValue) 46 | Local $iTmp 47 | If $iShift < 0 Then ; rotate right 48 | For $i = 1 To Abs($iShift) 49 | $iTmp = $iValue[0] 50 | For $j = 1 To 63 51 | $iValue[$j - 1] = $iValue[$j] 52 | Next 53 | $iValue[63] = $iTmp 54 | Next 55 | Else 56 | For $i = 1 To $iShift 57 | $iTmp = $iValue[63] 58 | For $j = 63 To 1 Step -1 59 | $iValue[$j] = $iValue[$j - 1] 60 | Next 61 | $iValue[0] = $iTmp 62 | Next 63 | EndIf 64 | Return __BinToDec64($iValue) 65 | EndFunc ;==>_BitRotate64 66 | 67 | Func _BitShift64($iValue, $iShift, $bSigned = True) 68 | If $iShift <= 0 Then $bSigned = True 69 | If VarGetType($iValue) <> "Int64" Then 70 | If $bSigned Then Return BitShift($iValue, $iShift) 71 | If $iShift > 0 Then 72 | $iValue = BitAND(BitShift($iValue, 1), 0x7FFFFFFF) 73 | Return BitShift($iValue, $iShift-1) 74 | EndIf 75 | EndIf 76 | $iValue = __DecToBin64($iValue) 77 | Local $iTmp 78 | If $iShift > 0 Then ; shift right 79 | $iTmp = $bSigned ? $iValue[63] : 0 80 | For $i = 1 To Abs($iShift) 81 | For $j = 1 To 63 82 | $iValue[$j - 1] = $iValue[$j] 83 | Next 84 | $iValue[63] = $iTmp 85 | Next 86 | Else 87 | For $i = 1 To Abs($iShift) 88 | For $j = 63 To 1 Step -1 89 | $iValue[$j] = $iValue[$j - 1] 90 | Next 91 | $iValue[0] = 0 92 | Next 93 | EndIf 94 | Return __BinToDec64($iValue) 95 | EndFunc ;==>_BitShift64 96 | 97 | Func __DecToBin64($iDec) 98 | Local $tI64 = DllStructCreate("int64 num"), $aBin[64], $iVal 99 | Local $tI32 = DllStructCreate("align 4;uint low;uint high", DllStructGetPtr($tI64)) 100 | $tI64.num = $iDec 101 | For $i = 0 To 31 102 | $iVal = 2 ^ $i 103 | $aBin[$i] = BitAND($tI32.low, $iVal) ? 1 : 0 104 | $aBin[$i + 32] = BitAND($tI32.high, $iVal) ? 1 : 0 105 | Next 106 | Return $aBin 107 | EndFunc ;==>__DecToBin64 108 | 109 | Func __BinToDec64($aBin) 110 | Local $tI32 = DllStructCreate("align 4;uint low;uint high"), $iVal 111 | Local $tI64 = DllStructCreate("UINT64 num", DllStructGetPtr($tI32)) 112 | For $i = 0 To 31 113 | $iVal = 2 ^ $i 114 | $tI32.low += $aBin[$i] ? $iVal : 0 115 | $tI32.high += $aBin[$i + 32] ? $iVal : 0 116 | Next 117 | Return $tI64.num 118 | EndFunc ;==>__BinToDec64 -------------------------------------------------------------------------------- /Includes/_Core.au3: -------------------------------------------------------------------------------- 1 | #Region ;**** Directives created by AutoIt3Wrapper_GUI **** 2 | #AutoIt3Wrapper_Icon=..\icon.ico 3 | #AutoIt3Wrapper_Change2CUI=y 4 | #AutoIt3Wrapper_Res_Comment=NotCPUCores Core Beta 5 | #AutoIt3Wrapper_Res_Description=NotCPUCores Core Beta 6 | #AutoIt3Wrapper_Res_Fileversion=2.0.0.0 7 | #AutoIt3Wrapper_Res_LegalCopyright=Robert C Maehl (rcmaehl) 8 | #AutoIt3Wrapper_Res_Language=1033 9 | #AutoIt3Wrapper_Res_requestedExecutionLevel=highestAvailable 10 | #AutoIt3Wrapper_Run_Au3Stripper=y 11 | #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** 12 | #include-once 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include ".\_WMIC.au3" 21 | #include ".\_GetLanguage.au3" 22 | #include ".\_ExtendedFunctions.au3" 23 | 24 | If Not IsDeclared("bAdmin") Then Global Static $bAdmin = IsAdmin() 25 | 26 | Global $WinAPIError[7] = ["Success", _ 27 | "Invalid Modification", _ 28 | "No Longer Exists (File)", _ 29 | "No Longer Exists (Path)", _ 30 | "Too Many Handles Open", _ 31 | "Access Denied (Modify)", _ 32 | "Access Denied (Access)"] 33 | 34 | ; On the RARE occasion some other Error Code is thrown, don't crash 35 | ReDim $WinAPIError[16000] 36 | 37 | Func _Main() 38 | 39 | Local $aExclusions, $aInclusions, $aStatus 40 | Local $sStatus, $bOptimize = False 41 | 42 | Local $hConsole ; Replace with STDOUT Stream 43 | Local $iProcesses = 0 44 | 45 | ; Required to pass compile 46 | Local $iProcessCores, $iBroadcasterCores, $iOtherProcessCores 47 | Local $sPriority, $sBPriority 48 | Local $iSleep 49 | 50 | While True 51 | 52 | $aProcesses = ProcessList() 53 | 54 | If $bOptimize Then 55 | Select 56 | Case UBound(ProcessList()) <> $iProcesses 57 | #cs / Refactor Active Process Handling 58 | If $aActive[0] Then 59 | $aProcesses[0] = GUICtrlRead($hTask) 60 | $aProcesses[0] = StringSplit($aProcesses[0], "|", $STR_NOCOUNT) 61 | $aUnload = $aProcesses[0] ; Unload $aProcesses[0] 62 | For $iLoop = 0 To UBound($aUnload) - 1 Step 1 63 | Switch $aUnload[$iLoop] 64 | Case "ACTIVE" 65 | $aUnload[$iLoop] = _ProcessGetName(WinGetProcess("[ACTIVE]")) 66 | $aActive[1] = $aUnload[$iLoop] 67 | EndSwitch 68 | Next 69 | $aProcesses[0] = $aUnload ; Reload $aProcesses[0] 70 | EndIf 71 | #ce 72 | $iProcesses = _Optimize($iProcesses,$aProcesses[0],$iProcessCores,$iSleep,$sPriority,$hConsole) ; Convert to 2D Array 73 | Switch $iProcesses 74 | Case 1 75 | Switch @error 76 | Case 0 77 | Switch @extended 78 | Case 1 79 | _ConsoleWrite(_ArrayToString($aProcesses[0], " & ") & " " & $_sLang_RestoringState & @CRLF, $hConsole) 80 | EndSwitch 81 | Case 1 82 | Switch @extended 83 | Case 1 84 | _ConsoleWrite("!> " & _ArrayToString($aProcesses[0], " & ") & " " & $_sLang_NotRunning & @CRLF, $hConsole) 85 | Case 2 86 | _ConsoleWrite("!> " & $_sLang_InvalidProcessCores & @CRLF, $hConsole) 87 | Case 3 88 | _ConsoleWrite("!> " & $_sLang_TooManyCores & @CRLF, $hConsole) 89 | Case 4 90 | _ConsoleWrite("!> " & $sPriority & " - " & $_sLang_InvalidPriority & @CRLF, $hConsole) 91 | EndSwitch 92 | EndSwitch 93 | Case Else 94 | Switch @extended 95 | Case 0 96 | _ConsoleWrite(_ArrayToString($aProcesses[0], " & ") & " " & $_sLang_Optimizing & @CRLF, $hConsole) 97 | Case 1 98 | _ConsoleWrite($_sLang_ReOptimizing & @CRLF, $hConsole) 99 | Case 2 100 | _ConsoleWrite("!> " & $_sLang_MaxPerformance & @CRLF, $hConsole) 101 | _ConsoleWrite(_ArrayToString($aProcesses[0], " & ") & " " & $_sLang_Optimizing & @CRLF, $hConsole) 102 | EndSwitch 103 | EndSwitch 104 | Switch _OptimizeOthers($aProcesses, $iOtherProcessCores, $iSleep, $hConsole) ; Convert to 2D Array 105 | Case 1 106 | $iProcesses = 1 107 | Switch @error 108 | Case 1 109 | _ConsoleWrite("!> " & $_sLang_InvalidProcessCores & @CRLF, $hConsole) 110 | Case 2 111 | _ConsoleWrite("!> " & $_sLang_TooManyCores & @CRLF, $hConsole) 112 | EndSwitch 113 | EndSwitch 114 | Switch _OptimizeBroadcaster($aProcesses, $iBroadcasterCores, $iSleep, $sBPriority, $hConsole) ; Convert to 2D Array 115 | Case 0 116 | Switch @extended 117 | Case 1 118 | _ConsoleWrite("!> " & $_sLang_MaxCores & @CRLF, $hConsole) 119 | EndSwitch 120 | Case 1 121 | $iProcesses = 1 122 | Switch @error 123 | Case 1 124 | _ConsoleWrite("!> " & $_sLang_TooManyTotalCores & @CRLF, $hConsole) 125 | EndSwitch 126 | EndSwitch 127 | EndSelect 128 | EndIf 129 | 130 | $sStatus = ConsoleRead() 131 | If @extended = 0 Then ContinueLoop 132 | 133 | $aStatus = StringSplit($sStatus, ",") 134 | 135 | Switch $aStatus[0] 136 | 137 | Case "List" 138 | Switch $aStatus[1] 139 | Case "Processes" ; List,Processes - List Processes 140 | 141 | Case "Services" ; List,Services - List Services (Windows), Daemons (Unix/Linux) 142 | 143 | EndSwitch 144 | 145 | Case "Include" 146 | Switch $aStatus[1] 147 | Case "Process" ; Include,Process Name,Affinity Bitmask,Priority - Assigns a Process to Specific Threads a a Specific Priority 148 | 149 | Case "Service" ; Include,Service Name,Pause/Stop - Includes a Service to be Paused/Stopped 150 | 151 | EndSwitch 152 | 153 | Case "Exclude" 154 | Switch $aStatus[1] 155 | Case "Process" ; Exclude,Process Name - Excludes a Process from having it's affinity changed 156 | 157 | Case "Service" ; Exclude,Service Name - Excludes a Service/Daemon from Pausing/Stopping 158 | 159 | EndSwitch 160 | 161 | Case "Remove" 162 | Switch $aStatus[1] 163 | Case "Process" ; Remove,Process Name - Removes Process from Include and Exclude List 164 | 165 | Case "Service" ; Remove,Service Name - Removes Service/Daemon from Include and Exclude List 166 | 167 | EndSwitch 168 | 169 | Case "Start" 170 | $bOptimize = True 171 | 172 | Case "Stop" 173 | $bOptimize = False 174 | 175 | Case Else 176 | ConsoleWrite("NCC Core Caught unhandled parameter: " & $aStatus[0] & @CRLF) 177 | 178 | EndSwitch 179 | 180 | WEnd 181 | EndFunc 182 | 183 | Func _ArrayRemove(ByRef $aArray, $sRemString) 184 | $sTemp = "," & _ArrayToString($aArray, ",") & "," 185 | $sTemp = StringReplace($sTemp, "," & $sRemString & ",", ",") 186 | $sTemp = StringReplace($sTemp, ",,", ",") 187 | If StringLeft($sTemp, 1) = "," Then $sTemp = StringTrimLeft($sTemp, 1) 188 | If StringRight($sTemp, 1) = "," Then $sTemp = StringTrimRight($sTemp, 1) 189 | If $sTemp = "" Or $sTemp = "," Then 190 | $aArray = StringSplit($sTemp, ",", $STR_NOCOUNT) 191 | _ArrayDelete($aArray, 0) 192 | Else 193 | $aArray = StringSplit($sTemp, ",", $STR_NOCOUNT) 194 | EndIf 195 | EndFunc 196 | 197 | Func _DeepFreeze($aProcesses) 198 | EndFunc 199 | 200 | ; #FUNCTION# ==================================================================================================================== 201 | ; Name ..........: _GetModifiedProcesses 202 | ; Description ...: Get a list of Processes with Modified Affinity or Priority 203 | ; Syntax ........: _GetModifiedProcesses() 204 | ; Parameters ....: None 205 | ; Return values .: Returns an array containing modified processes 206 | ; Author ........: rcmaehl (Robert Maehl) 207 | ; Modified ......: 02/02/2021 208 | ; Remarks .......: 209 | ; Related .......: 210 | ; Link ..........: 211 | ; Example .......: No 212 | ; =============================================================================================================================== 213 | Func _GetModifiedProcesses() 214 | 215 | Local $aAffinity 216 | Local $aProcesses 217 | Local $aModified[0] 218 | 219 | $aProcesses = ProcessList() 220 | For $Loop = 5 To $aProcesses[0][0] ; Skip System 221 | $hCurProcess = _WinAPI_OpenProcess($PROCESS_QUERY_LIMITED_INFORMATION, False, $aProcesses[$Loop][1], $bAdmin) 222 | $aAffinity = _WinAPI_GetProcessAffinityMask($hCurProcess) 223 | If @error Then ContinueLoop 224 | Select 225 | Case $aAffinity[1] = $aAffinity[2] 226 | ;;; 227 | Case _ProcessGetPriority($aProcesses[$Loop][1]) <> 2 228 | ContinueCase 229 | Case Else 230 | ReDim $aModified[UBound($aModified) + 1] 231 | $aModified[UBound($aModified)-1] = $aProcesses[$Loop][0] 232 | EndSelect 233 | _WinAPI_CloseHandle($hCurProcess) 234 | Next 235 | 236 | Return $aModified 237 | 238 | EndFunc 239 | 240 | ; #FUNCTION# ==================================================================================================================== 241 | ; Name ..........: _Optimize 242 | ; Description ...: Adjust Priority and Affinity of a Process 243 | ; Syntax ........: _Optimize($iProcesses, $hProcess, $hCores[, $iSleepTime = 100[, $bRealtime = False[, $hOutput = False]]]) 244 | ; Parameters ....: $iProcesses - Current running process count 245 | ; $aProcesses - Array of processes to Optimize 246 | ; $hCores - Cores to set affinity to 247 | ; $iSleepTime - [optional] Internal Sleep Timer. Default is 100. 248 | ; $sPriority - [optional] Priority to Use. Default is High. 249 | ; $hOutput - [optional] Handle of the GUI Console. Default is False, for none. 250 | ; Return values .: > 1 - Success, Last Polled Process Count 251 | ; 1 - Optimization Exiting, Do not Continue 252 | ; Author ........: rcmaehl (Robert Maehl) 253 | ; Modified ......: 02/02/2021 254 | ; Remarks .......: 255 | ; Related .......: 256 | ; Link ..........: 257 | ; Example .......: No 258 | ; =============================================================================================================================== 259 | Func _Optimize($iProcesses, $aProcesses, $hCores, $iSleepTime = 100, $sPriority = $PROCESS_HIGH, $hOutput = False) 260 | 261 | Local $iExtended = 0 262 | Local $aRunning[1] 263 | Local $iExists = 0 264 | Local $aUnload 265 | 266 | If IsDeclared("iThreads") = 0 Then Local Static $iThreads = _GetCPUInfo(1) 267 | Local $aPriorities[6] = [$PROCESS_LOW, $PROCESS_BELOWNORMAL, $PROCESS_NORMAL, $PROCESS_ABOVENORMAL, $PROCESS_HIGH, $PROCESS_REALTIME] 268 | 269 | Local $hAllCores = 0 ; Get Maxmimum Cores Magic Number 270 | For $iLoop = 0 To $iThreads - 1 271 | $hAllCores += 2^$iLoop 272 | Next 273 | 274 | If $iProcesses > 0 Then 275 | For $iLoop = 0 To UBound($aProcesses) - 1 Step 1 ; Don't do anything unless the process(es) exist 276 | If ProcessExists($aProcesses[$iLoop]) Then $iExists += 1 277 | Next 278 | If $iExists = 0 Then Return SetError(0, 1, 1) 279 | $iExtended = 1 280 | $aRunning = ProcessList() ; Meat and Potatoes, Change Affinity and Priority 281 | If Not (UBound(ProcessList()) = $iProcesses) Then ; Skip Optimization if there are no new processes 282 | For $iLoop = 5 to $aRunning[0][0] Step 1 283 | If _ArraySearch($aProcesses, $aRunning[$iLoop][0]) = -1 Then 284 | ;;; 285 | Else 286 | ; _ConsoleWrite("Optimizing " & $aRunning[$iLoop][0] & ", PID: " & $aRunning[$iLoop][1] & @CRLF, $hOutput) 287 | ProcessSetPriority($aRunning[$iLoop][0], $sPriority) 288 | $hCurProcess = _WinAPI_OpenProcess($PROCESS_QUERY_LIMITED_INFORMATION+$PROCESS_SET_INFORMATION, False, $aRunning[$iLoop][1], $bAdmin) ; Select the Process 289 | If Not _WinAPI_SetProcessAffinityMask($hCurProcess, $hCores) Then ; Set Affinity (which cores it's assigned to) 290 | _ConsoleWrite("Failed to adjust affinity of " & $aRunning[$iLoop][0] & " - " & $WinAPIError[_WinAPI_GetLastError()] & @CRLF, $hOutput) 291 | EndIf 292 | _WinAPI_CloseHandle($hCurProcess) ; I don't need to do anything else so tell the computer I'm done messing with it 293 | EndIf 294 | Next 295 | EndIf 296 | Else 297 | For $iLoop = 0 To UBound($aProcesses) - 1 Step 1 ; Don't do anything unless the process(es) exist 298 | If ProcessExists($aProcesses[$iLoop]) Then $iExists += 1 299 | Next 300 | If $iExists = 0 Then Return SetError(1, 1, 1) 301 | Select 302 | Case Not IsInt($hCores) 303 | Return SetError(1,2,1) 304 | Case $hCores > $hAllCores 305 | Return SetError(1,3,1) 306 | Case _ArraySearch($aPriorities, $sPriority) = -1 307 | Return SetError(1,4,1) 308 | Case $hCores = $hAllCores 309 | $iExtended = 2 310 | ContinueCase 311 | Case Else 312 | $aRunning = ProcessList() ; Meat and Potatoes, Change Affinity and Priority 313 | For $iLoop = 5 to $aRunning[0][0] Step 1 314 | If _ArraySearch($aProcesses, $aRunning[$iLoop][0]) = -1 Then 315 | ;;; 316 | Else 317 | ; _ConsoleWrite("Optimizing " & $aRunning[$iLoop][0] & ", PID: " & $aRunning[$iLoop][1] & @CRLF, $hOutput) 318 | ProcessSetPriority($aRunning[$iLoop][0], $sPriority) 319 | $hCurProcess = _WinAPI_OpenProcess($PROCESS_QUERY_LIMITED_INFORMATION+$PROCESS_SET_INFORMATION, False, $aRunning[$iLoop][1], $bAdmin) ; Select the Process 320 | If Not _WinAPI_SetProcessAffinityMask($hCurProcess, $hCores) Then ; Set Affinity (which cores it's assigned to) 321 | _ConsoleWrite("Failed to adjust affinity of " & $aRunning[$iLoop][0] & " - " & $WinAPIError[_WinAPI_GetLastError()] & @CRLF, $hOutput) 322 | EndIf 323 | _WinAPI_CloseHandle($hCurProcess) ; I don't need to do anything else so tell the computer I'm done messing with it 324 | EndIf 325 | Next 326 | EndSelect 327 | EndIf 328 | Return SetError(0, $iExtended, UBound($aRunning)) 329 | 330 | EndFunc 331 | 332 | ; #FUNCTION# ==================================================================================================================== 333 | ; Name ..........: _OptimizeBroadcaster 334 | ; Description ...: Optimize all Processes associated with the Broadcasting software 335 | ; Syntax ........: _OptimizeBroadcaster($aProcesses, $hCores[, $iSleepTime = 100[, $hRealtime = False[, $hOutput = False]]]) 336 | ; Parameters ....: $aProcesses - Array of Processes to Optimize 337 | ; $hCores - Cores to set affinity to 338 | ; $iSleepTime - [optional] Internal Sleep Timer. Default is 100. 339 | ; $sPriority - [optional] Priority to Use. Default is High. 340 | ; $hOutput - [optional] Handle of the GUI Console. Default is False, for none. 341 | ; Return values .: 0 - Success 342 | ; 1 - An error has occured 343 | ; Author ........: rcmaehl (Robert Maehl) 344 | ; Modified ......: 02/02/2021 345 | ; Remarks .......: 346 | ; Related .......: 347 | ; Link ..........: 348 | ; Example .......: No 349 | ; =============================================================================================================================== 350 | Func _OptimizeBroadcaster($aProcessList, $hCores, $iSleepTime = 100, $sPriority = $PROCESS_HIGH, $hOutput = False) 351 | 352 | If IsDeclared("iThreads") = 0 Then Local Static $iThreads = _GetCPUInfo(1) 353 | Local $aPriorities[6] = [$PROCESS_LOW, $PROCESS_BELOWNORMAL, $PROCESS_NORMAL, $PROCESS_ABOVENORMAL, $PROCESS_HIGH, $PROCESS_REALTIME] 354 | 355 | _ArrayDelete($aProcessList, 0) 356 | _ArrayDelete($aProcessList, UBound($aProcessList)-1) 357 | 358 | Select 359 | Case Not IsInt($hCores) 360 | Return SetError(1,0,1) 361 | Case Else 362 | Local $hAllCores = 0 ; Get Maxmimum Cores Magic Number 363 | For $iLoop = 0 To $iThreads - 1 364 | $hAllCores += 2^$iLoop 365 | Next 366 | If $hCores > $hAllCores Then 367 | Return SetError(2,0,1) 368 | EndIf 369 | $iProcessesLast = 0 370 | $aProcesses = ProcessList() ; Meat and Potatoes, Change Affinity and Priority 371 | For $iLoop = 5 to $aProcesses[0][0] Step 1 372 | If _ArraySearch($aProcessList, $aProcesses[$iLoop][0]) = -1 Then 373 | ;;; 374 | Else 375 | ProcessSetPriority($aProcesses[$iLoop][0], $sPriority) 376 | $hCurProcess = _WinAPI_OpenProcess($PROCESS_SET_INFORMATION, False, $aProcesses[$iLoop][1], $bAdmin) ; Select the Process 377 | If Not _WinAPI_SetProcessAffinityMask($hCurProcess, $hCores) Then ; Set Affinity (which cores it's assigned to) 378 | _ConsoleWrite("Failed to adjust affinity of " & $aProcesses[$iLoop][0] & " - " & $WinAPIError[_WinAPI_GetLastError()] & @CRLF, $hOutput) 379 | EndIf 380 | _WinAPI_CloseHandle($hCurProcess) ; I don't need to do anything else so tell the computer I'm done messing with it 381 | EndIf 382 | Next 383 | EndSelect 384 | Return 0 385 | 386 | EndFunc 387 | 388 | ; #FUNCTION# ==================================================================================================================== 389 | ; Name ..........: _OptimizeOthers 390 | ; Description ...: Optimize all processes other than the ones Excluded 391 | ; Syntax ........: _OptimizeOthers(Byref $aExclusions, $hCores[, $iSleepTime = 100[, $hOutput = False]]) 392 | ; Parameters ....: $aExclusions - [in/out] Array of Processes to Exclude 393 | ; $hCores - Cores to exclusions were set to 394 | ; $iSleepTime - [optional] Internal Sleep Timer. Default is 100. 395 | ; $hOutput - [optional] Handle of the GUI Console. Default is False, for none. 396 | ; Return values .: 1 - An error has occured 397 | ; Author ........: rcmaehl (Robert Maehl) 398 | ; Modified ......: 02/02/2021 399 | ; Remarks .......: 400 | ; Related .......: 401 | ; Link ..........: 402 | ; Example .......: No 403 | ; =============================================================================================================================== 404 | Func _OptimizeOthers($aExclusions, $hCores, $iSleepTime = 100, $hOutput = False) 405 | 406 | Local $iExtended = 0 407 | Local $aTemp 408 | 409 | If IsDeclared("iThreads") = 0 Then Local Static $iThreads = _GetCPUInfo(1) 410 | Local $hAllCores = 0 ; Get Maxmimum Cores Magic Number 411 | 412 | For $iLoop = 0 To $iThreads - 1 413 | $hAllCores += 2^$iLoop 414 | Next 415 | 416 | $aTemp = $aExclusions[UBound($aExclusions) - 1] 417 | _ArrayDelete($aExclusions, UBound($aExclusions) - 1) 418 | _ArrayConcatenate($aExclusions, $aTemp) 419 | 420 | $aTemp = $aExclusions[0] 421 | _ArrayDelete($aExclusions, 0) 422 | _ArrayConcatenate($aExclusions, $aTemp) 423 | 424 | Select 425 | Case $hCores > $hAllCores 426 | Return SetError(1,0,1) 427 | Case $hCores <= 0 428 | $hCores = 2^($iThreads - 1) 429 | $iExtended = 1 430 | ContinueCase 431 | Case Else 432 | $aProcesses = ProcessList() ; Meat and Potatoes, Change Affinity and Priority 433 | For $iLoop = 5 to $aProcesses[0][0] Step 1 434 | If _ArraySearch($aExclusions, $aProcesses[$iLoop][0]) = -1 Then 435 | $hCurProcess = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS, False, $aProcesses[$iLoop][1], $bAdmin) ; Select the Process $PROCESS_SET_INFORMATION 436 | If Not _WinAPI_SetProcessAffinityMask($hCurProcess, $hCores) Then ; Set Affinity (which cores it's assigned to) 437 | _ConsoleWrite("Failed to adjust affinity of " & $aProcesses[$iLoop][0] & " - " & $WinAPIError[_WinAPI_GetLastError()] & @CRLF, $hOutput) 438 | EndIf 439 | _WinAPI_CloseHandle($hCurProcess) ; I don't need to do anything else so tell the computer I'm done messing with it 440 | Else 441 | ;;; 442 | EndIf 443 | Next 444 | EndSelect 445 | Return SetError(0, $iExtended, 0) 446 | 447 | EndFunc 448 | 449 | ; #FUNCTION# ==================================================================================================================== 450 | ; Name ..........: _Restore 451 | ; Description ...: Reset Affinities and Priorities to Default 452 | ; Syntax ........: _Restore([$hCores = _GetCPUInfo(1[, $hOutput = False]]) 453 | ; Parameters ....: $aExclusions - [optional] Array of excluded processes 454 | ; $hCores - [optional] Cores to Set Affinity to. 455 | ; $hOutput - [optional] Handle of the GUI Console. Default is False, for none. 456 | ; Return values .: None 457 | ; Author ........: rcmaehl (Robert Maehl) 458 | ; Modified ......: 02/02/2021 459 | ; Remarks .......: 460 | ; Related .......: 461 | ; Link ..........: 462 | ; Example .......: No 463 | ; =============================================================================================================================== 464 | Func _Restore($aExclusions = Null, $hCores = 16, $hOutput = False) 465 | 466 | Local $hAllCores = 0 ; Get Maxmimum Cores Magic Number 467 | For $iLoop = 0 To $hCores - 1 468 | $hAllCores += 2^$iLoop 469 | Next 470 | 471 | ; If $aExclusions = "" Then ReDim $aExclusions[0] 472 | 473 | $aProcesses = ProcessList() ; Meat and Potatoes, Change Affinity and Priority back to normal 474 | For $iLoop = 5 to $aProcesses[0][0] Step 1 475 | If _ArraySearch($aExclusions, $aProcesses[$iLoop][0]) = -1 Then 476 | ;;; 477 | Else 478 | ContinueLoop 479 | EndIf 480 | ProcessSetPriority($aProcesses[$iLoop][0], $PROCESS_NORMAL) 481 | $hCurProcess = _WinAPI_OpenProcess($PROCESS_SET_INFORMATION, False, $aProcesses[$iLoop][1], $bAdmin) ; Select the Process 482 | _WinAPI_SetProcessAffinityMask($hCurProcess, $hAllCores) ; Set Affinity (which cores it's assigned to) 483 | _WinAPI_CloseHandle($hCurProcess) ; I don't need to do anything else so tell the computer I'm done messing with it 484 | Next 485 | _StopServices("False", $hOutput) ; Additional Clean Up 486 | 487 | EndFunc 488 | 489 | ; #FUNCTION# ==================================================================================================================== 490 | ; Name ..........: _SetPowerPlan 491 | ; Description ...: Set Windows Power Plan to High Performance 492 | ; Syntax ........: _SetPowerPlan($bState[, $hOutput = False]) 493 | ; Parameters ....: $bState - Set Power Plan to High Performance. 494 | ; $hOutput - [optional] Handle of the GUI Console. Default is False, for none. 495 | ; Return values .: None 496 | ; Author ........: rcmaehl (Robert Maehl) 497 | ; Modified ......: 3/13/2018 498 | ; Remarks .......: TO DO: Return values 499 | ; Related .......: 500 | ; Link ..........: 501 | ; Example .......: No 502 | ; =============================================================================================================================== 503 | Func _SetPowerPlan($bState, $hOutput = False) 504 | 505 | If $bState = "True" Then 506 | RunWait(@ComSpec & " /c " & 'POWERCFG /SETACTIVE SCHEME_MIN', "", @SW_HIDE) ; Set MINIMUM power saving, aka max performance 507 | ElseIf $bState = "False" Then 508 | RunWait(@ComSpec & " /c " & 'POWERCFG /SETACTIVE SCHEME_BALANCED', "", @SW_HIDE) ; Set BALANCED power plan 509 | ; Else 510 | ; _ConsoleWrite("!> SetPowerPlan Option " & $bState & " is not valid!" & @CRLF, $hOutput) 511 | EndIf 512 | 513 | EndFunc 514 | 515 | ; #FUNCTION# ==================================================================================================================== 516 | ; Name ..........: _StopServices 517 | ; Description ...: Stop services that won't be needing during gaming 518 | ; Syntax ........: _StopServices($bState[, $hOutput = False]) 519 | ; Parameters ....: $bState - "True" to stop services, "False" to start services 520 | ; $hOutput - [optional] Handle of the GUI Console. Default is False, for none. 521 | ; Return values .: None 522 | ; Author ........: rcmaehl (Robert Maehl) 523 | ; Modified ......: 3/13/2018 524 | ; Remarks .......: TO DO: Return values, Accept Array of Services to Start/Stop 525 | ; Related .......: 526 | ; Link ..........: 527 | ; Example .......: No 528 | ; =============================================================================================================================== 529 | Func _StopServices($bState, $hOutput = False) 530 | 531 | If $bState = "True" Then 532 | ; _ConsoleWrite("Temporarily Pausing Game Impacting Services..." & @CRLF, $hOutput) 533 | RunWait(@ComSpec & " /c " & 'net stop wuauserv', "", @SW_HIDE) ; Stop Windows Update 534 | RunWait(@ComSpec & " /c " & 'net stop spooler', "", @SW_HIDE) ; Stop Printer Spooler 535 | ; _ConsoleWrite("Done!" & @CRLF, $hOutput) 536 | ElseIf $bState = "False" Then 537 | ; _ConsoleWrite("Restarting Any Stopped Services..." & @CRLF, $hOutput) 538 | RunWait(@ComSpec & " /c " & 'net start wuauserv', "", @SW_HIDE) ; Start Windows Update 539 | RunWait(@ComSpec & " /c " & 'net start spooler', "", @SW_HIDE) ; Start Printer Spooler 540 | ; _ConsoleWrite("Done!" & @CRLF, $hOutput) 541 | ; Else 542 | ; _ConsoleWrite("!> StopServices Option " & $bState & " is not valid!" & @CRLF, $hOutput) 543 | EndIf 544 | 545 | EndFunc 546 | 547 | ; #FUNCTION# ==================================================================================================================== 548 | ; Name ..........: _ToggleHPET 549 | ; Description ...: Toggle the High Precision Event Timer 550 | ; Syntax ........: _ToggleHPET([$bState = "", $hOutput = False]) 551 | ; Parameters ....: $bState - [optional] Set HPET On or Off. Default is "", for detect and toggle 552 | ; $hOutput - [optional] Handle of the GUI Console. Default is False, for none. 553 | ; Return values .: None 554 | ; Author ........: rcmaehl (Robert Maehl) 555 | ; Modified ......: 8/4/2020 556 | ; Remarks .......: TO DO: Return values 557 | ; Related .......: 558 | ; Link ..........: 559 | ; Example .......: No 560 | ; =============================================================================================================================== 561 | Func _ToggleHPET($bState = "", $hOutput = False) 562 | 563 | Switch $bState 564 | Case "" 565 | 566 | Local $sFile = @TempDir & "\bcdedit.txt" 567 | RunWait(@ComSpec & ' /c bcdedit /enum {current} >> ' & $sFile, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) 568 | 569 | If FileExists($sFile) Then 570 | Local $hFile = FileOpen($sFile) 571 | If @error Then Return SetError(1,0,0) 572 | Else 573 | Return SetError(1,1,0) 574 | EndIf 575 | 576 | Local $sLine 577 | Local $iLines = _FileCountLines($sFile) 578 | 579 | For $iLine = 1 to $iLines Step 1 580 | $sLine = FileReadLine($hFile, $iLine) 581 | If @error = -1 Then ExitLoop 582 | If StringLeft($sLine, 16) = "useplatformclock" Then 583 | $sLine = StringStripWS($sLine, $STR_STRIPALL) 584 | $sLine = StringReplace($sLine, "useplatformclock", "") 585 | ExitLoop 586 | EndIf 587 | Next 588 | 589 | FileClose($sFile) 590 | FileDelete($sFile) 591 | 592 | If $sLine = "Yes" Then 593 | Run("bcdedit /deletevalue useplatformclock") ; Disable System Event Timer 594 | Else 595 | Run("bcdedit /set useplatformclock true") ; Enable System Event Timer 596 | EndIf 597 | 598 | Case True 599 | Run("bcdedit /set useplatformclock true") ; Enable System Event Timer 600 | 601 | Case False 602 | Run("bcdedit /deletevalue useplatformclock") ; Disable System Event Timer 603 | 604 | EndSwitch 605 | 606 | EndFunc -------------------------------------------------------------------------------- /Includes/_ExtendedFunctions.au3: -------------------------------------------------------------------------------- 1 | #include-once 2 | 3 | #include 4 | #include 5 | 6 | ; #FUNCTION# ==================================================================================================================== 7 | ; Name ..........: _ConsoleWrite 8 | ; Description ...: Writes data to the STDOUT stream or GUI handle. 9 | ; Syntax ........: _ConsoleWrite($sMessage[, $hOutput = False]) 10 | ; Parameters ....: $sMessage - The data you wish to output. This may either be text or binary. 11 | ; $hOutput - [optional] Handle of the Console. Default is False, for STDOUT. 12 | ; Return values .: The amount of data written. If writing binary, the number of bytes written, if writing text, the number of 13 | ; characters written. 14 | ; Author ........: rcmaehl (Robert Maehl) 15 | ; Modified ......: 07/07/2020 16 | ; Remarks .......: 17 | ; Related .......: ConsoleWrite 18 | ; Link ..........: 19 | ; Example .......: No 20 | ; =============================================================================================================================== 21 | Func _ConsoleWrite($sMessage, $hOutput = False) 22 | 23 | If $hOutput = False Then 24 | ConsoleWrite($sMessage) 25 | Else 26 | _GUICtrlEdit_SetSel($hOutput, StringLen(GUICtrlRead($hOutput)), -1) 27 | GUICtrlSetData($hOutput, $sMessage, True) 28 | _GUICtrlEdit_LineScroll($hOutput, 0, _GUICtrlEdit_GetLineCount($hOutput)) 29 | EndIf 30 | 31 | If IsBinary($sMessage) Then 32 | Return BinaryLen($sMessage) 33 | Else 34 | Return StringLen($sMessage) 35 | EndIf 36 | 37 | EndFunc 38 | 39 | ; #FUNCTION# ==================================================================================================================== 40 | ; Name ..........: _IniRead 41 | ; Description ...: Reads a value from a standard format .ini file and only returns Valid results 42 | ; Syntax ........: _IniRead($hFile, $sSection, $sKey, $sValid, $sDefault) 43 | ; Parameters ....: $hFile - The filename of the .ini file. 44 | ; $sSection - The section name in the .ini file. 45 | ; $sKey - The key name in the .ini file. 46 | ; $sValid - Valid results separated with Opt("GUIDataSeparatorChar"), blank for allow all 47 | ; $sDefault - The default value to return if the requested key is not found. 48 | ; $bCaseSensitive - [optional] Should valid matching be case sensitive 49 | ; Return values .: Success - the requested key value as a string. 50 | ; Failure - the default string if requested key not found or not Valid 51 | ; Author ........: Robert Maehl (rcmaehl) 52 | ; Modified ......: 07/07/2020 53 | ; Remarks .......: 54 | ; Related .......: IniRead 55 | ; Link ..........: 56 | ; Example .......: No 57 | ; =============================================================================================================================== 58 | Func _IniRead($hFile, $sSection, $sKey, $sValid, $sDefault, $bCaseSensitive = False) 59 | Local $sReturn = IniRead($hFile, $sSection, $sKey, $sDefault) 60 | 61 | If $sValid = "" Then 62 | Return $sReturn 63 | Else 64 | Local $aValid = StringSplit($sValid, Opt("GUIDataSeparatorChar"), $STR_NOCOUNT) 65 | If _ArraySearch($aValid, $sReturn, 0, 0, $bCaseSensitive) = -1 Then 66 | Return $sDefault 67 | Else 68 | Return $sReturn 69 | EndIf 70 | EndIf 71 | 72 | EndFunc -------------------------------------------------------------------------------- /Includes/_FreezeToStock.au3: -------------------------------------------------------------------------------- 1 | ; #FUNCTION# ==================================================================================================================== 2 | ; Name ..........: _FreezeToStock 3 | ; Description ...: Suspend unneeded processes, excluding minialistic required system processes 4 | ; Syntax ........: _FreezeToStock($aExclusions, $hOutput = False]]) 5 | ; Parameters ....: $aProcessExclusions - Array of Processes to Exclude 6 | ; $bIncludeServices - Boolean for whether or not services should be included 7 | ; $aServicesExclusions - Array of Services to Exclude 8 | ; $bAggressive - Boolean for whether or not sc stop should be used 9 | ; $hOutput - Handle of the GUI Console 10 | ; Return values .: 1 - An error has occured 11 | ; Author ........: rcmaehl (Robert Maehl) 12 | ; Modified ......: 09/07/2020 13 | ; Remarks .......: 14 | ; Related .......: 15 | ; Link ..........: 16 | ; Example .......: No 17 | ; =============================================================================================================================== 18 | Func _FreezeToStock($aProcessExclusions, $bIncludeServices, $aServicesExclusions, $bAggressive, $hOutput) 19 | 20 | _GUICtrlStatusBar_SetText($hOutput, "Freezing...", 0) 21 | 22 | If @Compiled Then 23 | Local $aSelf[1] = ["FTS.exe"] 24 | Else 25 | Local $aSelf[3] = ["AutoIt3.exe", "AutoIt3_x64.exe", "SciTE.exe"] 26 | EndIf 27 | 28 | Local $aCantBeSuspended[6] = ["Memory Compression", _ 29 | "Registry", _ 30 | "Secure System", _ 31 | "System", _ 32 | "System Idle Process", _ 33 | "System Interrupts"] 34 | 35 | Local $aSystemProcesses[33] = ["ApplicationFrameHost.exe", _ 36 | "backgroundTaskHost.exe", _ 37 | "csrss.exe", _ ; Runtime System Service 38 | "ctfmon.exe", _ ; Alternative Input 39 | "dllhost.exe", _ ; COM Host 40 | "dwm.exe", _ ; Desktop Window Manager / Compositer 41 | "explorer.exe", _ ; Windows Explorer 42 | "fontdrvhost.exe", _ 43 | "lsass.exe", _ 44 | "MsMpEng.exe", _ ; Defender 45 | "NisSrv.exe", _ 46 | "RuntimeBroker.exe", _ 47 | "SecurityHealthService.exe", _ 48 | "SecurityHealthSystray.exe", _ 49 | "services.exe", _ ; Windows Services 50 | "SgrmBroker.exe", _ 51 | "ShellExperienceHost.exe", _; UWP Apps 52 | "sihost.exe", _ 53 | "smartscreen.exe", _ 54 | "smss.exe", _ 55 | "StartMenuExperienceHost.exe", _ 56 | "svchost.exe", _ ; Service Host 57 | "taskhostw.exe", _ ; Task Host 58 | "taskmgr.exe", _ ; Task Manager 59 | "TextInputHost.exe", _ 60 | "unsecapp.exe", _ ; WMI 61 | "VSSVC.exe", _ 62 | "wininit.exe", _ 63 | "winlogon.exe", _ ; Windows Logon 64 | "wlanext.exe", _ ; WLAN 65 | "WmiPrvSE.exe", _ ; WMI 66 | "WUDFHost.exe", _ ; Windows Usermode Drivers 67 | "WWAHost.exe"] 68 | 69 | Local $aSystemServices[71] = ["Appinfo", _ ; Application Information 70 | "AudioEndpointBuilder", _ ; Windows Audio Endpoint Builder 71 | "Audiosrv", _ ; Windows Audio 72 | "BFE", _ ; Base Filtering Engine 73 | "BrokerInfrastructure", _ ; Background Tasks Infrastructure Service 74 | "camsvc", _ ; Capability Access Manager Service 75 | "CertPropSvc", _ ; Certificate Propagation 76 | "CoreMessagingRegistrar", _ ; CoreMessaging 77 | "CryptSvc", _ ; Cryptographic Services 78 | "DcomLaunch", _ ; DCOM Server Process Launcher 79 | "Dhcp", _ ; DHCP Client 80 | "DispBrokerDesktopSvc", _ ; Display Policy Service 81 | "Dnscache", _ ; DNS Client 82 | "DPS", _ ; Diagnostic Policy Service 83 | "DusmSvc", _ ; Data Usage 84 | "EventLog", _ ; Windows Event Log 85 | "EventSystem", _ ; COM+ Event System 86 | "FontCache", _ ; Windows Font Cache Service 87 | "gpsvc", _ ; Group Policy Client 88 | "iphlpsvc", _ ; IP Helper 89 | "KeyIso", _ ; CNG Key Isolation 90 | "LanmanServer", _ ; Server 91 | "LanmanWorkstation", _ ; Workstation 92 | "lmhosts", _ ; TCP/IP NetBIOS Helper 93 | "LSM", _ ; Local Session Manager 94 | "mpssvc", _ ; Windows Defender Firewall 95 | "NcbService", _ ; Network Connection Broker 96 | "netprofm", _ ; Network List Service 97 | "NlaSvc", _ ; Network Location Awareness 98 | "nsi", _ ; Network Store Interface Service 99 | "PcaSvc", _ ; Program Compatibility Assistant Service 100 | "PlugPlay", _ ; Plug and Play 101 | "Power", _ ; Power 102 | "ProfSvc", _ ; User Profile Service 103 | "RmSvc", _ ; Radio Management Service 104 | "RpcEptMapper", _ ; RPC Endpoint Mapper 105 | "RpcSs", _ ; Remote Procedure Call 106 | "SamSs", _ ; Security Accounts Manager 107 | "Schedule", _ ; Task Scheduler 108 | "SecurityHealthService", _ ; Windows Security Service 109 | "SENS", _ ; System Event Notification Service 110 | "SessionEvc", _ ; Remote Desktop Configuration 111 | "SgrmBroker", _ ; System Guard Runtime Monitor Broker 112 | "ShellHWDetection", _ ; Shell Hardware Detection 113 | "StateRepository", _ ; State Repository Service 114 | "StorSvc", _ ; Storage Service 115 | "swprv", _ ; Microsoft Software Shadow Copy Provider 116 | "SysMain", _ ; SysMain 117 | "SystemEventsBroker", _ ; System Events Broker 118 | "TabletInputService", _ ; Touch Keyboard and Handwriting Panel Service 119 | "TermService", _ ; Remote Desktop Services 120 | "Themes", _ ; Themes 121 | "TimeBrokerSvc", _ ; Time Broker 122 | "TokenBroker", _ ; Web Account Manager 123 | "TrkWks", _ ; Distributed Link Tracking Client" 124 | "UmRdpService", _ ; Remote Desktop Services UserMode Port Redirector 125 | "UserManager", _ ; User Manager 126 | "UsoSvc", _ ; Update Orchestreator Service 127 | "VaultSvc", _ ; Credential Manager 128 | "VSS", _ ; Volume Shadow Copy 129 | "WarpJITSvc", _ ; WarpJITSvc 130 | "WbioSrvc", _ ; Windows Biometric Service 131 | "Wcmsvc", _ ; Windows Connection Manager 132 | "WdiServiceHost", _ ; Diagnostic Service Host 133 | "WdiSystemHost", _ ; Diagnostic System Host 134 | "WdNisSvc", _ ; Windows Defender Antivirus Network Inspection Service 135 | "WinDefend", _ ; Windows Defender Antivirus Service 136 | "WinHttpAutoProxySvc", _ ; WinHTTP Web Proxy Auto-Discovery Service 137 | "Winmgmt", _ ; Windows Management Instrumentation 138 | "WpnService", _ ; Windows Push Notifications System Service 139 | "wscsvc"] ; Security Center 140 | 141 | _ArrayConcatenate($aProcessExclusions, $aSelf) 142 | _ArrayConcatenate($aProcessExclusions, $aCantBeSuspended) 143 | _ArrayConcatenate($aProcessExclusions, $aSystemProcesses) 144 | 145 | _ArrayConcatenate($aServicesExclusions, $aSystemServices) 146 | 147 | $aProcesses = ProcessList() 148 | For $iLoop = 0 to $aProcesses[0][0] Step 1 149 | If _ArraySearch($aProcessExclusions, $aProcesses[$iLoop][0]) = -1 Then 150 | _GUICtrlStatusBar_SetText($hOutput, "Process: " & $aProcesses[$iLoop][0], 1) 151 | _ProcessSuspend($aProcesses[$iLoop][1]) 152 | Else 153 | ConsoleWrite("Skipped " & $aProcesses[$iLoop][0] & @CRLF) 154 | EndIf 155 | Next 156 | 157 | If $bIncludeServices Then 158 | Local $hSCM = _SCMStartup() 159 | $aServices = _ServicesList() 160 | For $iLoop0 = 0 To 2 Step 1 ; Account for process dependencies 161 | For $iLoop1 = 0 to $aServices[0][0] Step 1 162 | If $aServices[$iLoop1][1] = "RUNNING" Then 163 | If _ArraySearch($aServicesExclusions, $aServices[$iLoop1][0]) = -1 Then 164 | If $bAggressive Then 165 | _GUICtrlStatusBar_SetText($hOutput, $iLoop0 + 1 & "/3 Service: " & $aServices[$iLoop1][0], 1) 166 | _ServiceStop($hSCM, $aServices[$iLoop1][0]) 167 | Else 168 | _GUICtrlStatusBar_SetText($hOutput, $iLoop0 + 1 & "/3 Service: " & $aServices[$iLoop1][0], 1) 169 | _ServicePause($hSCM, $aServices[$iLoop1][0]) 170 | EndIf 171 | Sleep(10) 172 | Else 173 | ConsoleWrite("Skipped " & $aServices[$iLoop1][0] & @CRLF) 174 | EndIf 175 | EndIf 176 | Next 177 | Next 178 | _SCMShutdown($hSCM) 179 | EndIf 180 | 181 | _GUICtrlStatusBar_SetText($hOutput, "", 0) 182 | _GUICtrlStatusBar_SetText($hOutput, "", 1) 183 | 184 | EndFunc 185 | 186 | ; #FUNCTION# ==================================================================================================================== 187 | ; Name ..........: _ServicesList 188 | ; Description ...: Get a list of Services and their current state 189 | ; Syntax ........: _ServicesList() 190 | ; Parameters ....: 191 | ; Return values .: An Array containing [0][0] Services Count, [x][0] Service name, [x][1] Service State 192 | ; Author ........: rcmaehl (Robert Maehl) based on work by Kyan 193 | ; Modified ......: 09/05/2020 194 | ; Remarks .......: 195 | ; Related .......: 196 | ; Link ..........: 197 | ; Example .......: No 198 | ; =============================================================================================================================== 199 | Func _ServicesList() ; 200 | Local $iExitCode, $st,$a,$aServicesList[1][2],$x 201 | $iExitCode = Run(@ComSpec & ' /C sc queryex type= service state= all', '', @SW_HIDE, 0x2) 202 | While 1 203 | $st &= StdoutRead($iExitCode) 204 | If @error Then ExitLoop 205 | Sleep(10) 206 | WEnd 207 | $a = StringRegExp($st,'(?m)(?i)(?s)(?:SERVICE_NAME|NOME_SERVI€O)\s*?:\s+?(\w+).+?(?:STATE|ESTADO)\s+?:\s+?\d+?\s+?(\w+)',3) 208 | For $x = 0 To UBound($a)-1 Step 2 209 | ReDim $aServicesList[UBound($aServicesList)+1][2] 210 | $aServicesList[UBound($aServicesList)-1][0]=$a[$x] 211 | $aServicesList[UBound($aServicesList)-1][1]=$a[$x+1] 212 | Next 213 | $aServicesList[0][0] = UBound($aServicesList)-1 214 | Return $aServicesList 215 | EndFunc 216 | 217 | ; #FUNCTION# ==================================================================================================================== 218 | ; Name ..........: _ThawFromStock 219 | ; Description ...: Unsuspend all processes 220 | ; Syntax ........: _FreezeToStock(Byref $aExclusions, $hOutput = False]]) 221 | ; Parameters ....: $aProcessExclusions - Array of Processes to Exclude 222 | ; $bIncludeServices - Boolean for whether or not services should be included 223 | ; $aServicesSnapshot - Array of Previously Running Services 224 | ; $bAggressive - Boolean for Whether or not sc stop was used 225 | ; $hOutput - [optional] Handle of the GUI Console. Default is False, for none. 226 | ; Return values .: 1 - An error has occured 227 | ; Author ........: rcmaehl (Robert Maehl) 228 | ; Modified ......: 09/07/2020 229 | ; Remarks .......: 230 | ; Related .......: 231 | ; Link ..........: 232 | ; Example .......: No 233 | ; =============================================================================================================================== 234 | Func _ThawFromStock($aProcessExclusions, $bIncludeServices, $aServicesSnapshot, $bAggressive, $hOutput) 235 | 236 | _GUICtrlStatusBar_SetText($hOutput, "Thawing...", 0) 237 | 238 | $aProcesses = ProcessList() 239 | For $iLoop = 0 to $aProcesses[0][0] Step 1 240 | If _ArraySearch($aProcessExclusions, $aProcesses[$iLoop][0]) = -1 Then 241 | _GUICtrlStatusBar_SetText($hOutput, "Process: " & $aProcesses[$iLoop][0], 1) 242 | _ProcessResume($aProcesses[$iLoop][1]) 243 | Else 244 | ;;; 245 | EndIf 246 | Next 247 | 248 | If $bIncludeServices Then 249 | Local $hSCM = _SCMStartup() 250 | For $iLoop0 = 0 To 2 Step 1 ; Account for process dependencies 251 | For $iLoop1 = 0 to $aServicesSnapshot[0][0] Step 1 252 | If $aServicesSnapshot[$iLoop1][1] = "RUNNING" Then 253 | If $bAggressive Then 254 | _GUICtrlStatusBar_SetText($hOutput, $iLoop0 + 1 & "/3 Service: " & $aServicesSnapshot[$iLoop1][0], 1) 255 | _ServiceStart($hSCM, $aServicesSnapshot[$iLoop1][0]) 256 | Else 257 | _GUICtrlStatusBar_SetText($hOutput, $iLoop0 + 1 & "/3 Service: " & $aServicesSnapshot[$iLoop1][0], 1) 258 | _ServiceContinue($hSCM, $aServicesSnapshot[$iLoop1][0]) 259 | EndIf 260 | Sleep(10) 261 | Else 262 | ;;; 263 | EndIf 264 | Next 265 | Next 266 | _SCMShutdown($hSCM) 267 | EndIf 268 | 269 | _GUICtrlStatusBar_SetText($hOutput, "", 0) 270 | _GUICtrlStatusBar_SetText($hOutput, "", 1) 271 | 272 | EndFunc 273 | 274 | Func _ProcessSuspend($iPID) 275 | $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $iPID) 276 | $i_success = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0]) 277 | DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) 278 | If IsArray($i_success) Then 279 | Return 1 280 | Else 281 | SetError(1) 282 | Return 0 283 | EndIf 284 | EndFunc 285 | 286 | Func _ProcessResume($iPID) 287 | $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $iPID) 288 | $i_success = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0]) 289 | DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) 290 | If IsArray($i_success) Then 291 | Return 1 292 | Else 293 | SetError(1) 294 | Return 0 295 | EndIf 296 | EndFunc -------------------------------------------------------------------------------- /Includes/_GetEnvironment.au3: -------------------------------------------------------------------------------- 1 | Func _GetLanguage($iFlag = 0) 2 | $sLang = "Unknown" 3 | Switch @OSLang 4 | Case "0436" 5 | $sLang = "Afrikaans - South Africa" 6 | Case "041C" 7 | $sLang = "Albanian - Albania" 8 | Case "1401" 9 | $sLang = "Arabic - Algeria" 10 | Case "3C01" 11 | $sLang = "Arabic - Bahrain" 12 | Case "0C01" 13 | $sLang = "Arabic - Egypt" 14 | Case "0801" 15 | $sLang = "Arabic - Iraq" 16 | Case "2C01" 17 | $sLang = "Arabic - Jordan" 18 | Case "3401" 19 | $sLang = "Arabic - Kuwait" 20 | Case "3001" 21 | $sLang = "Arabic - Lebanon" 22 | Case "1001" 23 | $sLang = "Arabic - Libya" 24 | Case "1801" 25 | $sLang = "Arabic - Morocco" 26 | Case "2001" 27 | $sLang = "Arabic - Oman" 28 | Case "4001" 29 | $sLang = "Arabic - Qatar" 30 | Case "0401" 31 | $sLang = "Arabic - Saudi Arabia" 32 | Case "2801" 33 | $sLang = "Arabic - Syria" 34 | Case "1C01" 35 | $sLang = "Arabic - Tunisia" 36 | Case "3801" 37 | $sLang = "Arabic - United Arab Emirates" 38 | Case "2401" 39 | $sLang = "Arabic - Yemen" 40 | Case "042B" 41 | $sLang = "Armenian - Armenia" 42 | Case "082C" 43 | $sLang = "Azeri (Cyrillic) - Azerbaijan" 44 | Case "042C" 45 | $sLang = "Azeri (Latin) - Azerbaijan" 46 | Case "042D" 47 | $sLang = "Basque - Basque" 48 | Case "0423" 49 | $sLang = "Belarusian - Belarus" 50 | Case "0402" 51 | $sLang = "Bulgarian - Bulgaria" 52 | Case "0403" 53 | $sLang = "Catalan - Catalan" 54 | Case "0804" 55 | $sLang = "Chinese - China" 56 | Case "0C04" 57 | $sLang = "Chinese - Hong Kong SAR" 58 | Case "1404" 59 | $sLang = "Chinese - Macau SAR" 60 | Case "1004" 61 | $sLang = "Chinese - Singapore" 62 | Case "0404" 63 | $sLang = "Chinese - Taiwan" 64 | Case "0004" 65 | $sLang = "Chinese (Simplified)" 66 | Case "7C04" 67 | $sLang = "Chinese (Traditional)" 68 | Case "041A" 69 | $sLang = "Croatian - Croatia" 70 | Case "0405" 71 | $sLang = "Czech - Czech Republic" 72 | Case "0406" 73 | $sLang = "Danish - Denmark" 74 | Case "0465" 75 | $sLang = "Dhivehi - Maldives" 76 | Case "0813" 77 | $sLang = "Dutch - Belgium" 78 | Case "0413" 79 | $sLang = "Dutch - The Netherlands" 80 | Case "0C09" 81 | $sLang = "English - Australia" 82 | Case "2809" 83 | $sLang = "English - Belize" 84 | Case "1009" 85 | $sLang = "English - Canada" 86 | Case "2409" 87 | $sLang = "English - Caribbean" 88 | Case "1809" 89 | $sLang = "English - Ireland" 90 | Case "2009" 91 | $sLang = "English - Jamaica" 92 | Case "1409" 93 | $sLang = "English - New Zealand" 94 | Case "3409" 95 | $sLang = "English - Philippines" 96 | Case "1C09" 97 | $sLang = "English - South Africa" 98 | Case "2C09" 99 | $sLang = "English - Trinidad and Tobago" 100 | Case "0809" 101 | $sLang = "English - United Kingdom" 102 | Case "0409" 103 | $sLang = "English - United States" 104 | Case "3009" 105 | $sLang = "English - Zimbabwe" 106 | Case "0425" 107 | $sLang = "Estonian - Estonia" 108 | Case "0438" 109 | $sLang = "Faroese - Faroe Islands" 110 | Case "0429" 111 | $sLang = "Farsi - Iran" 112 | Case "040B" 113 | $sLang = "Finnish - Finland" 114 | Case "080C" 115 | $sLang = "French - Belgium" 116 | Case "0C0C" 117 | $sLang = "French - Canada" 118 | Case "040C" 119 | $sLang = "French - France" 120 | Case "140C" 121 | $sLang = "French - Luxembourg" 122 | Case "180C" 123 | $sLang = "French - Monaco" 124 | Case "100C" 125 | $sLang = "French - Switzerland" 126 | Case "0456" 127 | $sLang = "Galician - Galician" 128 | Case "0437" 129 | $sLang = "Georgian - Georgia" 130 | Case "0C07" 131 | $sLang = "German - Austria" 132 | Case "0407" 133 | $sLang = "German - Germany" 134 | Case "1407" 135 | $sLang = "German - Liechtenstein" 136 | Case "1007" 137 | $sLang = "German - Luxembourg" 138 | Case "0807" 139 | $sLang = "German - Switzerland" 140 | Case "0408" 141 | $sLang = "Greek - Greece" 142 | Case "0447" 143 | $sLang = "Gujarati - India" 144 | Case "040D" 145 | $sLang = "Hebrew - Israel" 146 | Case "0439" 147 | $sLang = "Hindi - India" 148 | Case "040E" 149 | $sLang = "Hungarian - Hungary" 150 | Case "040F" 151 | $sLang = "Icelandic - Iceland" 152 | Case "0421" 153 | $sLang = "Indonesian - Indonesia" 154 | Case "0410" 155 | $sLang = "Italian - Italy" 156 | Case "0810" 157 | $sLang = "Italian - Switzerland" 158 | Case "0411" 159 | $sLang = "Japanese - Japan" 160 | Case "044B" 161 | $sLang = "Kannada - India" 162 | Case "043F" 163 | $sLang = "Kazakh - Kazakhstan" 164 | Case "0457" 165 | $sLang = "Konkani - India" 166 | Case "0412" 167 | $sLang = "Korean - Korea" 168 | Case "0440" 169 | $sLang = "Kyrgyz - Kazakhstan" 170 | Case "0426" 171 | $sLang = "Latvian - Latvia" 172 | Case "0427" 173 | $sLang = "Lithuanian - Lithuania" 174 | Case "042F" 175 | $sLang = "Macedonian (FYROM)" 176 | Case "083E" 177 | $sLang = "Malay - Brunei" 178 | Case "043E" 179 | $sLang = "Malay - Malaysia" 180 | Case "044E" 181 | $sLang = "Marathi - India" 182 | Case "0450" 183 | $sLang = "Mongolian - Mongolia" 184 | Case "0414" 185 | $sLang = "Norwegian (Bokmål) - Norway" 186 | Case "0814" 187 | $sLang = "Norwegian (Nynorsk) - Norway" 188 | Case "0415" 189 | $sLang = "Polish - Poland" 190 | Case "0416" 191 | $sLang = "Portuguese - Brazil" 192 | Case "0816" 193 | $sLang = "Portuguese - Portugal" 194 | Case "0446" 195 | $sLang = "Punjabi - India" 196 | Case "0418" 197 | $sLang = "Romanian - Romania" 198 | Case "0419" 199 | $sLang = "Russian - Russia" 200 | Case "044F" 201 | $sLang = "Sanskrit - India" 202 | Case "0C1A" 203 | $sLang = "Serbian (Cyrillic) - Serbia" 204 | Case "081A" 205 | $sLang = "Serbian (Latin) - Serbia" 206 | Case "041B" 207 | $sLang = "Slovak - Slovakia" 208 | Case "0424" 209 | $sLang = "Slovenian - Slovenia" 210 | Case "2C0A" 211 | $sLang = "Spanish - Argentina" 212 | Case "400A" 213 | $sLang = "Spanish - Bolivia" 214 | Case "340A" 215 | $sLang = "Spanish - Chile" 216 | Case "240A" 217 | $sLang = "Spanish - Colombia" 218 | Case "140A" 219 | $sLang = "Spanish - Costa Rica" 220 | Case "1C0A" 221 | $sLang = "Spanish - Dominican Republic" 222 | Case "300A" 223 | $sLang = "Spanish - Ecuador" 224 | Case "440A" 225 | $sLang = "Spanish - El Salvador" 226 | Case "100A" 227 | $sLang = "Spanish - Guatemala" 228 | Case "480A" 229 | $sLang = "Spanish - Honduras" 230 | Case "080A" 231 | $sLang = "Spanish - Mexico" 232 | Case "4C0A" 233 | $sLang = "Spanish - Nicaragua" 234 | Case "180A" 235 | $sLang = "Spanish - Panama" 236 | Case "3C0A" 237 | $sLang = "Spanish - Paraguay" 238 | Case "280A" 239 | $sLang = "Spanish - Peru" 240 | Case "500A" 241 | $sLang = "Spanish - Puerto Rico" 242 | Case "0C0A" 243 | $sLang = "Spanish - Spain" 244 | Case "380A" 245 | $sLang = "Spanish - Uruguay" 246 | Case "200A" 247 | $sLang = "Spanish - Venezuela" 248 | Case "0441" 249 | $sLang = "Swahili - Kenya" 250 | Case "081D" 251 | $sLang = "Swedish - Finland" 252 | Case "041D" 253 | $sLang = "Swedish - Sweden" 254 | Case "045A" 255 | $sLang = "Syriac - Syria" 256 | Case "0449" 257 | $sLang = "Tamil - India" 258 | Case "0444" 259 | $sLang = "Tatar - Russia" 260 | Case "044A" 261 | $sLang = "Telugu - India" 262 | Case "041E" 263 | $sLang = "Thai - Thailand" 264 | Case "041F" 265 | $sLang = "Turkish - Turkey" 266 | Case "0422" 267 | $sLang = "Ukrainian - Ukraine" 268 | Case "0420" 269 | $sLang = "Urdu - Pakistan" 270 | Case "0843" 271 | $sLang = "Uzbek (Cyrillic) - Uzbekistan" 272 | Case "0443" 273 | $sLang = "Uzbek (Latin) - Uzbekistan" 274 | Case "042A" 275 | $sLang = "Vietnamese - Vietnam" 276 | Case Else 277 | Switch StringRight(@OSLang, 2) 278 | Case "36" 279 | $sLang = "Afrikaans - Other" 280 | Case "1C" 281 | $sLang = "Albanian - Other" 282 | Case "01" 283 | $sLang = "Arabic - Other" 284 | Case "2B" 285 | $sLang = "Armenian - Other" 286 | Case "2C" 287 | $sLang = "Azeri - Other" 288 | Case "2D" 289 | $sLang = "Basque - Other" 290 | Case "23" 291 | $sLang = "Belarusian - Other" 292 | Case "02" 293 | $sLang = "Bulgarian - Other" 294 | Case "03" 295 | $sLang = "Catalan - Other" 296 | Case "04" 297 | $sLang = "Chinese - Other" 298 | Case "1A" 299 | $sLang = "Croatian - Other" 300 | Case "05" 301 | $sLang = "Czech - Other" 302 | Case "06" 303 | $sLang = "Danish - Other" 304 | Case "65" 305 | $sLang = "Dhivehi - Other" 306 | Case "13" 307 | $sLang = "Dutch - Other" 308 | Case "09" 309 | $sLang = "English - Other" 310 | Case "25" 311 | $sLang = "Estonian - Other" 312 | Case "38" 313 | $sLang = "Faroese - Other" 314 | Case "29" 315 | $sLang = "Farsi - Other" 316 | Case "0B" 317 | $sLang = "Finnish - Other" 318 | Case "0C" 319 | $sLang = "French - Other" 320 | Case "56" 321 | $sLang = "Galician - Other" 322 | Case "37" 323 | $sLang = "Georgian - Other" 324 | Case "07" 325 | $sLang = "German - Other" 326 | Case "08" 327 | $sLang = "Greek - Other" 328 | Case "47" 329 | $sLang = "Gujarati - Other" 330 | Case "0D" 331 | $sLang = "Hebrew - Other" 332 | Case "39" 333 | $sLang = "Hindi - Other" 334 | Case "0E" 335 | $sLang = "Hungarian - Other" 336 | Case "0F" 337 | $sLang = "Icelandic - Other" 338 | Case "21" 339 | $sLang = "Indonesian - Other" 340 | Case "10" 341 | $sLang = "Italian - Other" 342 | Case "11" 343 | $sLang = "Japanese - Other" 344 | Case "4B" 345 | $sLang = "Kannada - Other" 346 | Case "3F" 347 | $sLang = "Kazakh - Other" 348 | Case "57" 349 | $sLang = "Konkani - Other" 350 | Case "12" 351 | $sLang = "Korean - Other" 352 | Case "40" 353 | $sLang = "Kyrgyz - Other" 354 | Case "26" 355 | $sLang = "Latvian - Other" 356 | Case "27" 357 | $sLang = "Lithuanian - Other" 358 | Case "2F" 359 | $sLang = "Macedonian - Other" 360 | Case "3E" 361 | $sLang = "Malay - Other" 362 | Case "4E" 363 | $sLang = "Marathi - Other" 364 | Case "50" 365 | $sLang = "Mongolian - Other" 366 | Case "14" 367 | $sLang = "Norwegian - Other" 368 | Case "15" 369 | $sLang = "Polish - Other" 370 | Case "16" 371 | $sLang = "Portuguese - Other" 372 | Case "46" 373 | $sLang = "Punjabi - Other" 374 | Case "18" 375 | $sLang = "Romanian - Other" 376 | Case "19" 377 | $sLang = "Russian - Other" 378 | Case "4F" 379 | $sLang = "Sanskrit - Other" 380 | Case "1A" 381 | $sLang = "Serbian - Other" 382 | Case "1B" 383 | $sLang = "Slovak - Other" 384 | Case "24" 385 | $sLang = "Slovenian - Other" 386 | Case "0A" 387 | $sLang = "Spanish - Other" 388 | Case "41" 389 | $sLang = "Swahili - Other" 390 | Case "1D" 391 | $sLang = "Swedish - Other" 392 | Case "5A" 393 | $sLang = "Syriac - Other" 394 | Case "49" 395 | $sLang = "Tamil - Other" 396 | Case "44" 397 | $sLang = "Tatar - Other" 398 | Case "4A" 399 | $sLang = "Telugu - Other" 400 | Case "1E" 401 | $sLang = "Thai - Other" 402 | Case "1F" 403 | $sLang = "Turkish - Other" 404 | Case "22" 405 | $sLang = "Ukrainian - Other" 406 | Case "20" 407 | $sLang = "Urdu - Other" 408 | Case "43" 409 | $sLang = "Uzbek - Other" 410 | Case "2A" 411 | $sLang = "Vietnamese - Other" 412 | EndSwitch 413 | EndSwitch 414 | Return $sLang 415 | EndFunc -------------------------------------------------------------------------------- /Includes/_ModeSelect.au3: -------------------------------------------------------------------------------- 1 | Func ModeSelect($CmdLine) 2 | Switch $CmdLine[0] 3 | Case 0 4 | ConsoleWrite("Backend Console (Read-Only Mode)" & @CRLF & "Feel free to minimize, but closing will close the UI as well" & @CRLF & @CRLF) 5 | Main() 6 | Case 1 7 | Switch $CmdLine[1] 8 | Case "/?" 9 | ConsoleWrite("Available Commands: OptimizeAll Optimize ToggleHPET StopServices SetPowerPlan Restore" & @CRLF) 10 | Case "Help" 11 | ConsoleWrite("Available Commands: OptimizeAll Optimize ToggleHPET StopServices SetPowerPlan Restore" & @CRLF) 12 | Case "OptimizeAll" 13 | ConsoleWrite("OptimizeAll Requires ProcessName.exe CoreToRunOn" & @CRLF) 14 | Case "Optimize" 15 | ConsoleWrite("Optimize Requires ProcessName.exe CoreToRunOn" & @CRLF) 16 | Sleep(5000) 17 | Case "ToggleHPET" 18 | ConsoleWrite("ToggleHPET Requires True/False" & @CRLF) 19 | Case "StopServices" 20 | ConsoleWrite("StopServices Requires True/False" & @CRLF) 21 | Case "SetPowerPlan" 22 | ConsoleWrite("SetPowerPlan Requires True/False" & @CRLF) 23 | Case "Restore" 24 | _Restore() 25 | Case Else 26 | ConsoleWrite($CmdLine[1] & " is not a valid command." & @CRLF) 27 | EndSwitch 28 | Sleep(5000) 29 | Exit 0 30 | Case Else 31 | Switch $CmdLine[1] 32 | Case "OptimizeAll" 33 | If $CmdLine[0] < 3 Then 34 | ConsoleWrite("OptimizeAll Requires ProcessName.exe CoreToRunOn" & @CRLF) 35 | Sleep(1000) 36 | Exit 1 37 | ElseIf $CmdLine[0] > 4 Then 38 | ConsoleWrite("Too Many Parameters Passed" & @CRLF) 39 | Else 40 | Exit _OptimizeAll($CmdLine[2],Number($CmdLine[3])) 41 | EndIf 42 | Case "Optimize" 43 | If $CmdLine[0] < 3 Then 44 | ConsoleWrite("OptimizeAll Requires ProcessName.exe CoreToRunOn" & @CRLF) 45 | Sleep(1000) 46 | Exit 1 47 | ElseIf $CmdLine[0] > 3 Then 48 | ConsoleWrite("Too Many Parameters Passed" & @CRLF) 49 | Else 50 | Exit _Optimize($CmdLine[2],$CmdLine[3]) 51 | EndIf 52 | Case "ToggleHPET" 53 | If $CmdLine[0] < 2 Then 54 | ConsoleWrite("ToggleHPET Requires True/False" & @CRLF) 55 | Sleep(1000) 56 | Exit 1 57 | ElseIf $CmdLine[0] > 2 Then 58 | ConsoleWrite("Too Many Parameters Passed" & @CRLF) 59 | Else 60 | _ToggleHPET($CmdLine[2]) 61 | EndIf 62 | Case "StopServices" 63 | If $CmdLine[0] < 2 Then 64 | ConsoleWrite("StopServices Requires True/False" & @CRLF) 65 | Sleep(1000) 66 | Exit 1 67 | ElseIf $CmdLine[0] > 2 Then 68 | ConsoleWrite("Too Many Parameters Passed" & @CRLF) 69 | Else 70 | _StopServices($CmdLine[2]) 71 | EndIf 72 | Case "SetPowerPlan" 73 | If $CmdLine[0] < 2 Then 74 | ConsoleWrite("SetPowerPlan Requires True/False" & @CRLF) 75 | Sleep(1000) 76 | Exit 1 77 | ElseIf $CmdLine[0] > 2 Then 78 | ConsoleWrite("Too Many Parameters Passed" & @CRLF) 79 | Else 80 | _SetPowerPlan($CmdLine[2]) 81 | EndIf 82 | Case Else 83 | ConsoleWrite($CmdLine[1] & " is not a valid command." & @CRLF) 84 | Sleep(1000) 85 | Exit 1 86 | EndSwitch 87 | EndSwitch 88 | EndFunc -------------------------------------------------------------------------------- /Includes/_WMIC.au3: -------------------------------------------------------------------------------- 1 | #include-once 2 | 3 | #include 4 | 5 | Func _GetCPUInfo($iFlag = 0) 6 | Local Static $sCores 7 | Local Static $sThreads 8 | Local Static $sName 9 | 10 | If Not $sName <> "" Then 11 | Local $Obj_WMIService = ObjGet('winmgmts:\\' & @ComputerName & '\root\cimv2'); 12 | If (IsObj($Obj_WMIService)) And (Not @error) Then 13 | Local $Col_Items = $Obj_WMIService.ExecQuery('Select * from Win32_Processor') 14 | 15 | Local $Obj_Item 16 | For $Obj_Item In $Col_Items 17 | $sCores = $Obj_Item.NumberOfCores 18 | $sThreads = $Obj_Item.NumberOfLogicalProcessors 19 | $sName = $obj_Item.Name 20 | $sSocket = $Obj_Item.SocketDesignation 21 | Next 22 | Else 23 | Return 0 24 | EndIf 25 | EndIf 26 | Switch $iFlag 27 | Case 0 28 | Return String($sCores) 29 | Case 1 30 | Return String($sThreads) 31 | Case 2 32 | Return StringStripWS(String($sName), $STR_STRIPTRAILING) 33 | Case 3 34 | Return StringStripWS(String($sSocket), $STR_STRIPTRAILING) 35 | Case Else 36 | Return 0 37 | EndSwitch 38 | EndFunc 39 | 40 | Func _GetGPUInfo($iFlag = 0) 41 | Local Static $sName 42 | Local Static $sMemory 43 | 44 | If Not $sName <> "" Then 45 | Local $Obj_WMIService = ObjGet('winmgmts:\\' & @ComputerName & '\root\cimv2'); 46 | If (IsObj($Obj_WMIService)) And (Not @error) Then 47 | Local $Col_Items = $Obj_WMIService.ExecQuery('Select * from Win32_VideoController') 48 | 49 | Local $Obj_Item 50 | For $Obj_Item In $Col_Items 51 | $sName &= $Obj_Item.Name & @CRLF 52 | $sMemory = $obj_Item.AdapterRAM 53 | Next 54 | Else 55 | Return 0 56 | EndIf 57 | EndIf 58 | Switch $iFlag 59 | Case 0 60 | Return StringTrimRight(String($sName), 2) 61 | Case 1 62 | Return StringStripWS(String($sMemory), $STR_STRIPTRAILING) 63 | Case Else 64 | Return 0 65 | EndSwitch 66 | EndFunc 67 | 68 | Func _GetMotherboardInfo($iFlag = 0) 69 | Local Static $sProduct 70 | Local Static $sManufacturer 71 | 72 | If Not $sProduct <> "" Then 73 | Local $Obj_WMIService = ObjGet('winmgmts:\\' & @ComputerName & '\root\cimv2'); 74 | If (IsObj($Obj_WMIService)) And (Not @error) Then 75 | Local $Col_Items = $Obj_WMIService.ExecQuery('Select * from Win32_BaseBoard') 76 | 77 | Local $Obj_Item 78 | For $Obj_Item In $Col_Items 79 | $sProduct = $Obj_Item.Product 80 | $sManufacturer = $Obj_Item.Manufacturer 81 | Next 82 | Else 83 | Return 0 84 | EndIf 85 | EndIf 86 | Switch $iFlag 87 | Case 0 88 | Return StringStripWS(String($sManufacturer), $STR_STRIPTRAILING) 89 | Case 1 90 | Return StringStripWS(String($sProduct), $STR_STRIPTRAILING) 91 | Case Else 92 | Return 0 93 | EndSwitch 94 | EndFunc 95 | 96 | Func _GetOSInfo($iFlag = 0) 97 | Local Static $sArch 98 | Local Static $sName 99 | Local Static $sLocale 100 | 101 | If Not $sArch <> "" Then 102 | Local $Obj_WMIService = ObjGet('winmgmts:\\' & @ComputerName & '\root\cimv2'); 103 | If (IsObj($Obj_WMIService)) And (Not @error) Then 104 | Local $Col_Items = $Obj_WMIService.ExecQuery('Select * from Win32_OperatingSystem') 105 | 106 | Local $Obj_Item 107 | For $Obj_Item In $Col_Items 108 | $sArch = $Obj_Item.OSArchitecture 109 | $sName = $Obj_Item.Name 110 | $sLocale = $Obj_Item.Locale 111 | Next 112 | Else 113 | Return 0 114 | EndIf 115 | EndIf 116 | Switch $iFlag 117 | Case 0 118 | Return String(StringSplit($sName, "|", $STR_NOCOUNT)[0]) 119 | Case 1 120 | Return String($sArch) 121 | Case 2 122 | Return String($sLocale) 123 | Case Else 124 | Return 0 125 | EndSwitch 126 | EndFunc 127 | 128 | Func _GetRAMInfo($iFlag = 0) 129 | Local Static $sSpeed 130 | 131 | If Not $sSpeed <> "" Then 132 | Local $Obj_WMIService = ObjGet('winmgmts:\\' & @ComputerName & '\root\cimv2'); 133 | If (IsObj($Obj_WMIService)) And (Not @error) Then 134 | Local $Col_Items = $Obj_WMIService.ExecQuery('Select * from Win32_PhysicalMemory') 135 | 136 | Local $Obj_Item 137 | For $Obj_Item In $Col_Items 138 | $sSpeed = $Obj_Item.Speed 139 | Next 140 | Else 141 | Return 0 142 | EndIf 143 | EndIf 144 | Switch $iFlag 145 | Case 0 146 | Return String($sSpeed) 147 | Case Else 148 | Return 0 149 | EndSwitch 150 | EndFunc 151 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ### GNU LESSER GENERAL PUBLIC LICENSE 2 | 3 | Version 3, 29 June 2007 4 | 5 | Copyright (C) 2007 Free Software Foundation, Inc. 6 | 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this 9 | license document, but changing it is not allowed. 10 | 11 | This version of the GNU Lesser General Public License incorporates the 12 | terms and conditions of version 3 of the GNU General Public License, 13 | supplemented by the additional permissions listed below. 14 | 15 | #### 0. Additional Definitions. 16 | 17 | As used herein, "this License" refers to version 3 of the GNU Lesser 18 | General Public License, and the "GNU GPL" refers to version 3 of the 19 | GNU General Public License. 20 | 21 | "The Library" refers to a covered work governed by this License, other 22 | than an Application or a Combined Work as defined below. 23 | 24 | An "Application" is any work that makes use of an interface provided 25 | by the Library, but which is not otherwise based on the Library. 26 | Defining a subclass of a class defined by the Library is deemed a mode 27 | of using an interface provided by the Library. 28 | 29 | A "Combined Work" is a work produced by combining or linking an 30 | Application with the Library. The particular version of the Library 31 | with which the Combined Work was made is also called the "Linked 32 | Version". 33 | 34 | The "Minimal Corresponding Source" for a Combined Work means the 35 | Corresponding Source for the Combined Work, excluding any source code 36 | for portions of the Combined Work that, considered in isolation, are 37 | based on the Application, and not on the Linked Version. 38 | 39 | The "Corresponding Application Code" for a Combined Work means the 40 | object code and/or source code for the Application, including any data 41 | and utility programs needed for reproducing the Combined Work from the 42 | Application, but excluding the System Libraries of the Combined Work. 43 | 44 | #### 1. Exception to Section 3 of the GNU GPL. 45 | 46 | You may convey a covered work under sections 3 and 4 of this License 47 | without being bound by section 3 of the GNU GPL. 48 | 49 | #### 2. Conveying Modified Versions. 50 | 51 | If you modify a copy of the Library, and, in your modifications, a 52 | facility refers to a function or data to be supplied by an Application 53 | that uses the facility (other than as an argument passed when the 54 | facility is invoked), then you may convey a copy of the modified 55 | version: 56 | 57 | - a) under this License, provided that you make a good faith effort 58 | to ensure that, in the event an Application does not supply the 59 | function or data, the facility still operates, and performs 60 | whatever part of its purpose remains meaningful, or 61 | - b) under the GNU GPL, with none of the additional permissions of 62 | this License applicable to that copy. 63 | 64 | #### 3. Object Code Incorporating Material from Library Header Files. 65 | 66 | The object code form of an Application may incorporate material from a 67 | header file that is part of the Library. You may convey such object 68 | code under terms of your choice, provided that, if the incorporated 69 | material is not limited to numerical parameters, data structure 70 | layouts and accessors, or small macros, inline functions and templates 71 | (ten or fewer lines in length), you do both of the following: 72 | 73 | - a) Give prominent notice with each copy of the object code that 74 | the Library is used in it and that the Library and its use are 75 | covered by this License. 76 | - b) Accompany the object code with a copy of the GNU GPL and this 77 | license document. 78 | 79 | #### 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, taken 82 | together, effectively do not restrict modification of the portions of 83 | the Library contained in the Combined Work and reverse engineering for 84 | debugging such modifications, if you also do each of the following: 85 | 86 | - a) Give prominent notice with each copy of the Combined Work that 87 | the Library is used in it and that the Library and its use are 88 | covered by this License. 89 | - b) Accompany the Combined Work with a copy of the GNU GPL and this 90 | license document. 91 | - c) For a Combined Work that displays copyright notices during 92 | execution, include the copyright notice for the Library among 93 | these notices, as well as a reference directing the user to the 94 | copies of the GNU GPL and this license document. 95 | - d) Do one of the following: 96 | - 0) Convey the Minimal Corresponding Source under the terms of 97 | this License, and the Corresponding Application Code in a form 98 | suitable for, and under terms that permit, the user to 99 | recombine or relink the Application with a modified version of 100 | the Linked Version to produce a modified Combined Work, in the 101 | manner specified by section 6 of the GNU GPL for conveying 102 | Corresponding Source. 103 | - 1) Use a suitable shared library mechanism for linking with 104 | the Library. A suitable mechanism is one that (a) uses at run 105 | time a copy of the Library already present on the user's 106 | computer system, and (b) will operate properly with a modified 107 | version of the Library that is interface-compatible with the 108 | Linked Version. 109 | - e) Provide Installation Information, but only if you would 110 | otherwise be required to provide such information under section 6 111 | of the GNU GPL, and only to the extent that such information is 112 | necessary to install and execute a modified version of the 113 | Combined Work produced by recombining or relinking the Application 114 | with a modified version of the Linked Version. (If you use option 115 | 4d0, the Installation Information must accompany the Minimal 116 | Corresponding Source and Corresponding Application Code. If you 117 | use option 4d1, you must provide the Installation Information in 118 | the manner specified by section 6 of the GNU GPL for conveying 119 | Corresponding Source.) 120 | 121 | #### 5. Combined Libraries. 122 | 123 | You may place library facilities that are a work based on the Library 124 | side by side in a single library together with other library 125 | facilities that are not Applications and are not covered by this 126 | License, and convey such a combined library under terms of your 127 | choice, if you do both of the following: 128 | 129 | - a) Accompany the combined library with a copy of the same work 130 | based on the Library, uncombined with any other library 131 | facilities, conveyed under the terms of this License. 132 | - b) Give prominent notice with the combined library that part of it 133 | is a work based on the Library, and explaining where to find the 134 | accompanying uncombined form of the same work. 135 | 136 | #### 6. Revised Versions of the GNU Lesser General Public License. 137 | 138 | The Free Software Foundation may publish revised and/or new versions 139 | of the GNU Lesser General Public License from time to time. Such new 140 | versions will be similar in spirit to the present version, but may 141 | differ in detail to address new problems or concerns. 142 | 143 | Each version is given a distinguishing version number. If the Library 144 | as you received it specifies that a certain numbered version of the 145 | GNU Lesser General Public License "or any later version" applies to 146 | it, you have the option of following the terms and conditions either 147 | of that published version or of any later version published by the 148 | Free Software Foundation. If the Library as you received it does not 149 | specify a version number of the GNU Lesser General Public License, you 150 | may choose any version of the GNU Lesser General Public License ever 151 | published by the Free Software Foundation. 152 | 153 | If the Library as you received it specifies that a proxy can decide 154 | whether future versions of the GNU Lesser General Public License shall 155 | apply, that proxy's public statement of acceptance of any version is 156 | permanent authorization for you to choose that version for the 157 | Library. 158 | -------------------------------------------------------------------------------- /Lang/07.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcmaehl/NotCPUCores/eb1a360973f0a5584f519a410d061e36f55a19af/Lang/07.ini -------------------------------------------------------------------------------- /Lang/09.ini: -------------------------------------------------------------------------------- 1 | [File] 2 | Version=1.7.2.2 3 | Language=English 4 | Translator=Robert Maehl 5 | 6 | [Global Tips] 7 | Example=Example 8 | Usage=Usage 9 | Done=Done 10 | 11 | [Global UI] 12 | Include Children=Include Children 13 | Allocation Mode=Allocation Mode 14 | Custom Assignment=Custom Assignment 15 | 16 | [File Menu] 17 | File Menu=File 18 | Load Option=Load Profile 19 | Save Option=Save Profile 20 | Quit Option=Quit 21 | 22 | [Options Menu] 23 | Options Menu=Options 24 | Language Menu=Language 25 | Current Language=Current 26 | Load Language=Load Language File 27 | Sleep Menu=Sleep Timer 28 | Current Sleep=Current Timer 29 | Set Sleep=Set Sleep Timer 30 | Set Library=Set Steam Library 31 | Remove Library=Remove Steam Library 32 | 33 | [Help Menu] 34 | Help Menu=Help 35 | Website Option=Website 36 | Discord Option=Discord 37 | How To Option=How It Works 38 | Donate Option=Buy me a drink? 39 | Update Option=Check for Updates 40 | 41 | [Processes] 42 | Running Tab=Running 43 | Process List=Window Process 44 | Process Title=Window Title 45 | Excluded Tab=Excluded 46 | 47 | [Steam Games] 48 | Games Tab=Steam Games 49 | Game Name=Game Name 50 | Game ID=Game ID 51 | 52 | [SleepUI] 53 | Set Sleep Text=Decreasing this value can smooth FPS drops when new programs start, at the risk of NotCPUCores having more CPU usage itself 54 | New Sleep Text=New Sleep Timer 55 | 56 | [Files] 57 | Load Profile=Load Saved Settings 58 | Save Profile=Save Current Settings 59 | Load Language=Load Language File 60 | 61 | [Console] 62 | Debug Started=Debug Console Initialized 63 | Interrupted=Exiting Optimizations via Interrupt... 64 | 65 | [Simple Tips] 66 | Debug Tip=Toggle Debug Mode 67 | Refresh Tip=F5 or Sort to Refresh 68 | Process Tip=Enter the name of the process(es) here 69 | Import Tip=Import Selected Process from Process List 70 | Children Tip=Include other Processes started by this Program 71 | 72 | [MultiTips] 73 | Assign Line 1=To run on a Single Core, enter the number of that core. 74 | Assign Line 2=To run on Multiple Cores, separate them with commas. 75 | Assign Line 3=Ranges separated by a dash are supported. 76 | Assign Line 4=Maximum Cores 77 | 78 | [Play] 79 | Work/Play Tab=Work/Play 80 | Work/Play Text=Game/App Settings 81 | Process Select=Process 82 | Priority Select=Process Priority 83 | Optimize Text=ASSIGN 84 | Optimize Alt Text=Pause/Break to Stop 85 | Restore Text=RESET AFFINITIES 86 | Restore Alt Text=Restoring PC... 87 | 88 | [Stream] 89 | Stream Tab=Stream 90 | Stream Text=Streaming Settings 91 | Stream Software=Broadcast Software 92 | Other Processes=Assign Other Processes 93 | 94 | [Tools] 95 | Tools Tab=Tools 96 | Games Section=Gaming 97 | Game Mode= Game\n Mode 98 | Hardware Accel= HAGS 99 | HPET Tool= HPET 100 | Disk Section=Disk Health 101 | Disk Defrag=Disk\nDefrag 102 | Disk Check= Disk\n Check 103 | Disk Cleanup=Disk\nCleanup 104 | Storage Sense=Storage\nSense 105 | Reliability Section=System Info 106 | Recent Events= Recent\n Events 107 | Action Center= Action\n Center 108 | Power Options=Power\nOptions 109 | 110 | [Specs] 111 | Specs Tab=Specs 112 | OS Section=Operating System 113 | OS=OS 114 | Lanugage=Language 115 | Hardware Section=Hardware 116 | Motherboard=Motherboard 117 | CPU=CPU 118 | RAM=RAM 119 | GPU=GPU(s) 120 | 121 | [About] 122 | About Tab=About 123 | License=License 124 | Developer=Developed by 125 | Icon by=Icon by 126 | Translation by=Translation by 127 | 128 | [Dropdowns] 129 | Disabled=Disabled 130 | All Cores=All Cores 131 | First Core=First Core 132 | First Two Cores=First 2 Cores 133 | First Four Cores=First 4 Cores 134 | First Half=First Half 135 | First AMD CCX=First AMD CCX 136 | Even Cores=Even Cores 137 | Physical Cores=Physical Cores 138 | Odd Cores=Odd Cores 139 | Non-Physical Cores=Non-Physical Cores 140 | Last Core=Last Core 141 | Last Two Cores=Last 2 Cores 142 | Last Four Cores=Last 4 Cores 143 | Last Half=Last Half 144 | Last AMD CCX=Last AMD CCX 145 | Pairs=Every Other Pair 146 | Custom=Custom 147 | Broadcaster Cores=Broadcaster Cores 148 | Process Cores=Game/App Cores 149 | Remaining Cores=Remaining Cores 150 | Low Priority=Low 151 | Below Normal Priority=Below Normal 152 | Normal Priority=Normal 153 | Above Normal Priority=Above Normal 154 | High Priority=High 155 | Realtime Priority=Realtime 156 | 157 | [Running] 158 | Optimizing=optimizing in the background until all close... 159 | Reoptimizing=Process Count Changed, Optimization Reran 160 | Performance Mode=All Cores used for Assignment, Max Performance will be prioritized over Consistent Performance 161 | Restoring State=Exited. Restoring Previous State... 162 | 163 | [Updater] 164 | Too New=You're running a newer version than publicly available on Github 165 | No Updates=Your NotCPUCores version is up to date 166 | New Version=An update is available, opening download page 167 | 168 | [Console] 169 | HPET Change=HPET State Changed, Please Reboot to Apply Changes 170 | 171 | [Errors] 172 | Already Running Title=Already Running 173 | Already Running Message=NotCPUCores is already running. To prevent conflicts, this instance will now exit 174 | Incompatible Title=Incompatible Program 175 | Incompatible Message=is currently running. To prevent conflicts, NotCPUCores will now exit 176 | Broadcaster=Invalid Broadcaster Software! 177 | Broadcast Assignment=Invalid Broadcaster Assignment Mode! 178 | Process Assignment=Invalid App/Game Assigment Mode! 179 | Other Process Assignment=Invalid Other Process Assigment Mode! 180 | Priority Assignment=Invalid Priority Mode! 181 | Not Running=not currently running. Please run the program(s) first 182 | All Cores Used=No Cores Left for Other Processes, defaulting to last core 183 | Too Many Cores=You've specified more cores than available on your system 184 | Too Many Total Cores=You've specified more cores between App/Game and Broadcaster than available on your system 185 | Steam Not Running=Can't launch Steam Games if Steam isn't running. Please launch Steam, wait, and try again 186 | Update Check Fail=Unable to load Github API to check for updates. Are you connected to the internet? 187 | Update Data Fail=Data returned for Update Check was invalid or blocked. Please check your internet and retry 188 | Update Tags Fail=Data for available updates was missing or incomplete. Please try again later 189 | Update Type Fail=Data for available update types was missing or incomplete. Please try again later 190 | -------------------------------------------------------------------------------- /Lang/0A.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcmaehl/NotCPUCores/eb1a360973f0a5584f519a410d061e36f55a19af/Lang/0A.ini -------------------------------------------------------------------------------- /Lang/15.ini: -------------------------------------------------------------------------------- 1 | [File] 2 | Version=1.7.2.2 3 | Language=Polski 4 | Translator=micwoj92 5 | 6 | [Global Tips] 7 | Example=Przykład 8 | Usage=Użycie 9 | Done=Gotowe 10 | 11 | [Global UI] 12 | Include Children=Uwzględnij procesy pochodne 13 | Allocation Mode=Tryb koligacji 14 | Custom Assignment=Niestandardowe przypisanie 15 | 16 | [File Menu] 17 | File Menu=Plik 18 | Load Option=Załaduj profil 19 | Save Option=Zapisz profil 20 | Quit Option=Wyjdź 21 | 22 | [Options Menu] 23 | Options Menu=Opcje 24 | Language Menu=Język 25 | Current Language=Obecny 26 | Load Language=Załaduj plik z językiem 27 | Sleep Menu=Czasomierz uśpienia 28 | Current Sleep=Obecny czas 29 | Set Sleep=Ustaw czasomierz uśpienia 30 | Set Library=Ustaw bibliotekę Steam 31 | Remove Library=Usuń bibliotekę Steam 32 | 33 | [Help Menu] 34 | Help Menu=Pomoc 35 | Website Option=Strona internetowa 36 | Discord Option=Discord 37 | How To Option=Jak to działa 38 | Donate Option=Postaw mi drina? 39 | Update Option=Sprawdź aktualizacje 40 | 41 | [Processes] 42 | Running Tab=Uruchomione 43 | Process List=Nazwa procesu 44 | Process Title=Opis 45 | Excluded Tab=Wykluczone 46 | 47 | [Steam Games] 48 | Games Tab=Gry Steam 49 | Game Name=Nazwa gry 50 | Game ID=ID gry 51 | 52 | [SleepUI] 53 | Set Sleep Text=Zmniejszenie tej wartości może zmniejszyć spadki klatek, kiedy nowy program jest uruchamiany. Istnieje ryzyko, że NotCPUCores będzie zużywał więcej procesora. 54 | New Sleep Text=Nowy czas 55 | 56 | [Files] 57 | Load Profile=Załaduj zapisane ustawienia 58 | Save Profile=Zapisz obecne ustawienia 59 | Load Language=Załaduj plik z językiem 60 | 61 | [Console] 62 | Debug Started=Konsola debugowania zainicjowana 63 | Interrupted=Kończenie optymalizacji poprzez przerwanie ... 64 | 65 | [Simple Tips] 66 | Debug Tip=Przełącz tryb debugowania 67 | Refresh Tip=F5 albo sortuj aby odświeżyć 68 | Process Tip=Tutaj wpisz nazwę procesu 69 | Import Tip=Importuj wybrany proces z listy procesów 70 | Children Tip=Uwzględniaj procesy pochodne tego programu 71 | 72 | [MultiTips] 73 | Assign Line 1=Aby uruchomić na jednym rdzeniu, wpisz numer tego rdzenia. 74 | Assign Line 2=Aby uruchomić na wielu rdzeniach, oddziel numery przecinkami. 75 | Assign Line 3=Zakresy oddzielone myślnikami są wspierane. 76 | Assign Line 4=Maksymalna ilość rdzeni 77 | 78 | [Play] 79 | Work/Play Tab=Pracuj/Graj 80 | Work/Play Text=Ustawienia gier i aplikacji 81 | Process Select=Proces 82 | Priority Select=Priorytet 83 | Optimize Text=PRZYDZIEL 84 | Optimize Alt Text=Pause/Break aby wstrzymać 85 | Restore Text=RESETUJ PRZYDZIAŁ 86 | Restore Alt Text=Przywracanie komputera... 87 | 88 | [Stream] 89 | Stream Tab=Strumieniowanie 90 | Stream Text=Ustawienia strumieniowania 91 | Stream Software=Oprogramowanie do strumieniowania 92 | Other Processes=Przypisz inne procesy 93 | 94 | [Tools] 95 | Tools Tab=Narzędzia 96 | Games Section=Granie 97 | Game Mode= Tryb\n gry 98 | Hardware Accel= HAGS 99 | HPET Tool= HPET 100 | Disk Section=Dyski 101 | Disk Defrag=Defrag-\n mentuj 102 | Disk Check= Sprawdź\n spójność 103 | Disk Cleanup=Oczysz-\n czanie 104 | Storage Sense=Storage\nSense 105 | Reliability Section=Informacje 106 | Recent Events= Ostatnie\n zdarzenia 107 | Action Center= Centrum\n akcji 108 | Power Options=Opcje\n zasilania 109 | 110 | [Specs] 111 | Specs Tab=Specyfikacje 112 | OS Section=System operacyjny 113 | OS=Wersja 114 | Lanugage=Język 115 | Hardware Section=Podzespoły 116 | Motherboard=Płyta główna 117 | CPU=Procesor 118 | RAM=Pamięć RAM 119 | GPU=Karta graficzna 120 | 121 | [About] 122 | About Tab=O 123 | License=Licencja 124 | Developer=Deweloper: 125 | Icon by=Ikona: 126 | Translation by=Tłumaczenie: 127 | 128 | [Dropdowns] 129 | Disabled=Wyłączone 130 | All Cores=Wszystkie rdzenie 131 | First Core=Pierwszy rdzeń 132 | First Two Cores=Pierwsze dwa rdzenie 133 | First Four Cores=Pierwsze cztery rdzenie 134 | First Half=Pierwsza połowa 135 | First AMD CCX=Pierwsze AMD CCX 136 | Even Cores=Parzyste rdzenie 137 | Physical Cores=Fizyczne rdzenie 138 | Odd Cores=Nieparzyste rdzenie 139 | Non-Physical Cores=Niefizyczne rdzenie 140 | Last Core=Ostatni rdzeń 141 | Last Two Cores=Ostatnie dwa rdzenie 142 | Last Four Cores=Ostatnie cztery rdzenie 143 | Last Half=Ostatnie połowa 144 | Last AMD CCX=Ostatnie AMD CCX 145 | Pairs=Co druga para 146 | Custom=Niestandardowe 147 | Broadcaster Cores=Rdzenie transmisji 148 | Process Cores=Rdzenie gry/aplikacji 149 | Remaining Cores=Pozostałe rdzenie 150 | Low Priority=Niski 151 | Below Normal Priority=Poniżej normalnego 152 | Normal Priority=Normalny 153 | Above Normal Priority=Powyżej normalnego 154 | High Priority=Wysoki 155 | Realtime Priority=Czasu rzeczywistego 156 | 157 | [Running] 158 | Optimizing=Optymizacja w tle dopóki nie zostaną wyłączone 159 | Reoptimizing=Zmieniono liczbę procesów, optymalizacja ponowiona 160 | Performance Mode=Wszystkie rdzenie przypisane, maksymalna wydajność będzie priorytetowa nad stałą wydajnością. 161 | Restoring State=Opuszczanie. Przywracanie poprzedniego stanu... 162 | 163 | [Updater] 164 | Too New=Używasz wersji nowszej niż publicznie dostępna na GitHubie. 165 | No Updates=Twoja wersja NotCPUCores jest aktualna. 166 | New Version=Aktualizacja dostępna, otwieranie strony pobierania. 167 | 168 | [Console] 169 | HPET Change=Zmieniono stan HPET, proszę uruchomić ponownie aby zapisać zmiany. 170 | 171 | [Errors] 172 | Already Running Title=Już uruchomione. 173 | Already Running Message=NotCPUCores już jest uruchomione. Aby zapobiegnąć konfliktom, ta instancja teraz się wyłączy. 174 | Incompatible Title=Niekompatybilny program 175 | Incompatible Message=już jest uruchomiony. Aby zapobiegnąć konfliktom, NotCPUCores teraz się wyłączy. 176 | Broadcaster=Nieprawidłowe oprogramowanie transmisyjne! 177 | Broadcast Assignment=Nieprawidłowy tryb przydziału nadawcy! 178 | Process Assignment=Nieprawidłowy tryb przydziału gry/aplikacji! 179 | Other Process Assignment=Nieprawidłowy tryb przydziału innego procesu! 180 | Priority Assignment=Nieprawidłowy tryb priorytetu! 181 | Not Running=nie jest włączony. Proszę, najpierw uruchom programy. 182 | All Cores Used=Brak dostępnych rdzeni dla innych procesów, domyślna zmiana na ostatni rdzeń. 183 | Too Many Cores=Podałeś więcej rdzeni niż ilość dostępna w Twoim systemie. 184 | Too Many Total Cores=Podałeś więcej rdzeni do aplikacji/gry oraz programu nadawania, niż ilość dostępna w Twoim systemie. 185 | Steam Not Running=Nie można uruchomić gier Steam jeśli Steam nie jest włączony. Proszę uruchomić Steama, poczekać i spróbować ponownie. 186 | Update Check Fail=Nie można załadować API GitHuba aby sprawdzić aktualizacje. Czy jesteś połączony z internetem? 187 | Update Data Fail=Dane zwrócone przez sprawdzenie aktualizacji są błędne lub zablokowane. Proszę sprawdź swoje połączenie i spróbuj ponownie. 188 | Update Tags Fail=Brak danych dostępnych aktualizacji lub są one niekompletne. Proszę spróbować ponownie później. 189 | Update Type Fail=Brak danych dostępnych typów aktualizacji lub są one niekompletne. Proszę spróbować ponownie później. 190 | -------------------------------------------------------------------------------- /Lang/19.ini: -------------------------------------------------------------------------------- 1 | [File] 2 | Version=1.7.3.0 3 | Language=Русский 4 | Translator=EDISLEV 5 | 6 | [Font] 7 | Size=8.5 8 | Weight=400 9 | Name="" 10 | 11 | [Global Tips] 12 | Example=Пример 13 | Usage=Использование 14 | Done=Готово 15 | 16 | [Global UI] 17 | Include Children=Включая дочерние 18 | Allocation Mode=Режим распределения 19 | Custom Assignment=Свой режим 20 | 21 | [File Menu] 22 | File Menu=Файл 23 | Load Option=Открыть 24 | Save Option=Сохранить 25 | Quit Option=Выход 26 | 27 | [Options Menu] 28 | Options Menu=Параметры 29 | Language Menu=Язык 30 | Current Language=Текущий 31 | Load Language=Загрузить язык 32 | Sleep Menu=Таймер сна 33 | Current Sleep=Текущий таймер 34 | Set Sleep=Установить таймер сна 35 | Set Library=Настроить библиотеку Steam 36 | Remove Library=Удалить библиотеку Steam 37 | 38 | [Help Menu] 39 | Help Menu=Помощь 40 | Website Option=Сайт 41 | Discord Option=Discord 42 | How To Option=Как это работает 43 | Donate Option=Купить мне выпить? 44 | Update Option=Проверить обновления 45 | 46 | [Processes] 47 | Running Tab=Работающие 48 | Process List=Процесс 49 | Process Title=Название 50 | Excluded Tab=Исключенные 51 | 52 | [Steam Games] 53 | Games Tab=Игры Steam 54 | Game Name=Название 55 | Game ID=ID игры 56 | 57 | [SleepUI] 58 | Set Sleep Text=Уменьшение этого значения может сгладить падение FPS, когда новые программы стартуют, из-за того, что NotCPUCores чрезмерно использует ЦП 59 | New Sleep Text=Новый таймер сна 60 | 61 | [Files] 62 | Load Profile=Открыть сохраненные настройки 63 | Save Profile=Сохранить текущие настройки 64 | Load Language=Открыть языковой пакет 65 | 66 | [Console] 67 | Debug Started=Отладка началась 68 | Interrupted=Закрытие оптимизации через прерывание... 69 | 70 | [Simple Tips] 71 | Debug Tip=Режим отладки 72 | Refresh Tip=F5 или Сортировка, чтобы обновить 73 | Process Tip=Введите имя процесса(-ов) 74 | Import Tip=Импорт выбранного процесса из списка 75 | Children Tip=Включать для всех процессов запущенных этой программой 76 | 77 | [MultiTips] 78 | Assign Line 1=Для работы на одном ядре введите номер этого ядра. 79 | Assign Line 2=Для работы на нескольких ядрах разделяйте запятыми. 80 | Assign Line 3=Диапазон делится дефисом. 81 | Assign Line 4=Максимум ядер. 82 | 83 | [Play] 84 | Work/Play Tab=Работа/Игры 85 | Work/Play Text=Настройка Игр/Приложений 86 | Process Select=Процесс 87 | Priority Select=Приоритет процессов 88 | Optimize Text=ОПТИМИЗИРОВАТЬ 89 | Optimize Alt Text=Pause/Break to Stop 90 | Restore Text=ВОССТАНОВИТЬ 91 | Restore Alt Text=Восстанавливаю... 92 | 93 | [Stream] 94 | Stream Tab=Stream 95 | Stream Text=Настройки Stream 96 | Stream Software=Стриминговое ПО 97 | Other Processes=Назначить процесс 98 | 99 | [Tools] 100 | Tools Tab=Инструменты 101 | Games Section=Игры 102 | Game Mode= Игровой\nрежим 103 | Hardware Accel= HAGS 104 | HPET Tool= HPET 105 | Disk Section=Диск 106 | Disk Defrag=Дефраг\n-ментация 107 | Disk Check= Проверка 108 | Disk Cleanup=Чистка 109 | Storage Sense=Контроль\nПамяти 110 | Reliability Section=Система 111 | Recent Events= Последние\nсобытия 112 | Action Center= Центр\n Событий 113 | Power Options=Питание 114 | 115 | [Specs] 116 | Specs Tab=Характеристики 117 | OS Section=Операционная система 118 | OS=ОС 119 | Lanugage=Язык 120 | Hardware Section=Железо 121 | Motherboard=Плата 122 | CPU=ЦП 123 | RAM=ОЗУ 124 | GPU=Графика 125 | 126 | [About] 127 | About Tab=О программе 128 | License=Лицензия 129 | Developer=Разработано 130 | Icon by=Значок 131 | Translation by=Перевод 132 | 133 | [Dropdowns] 134 | Disabled=Отключено 135 | All Cores=Все ядра 136 | First Core=Первое ядро 137 | First Two Cores=Первые 2 ядра 138 | First Four Cores=Первые 4 ядра 139 | First Half=Первая половина 140 | First AMD CCX=Первый AMD CCX 141 | Even Cores=Четные ядра 142 | Physical Cores=Физические Ядра 143 | Odd Cores=Нечетные ядра 144 | Non-Physical Cores=Не физические Ядра 145 | Last Core=Последнее ядро 146 | Last Two Cores=Последние 2 ядра 147 | Last Four Cores=Последние 4 ядра 148 | Last Half=Последняя половина 149 | Last AMD CCX=Последний AMD CCX 150 | Pairs=Каждая другая пара 151 | Custom=Свой режим 152 | Broadcaster Cores=Стриминговые ядра 153 | Process Cores=Ядра игр/приложений 154 | Remaining Cores=Оставшиеся ядра 155 | Low Priority=Низкий 156 | Below Normal Priority=Ниже среднего 157 | Normal Priority=Средний 158 | Above Normal Priority=Выше среднего 159 | High Priority=Высокий 160 | Realtime Priority=Реального времени 161 | 162 | [Running] 163 | Optimizing=Фоновая оптимизация до закрытия... 164 | Reoptimizing=Перезапуск оптимизации 165 | Performance Mode=Режим максимальной производительности 166 | Restoring State=Восстановление исходного состояния... 167 | 168 | [Updater] 169 | Too New=Эта версия новее публично доступной на Github 170 | No Updates=Актуальная версия 171 | New Version=Доступно обновление! 172 | 173 | [Console] 174 | HPET Change=Состояние HPET изменено, перезагрузите применения 175 | 176 | [Errors] 177 | Already Running Title=Уже запущенно 178 | Already Running Message=NotCPUCores уже работает!!! 179 | Incompatible Title=Несовместимая программа 180 | Incompatible Message=Для защиты NotCPUCores сейчас закроется 181 | Broadcaster=Некорректное стриминговое ПО! 182 | Broadcast Assignment=Некорректный режим стримингового ПО! 183 | Process Assignment=Некорректный режим игр/приложений! 184 | Other Process Assignment=Некорректный режим других процессов! 185 | Priority Assignment=Некорректный приоритет! 186 | Not Running=Сначала запустите процесс(ы) 187 | All Cores Used=Нет доступных ядер, назначено последнее 188 | Too Many Cores=Выбрано ядер больше чем доступно! 189 | Too Many Total Cores=Выбрано между играми/приложениями и стриминговым ПО ядер больше чем доступно! 190 | Steam Not Running=Запустите Steam сначала! 191 | Update Check Fail=Не удалось загрузить Github API для проверки обновлений. Интернет работает? 192 | Update Data Fail=Полученная информация об обновлении повреждена или заблокирована. Проверьте интернет и повторите 193 | Update Tags Fail=Полученная информация об обновлениях отсутствует или неполная. Попробуйте позже 194 | Update Type Fail=Полученная информация о типе обновления отсутствует или неполная. Попробуйте позже 195 | -------------------------------------------------------------------------------- /Lang/Languages.md: -------------------------------------------------------------------------------- 1 | Code|Language 2 | ------|----------- 3 | 07|German 4 | 09|English 5 | 0A|Spanish 6 | 0B|Finnish 7 | 0C|French 8 | 10|Italian 9 | 13|Dutch 10 | 14|Norwegian 11 | 15|Polish 12 | 16|Portuguese 13 | 19|Russian 14 | 1D|Swedish 15 | -------------------------------------------------------------------------------- /Lang/Old/1.7.0.0/04.ini: -------------------------------------------------------------------------------- 1 | [File] 2 | Version=1.7.0.0 3 | Langauge=Chinese(Simplified) 4 | Translator=李昌华 5 | 6 | [Global] 7 | Example=示例 8 | Usage=使用 9 | Done=完成 10 | 11 | [Global UI] 12 | Include Children=包括子项 13 | Allocation Mode=分配模式 14 | Custom Assignment=自定义分配 15 | 16 | [File Menu] 17 | File Menu=文件 18 | Load Option=加载配置选项 19 | Save Option=保存配置选项 20 | Quit Option=退出 21 | 22 | [Options Menu] 23 | Options Menu=选项 24 | Language Menu=语言 25 | Current Language=当前 26 | Load Language=加载语言文件 27 | Sleep Menu=睡眠定时器 28 | Current Sleep=当前定时器 29 | Set Sleep=设置睡眠定时器 30 | 31 | [Help Menu] 32 | Help Menu=帮助 33 | Website Option=网站 34 | HowTo Option=如何工作 35 | Update Option=检查更新 36 | 37 | [Running] 38 | Running Tab=正在运行 39 | Process List=Window 进程 40 | Process Title=Window 标题 41 | Optimizing=正在后台优化,等待结束… 42 | Reoptimizing=进程计数已更改,优化重新运行 43 | Performance Mode==用于分配的所有核心,最高性能将优先于一致性能 44 | RestoringState=退出。恢复之前的状态...... 45 | 46 | [Steam Games] 47 | Games Tab=Steam 游戏 (BETA) 48 | Game Name=游戏名称 49 | Game ID=游戏 ID 50 | 51 | [SleepUI] 52 | Set Sleep Text=减少此值可以在新程序启动时平滑FPS丢失,NotCPUCores本身拥有更多CPU使用率的风险 53 | 54 | [Files] 55 | Load Profile=加载已保存的设置 56 | Save Profile=保存当前设置 57 | Load Language=加载语言文件 58 | 59 | [Console] 60 | Debug Started=调试控制台已初始化 61 | Interrupted=正在中断并退出优化… 62 | 63 | [Simple Tips] 64 | Debug Tip=切换调试模式 65 | Refresh Tip=F5 或 排序 来刷新 66 | Process Tip=在此处输入进程名称 67 | Import Tip=从进程列表导入所选进程 68 | Children Tip=包括此程序启动的其他进程 69 | 70 | [MultiTips] 71 | Assign Line 1=要在单个核心上运行,请输入该核心的编号。 72 | Assign Line 2=要在多个核心上运行,请用逗号 , 分隔它们。 73 | Assign Line 3=支持用破折号 - 分隔的范围。 74 | Assign Line 4=最大核心 75 | 76 | [Play] 77 | Work/Play Tab=工作/娱乐 78 | Work/Play Text=游戏/应用设置 79 | Process Select=进程 80 | Priority Select=进程优先级 81 | Optimize Text=优化 82 | Optimize Alt Text=暂停/中断后停止 83 | Restore Text=停止 84 | Restore Alt Text=恢复PC.… 85 | 86 | [Stream] 87 | Stream Tab=视频流 88 | Stream Text=视频流设置 89 | Stream Software=推流软件 90 | Other Processes=分配其他进程 91 | 92 | [Tools] 93 | Tools Tab=工 具 94 | Games Section=游戏性能 95 | HPET Tool= HPET 96 | Game Mode= 游戏\n模式 97 | Power Options=电源\n选项 98 | Disk Section=磁盘性能 99 | Disk Defrag=磁盘碎\n片整理 100 | Disk Check= 磁盘\n检查 101 | Storage Section=磁盘空间 102 | Disk Cleanup=磁盘\n清理 103 | Storage Sense=储存\n感知 104 | Reliability Section=系统可靠性 105 | Recent Events= 最近\n事件 106 | Action Center= 安全和\n维护 107 | 108 | [Specs] 109 | Specs Tab=系统概述 110 | OS Section=操作系统 111 | OS=OS 112 | Lanugage=语言 113 | Hardware Section=硬件 114 | Motherboard=主板 115 | CPU=处理器CPU 116 | RAM=内存 RAM 117 | GPU=显卡 GPU 118 | 119 | [About] 120 | About Tab=关于 121 | Developer=开发者 122 | Icon By=图标设计 123 | Translation By=翻译 124 | 125 | [Dropdowns] 126 | All Cores=所有核心 127 | First Core=第一核心 128 | First Two Cores=前两个核心 129 | First Four Cores=前四个核心 130 | First Half=前一半核心 131 | First AMD CCX=前 AMD CCX 132 | Even Cores=偶数核心 133 | Physcial Cores=物理核心 134 | Odd Cores=奇数核心 135 | Non-Physical Cores=逻辑核心 136 | Last Core=最后的核心 137 | Last Two Cores=最后两个核心 138 | Last Four Cores=最后四个核心 139 | Last Half=后一半核心 140 | Last AMD CCX=后 AMD CCX 141 | Pairs=每隔一对 142 | Custom=自定义 143 | Broadcaster Cores=推流核心 144 | Process Cores=游戏/应用核心 145 | Remaining Cores=剩余的核心 146 | Normal Priority=正常 147 | Above Normal Priority=高于正常 148 | High Priority=高 149 | Realtime Priority=实时 150 | 151 | [Errors] 152 | Broadcaster=推流软件无效! 153 | Broadcast Assignment=推流分配模式无效! 154 | Process Assignment=应用程序/游戏分配模式无效! 155 | Other Process Assignment=其他进程分配模式无效! 156 | Priority Assignment=优先级模式无效! 157 | Not Running=当前未运行。请先运行程序 158 | All Cores Used=其他进程没有留下核心,默认为最后一个核心 159 | Too Many Cores=您指定的核心数超过了系统中可用的数量 160 | Too Many Total Cores=您在应用程序/游戏和推流程序之间指定的核心超过系统可用总数 161 | -------------------------------------------------------------------------------- /Lang/Old/1.7.0.0/07.ini: -------------------------------------------------------------------------------- 1 | [File] 2 | Version=1.7.0.0 3 | Langauge=German 4 | Translator=VoodaGod 5 | 6 | [Global] 7 | Example=Beispiel 8 | Usage=Nutzung 9 | Done=Done 10 | 11 | [Global UI] 12 | Include Children=Include Children 13 | Allocation Mode=Allocation Mode 14 | Custom Assignment=Custom Assignment 15 | 16 | [File Menu] 17 | File Menu=File 18 | Load Option=Load Profile 19 | Save Option=Save Profile 20 | Quit Option=Quit 21 | 22 | [Options Menu] 23 | Options Menu=Options 24 | Language Menu=Language 25 | Current Language=Current 26 | Load Language=Load Lanugage File 27 | Sleep Menu=Sleep Timer 28 | Current Sleep=Current Timer 29 | Set Sleep=Set Sleep Timer 30 | 31 | [Help Menu] 32 | Help Menu=Help 33 | Website Option=Website 34 | HowTo Option=How It Works 35 | Update Option=Check for Updates 36 | 37 | [Running] 38 | Running Tab=Running 39 | Process List=Prozess 40 | Process Title=Fenstertitel 41 | 42 | [Steam Games] 43 | Games Tab=Steam Games 44 | Game Name=Videospiel 45 | Game Process=Prozess 46 | 47 | [SleepUI] 48 | Set Sleep Text=Ein kleinerer Wert kann die Bildrate glätten, mit dem Risiko, mehr CPU Zeit für NotCPUCores zu ver(sch)wenden 49 | New Sleep Text=New Sleep Timer 50 | 51 | [Files] 52 | Load Profile=Load Saved Settings 53 | Save Profile=Save Current Settings 54 | Load Language=Load Language File 55 | 56 | [Console] 57 | Debug Started=Debug Konsole initialisiert 58 | Interrupted=Exiting Optimizations via Interrupt... 59 | 60 | [Simple Tips] 61 | Debug Tip=Debug Modus aktivieren 62 | Refresh Tip=F5 or Sort to Refresh 63 | Process Tip=Prozessnamen des zu optimierenden Programms eingeben 64 | Import Tip=Ausgewählten Prozessnamen aus der Prozessliste importieren 65 | Children Tip=Include other Processes started by this Program 66 | 67 | [MultiTips] 68 | Assign Line 1=Um nur auf einen einzigen Kern beschränken, dessen Index eingeben (zB 1) 69 | Assign Line 2=Um auf mehreren Kernen zu laufen, die Indexe mit Komma getrennt eingeben (zB 1,2,3,4) 70 | Assign Line 3=Ranges seperated by a dash are supported. 71 | Assign Line 4=Maximum Cores 72 | 73 | [Play] 74 | Work/Play Tab=Work/Play 75 | Work/Play Text=Game/App Settings 76 | Process Select=Prozessnamen 77 | Priority Select=Prozesspriorität 78 | Optimize Text=ASSIGN 79 | Optimize Alt Text=Pause/Halt zum Stoppen 80 | Restore Text=ZURÜCKSETZEN 81 | Restore Alt Text=PC zurücksetzen... 82 | 83 | [Stream] 84 | Stream Tab=Stream 85 | Stream Text=Streaming Settings 86 | Stream Software=Broadcast Software 87 | Other Processes=Assign Other Processes 88 | 89 | [Tools] 90 | Tools Tab=Tools 91 | Games Section=Game Performance 92 | HPET Tool= HPET 93 | Game Mode= Game\n Mode 94 | Power Options=Power\nOptions 95 | Disk Section=Disk Performance 96 | Disk Defrag=Disk\nDefrag 97 | Disk Check= Disk\n Check 98 | Storage Section=Disk Space 99 | Disk Cleanup=Disk\nCleanup 100 | Storage Sense=Storage\nSense 101 | Reliability Section=System Reliability 102 | Recent Events= Recent\n Events 103 | Action Center= Action\n Center 104 | 105 | [Specs] 106 | Specs Tab=Specs 107 | OS Section=Betriebssystem 108 | OS=OS 109 | Lanugage=Sprache 110 | Hardware Section=Hardware 111 | Motherboard=Motherboard 112 | CPU=CPU 113 | RAM=RAM 114 | GPU=GPU 115 | 116 | [About] 117 | About Tab=Über 118 | Developer=Entwickelt von 119 | Icon By=Icon von 120 | 121 | [Errors] 122 | Broadcaster=Invalid Broadcaster Software! 123 | Broadcast Assignment=Invalid Broadcaster Assignment Mode! 124 | Process Assignment=Invalid App/Game Assigment Mode! 125 | Other Process Assignment=Invalid Other Process Assigment Mode! 126 | -------------------------------------------------------------------------------- /Lang/Old/1.7.0.0/19.ini: -------------------------------------------------------------------------------- 1 | [File] 2 | Version=1.7.0.0 3 | Langauge=Русский 4 | Translator=Gelo 5 | 6 | [Global] 7 | Example=Образец 8 | Usage=Использовать 9 | Done=Принять 10 | 11 | [Global UI] 12 | Include Children=Включая Детей 13 | Allocation Mode=Режим Распределения 14 | Custom Assignment=Пользовательское Назначение 15 | 16 | [File Menu] 17 | File Menu=Файл 18 | Load Option=Загрузить профиль 19 | Save Option=Сохранить профиль 20 | Quit Option=Выйти 21 | 22 | [Options Menu] 23 | Options Menu=Опции 24 | Language Menu=Язык 25 | Current Language=Текущий 26 | Load Language=Загрузить Файл Lanugage 27 | Sleep Menu=Таймер Сна 28 | Current Sleep=Текущий Таймер 29 | Set Sleep=Установить Таймер Сна 30 | 31 | [Help Menu] 32 | Help Menu=Помощь 33 | Website Option=Сайт 34 | HowTo Option=Как Это Работает 35 | Update Option=Проверить Наличие Обновлений 36 | 37 | [Running] 38 | Running Tab=Запуск 39 | Process List=Окно Процессов 40 | Process Title=Заголовок Окна 41 | Optimizing=оптимизируется в фоновом режиме до закрытия... 42 | Reoptimizing=Количество Процессов Изменено, Оптимизация Повторена 43 | Performance Mode=Все ядра, используемые для назначения, Максимальная производительность будет иметь приоритет над последовательной производительностью 44 | RestoringState=Выход. Восстановление Предыдущего Состояния... 45 | 46 | [Steam Games] 47 | Games Tab=Steam Игры 48 | Game Name=Game Имя 49 | Game ID=Game ID 50 | 51 | [SleepUI] 52 | Set Sleep Text=Уменьшение этого значения может сгладить падение fps, когда новые программы стартуют, из-за того, что NotCPUCores больше использует ЦП 53 | New Sleep Text=Новый Таймер Сна 54 | 55 | [Files] 56 | Load Profile=Загрузить Сохраненные Настройки 57 | Save Profile=Сохранить Текущие Настройки 58 | Load Language=Загрузить Языковой Файл 59 | 60 | [Console] 61 | Debug Started=Инициализирована Консоль Отладки 62 | Interrupted=Выход из оптимизации через прерывание... 63 | 64 | [Simple Tips] 65 | Debug Tip=Переключить Режим Отладки 66 | Refresh Tip=F5 или Сортировка для обновления 67 | Process Tip=Введите имя процесса здесь 68 | Import Tip=Импорт выбранного процесса из списка процессов 69 | Children Tip=Включить другие процессы, запущенные этой программой 70 | 71 | [MultiTips] 72 | Assign Line 1=Для запуска на одном ядре введите номер этого ядра. 73 | Assign Line 2=Для запуска на нескольких ядрах разделите их запятыми. 74 | Assign Line 3=Поддерживаются диапазоны, разделенные дефисом. 75 | Assign Line 4=Максимальное Количество Ядер 76 | 77 | [Play] 78 | Work/Play Tab=Работа / Игра 79 | Work/Play Text=Настройки Игры / Приложения 80 | Process Select=Процесс 81 | Priority Select=Приоритет процесса 82 | Optimize Text=ОПТИМИЗИРОВАТЬ 83 | Optimize Alt Text=Пауза / Перерывание для остановки 84 | Restore Text=ВОССТАНОВИТЬ 85 | Restore Alt Text=Восстановление ПК... 86 | 87 | [Stream] 88 | Stream Tab=Stream 89 | Stream Text=Streaming Настройки 90 | Stream Software=Програмное Обеспечение Стрима (OBS и др.) 91 | Other Processes=Другие процессы 92 | 93 | [Tools] 94 | Tools Tab=Инструменты 95 | Games Section=Производительность игры 96 | HPET Tool=HPET Инструменты 97 | Game Mode=Игровой\n Режим 98 | Power Options=Опции\nПитания 99 | Disk Section=Производительность диска 100 | Disk Defrag=Дефраг.\nДиска 101 | Disk Check= Проверка\n Диска 102 | Storage Section=Дисковое пространство 103 | Disk Cleanup=Очистка\nДиска 104 | Storage Sense=Хранение\nДанных 105 | Reliability Section=Надежность системы 106 | Recent Events= Последние\n События 107 | Action Center= Центр\n Событий 108 | 109 | [Specs] 110 | Specs Tab=Спцификация 111 | OS Section=Операционная система 112 | OS=ОС 113 | Lanugage=Язык 114 | Hardware Section=Аппаратура 115 | Motherboard=Материнка 116 | CPU=ЦПУ 117 | RAM=ОЗУ 118 | GPU=ГПУ 119 | 120 | [About] 121 | About Tab=О нас 122 | Developer=Разработал 123 | Icon By=Значки 124 | Translation By=Перевод 125 | 126 | [Dropdowns] 127 | All Cores=Все ядра 128 | First Core=Первое Ядро 129 | First Two Cores=Первые 2 Ядра 130 | First Four Cores=Первые 4 Ядра 131 | First Half=Первая половина 132 | First AMD CCX=Первый AMD CCX 133 | Even Cores=Даже ядра 134 | Physcial Cores=Физические Ядра 135 | Odd Cores=Нечетные Ядра 136 | Non-Physical Cores=Не Физические Ядра 137 | Last Core=Последнее Ядро 138 | Last Two Cores=Последние 2 Ядра 139 | Last Four Cores=Последние 4 Ядра 140 | Last Half=Последняя половина 141 | Last AMD CCX=Последний AMD CCX 142 | Pairs=Каждая Другая Пара 143 | Custom=Специальный 144 | Broadcaster Cores=Трансляционные ядра 145 | Process Cores=Ядра Игр / Приложений 146 | Remaining Cores=Остальные Ядра 147 | Normal Priority=Нормальный 148 | Above Normal Priority=Выше нормы 149 | High Priority=Высокий 150 | Realtime Priority=Реального времени 151 | 152 | [Errors] 153 | Broadcaster=Недействительное программное обеспечение Broadcaster! 154 | Broadcast Assignment=Недействительный режим назначения трансляций! 155 | Process Assignment=Недействительный режим настройки App / Game! 156 | Other Process Assignment=Недействительный режим выбора другого процесса! 157 | Priority Assignment=Неверный режим приоритета! 158 | Not Running=в настоящее время не выполняется. Сначала запустите программу 159 | All Cores Used=Нет ядер для других процессов, по умолчанию для последнего ядра 160 | Too Many Cores=Вы указали больше ядер, чем доступно в вашей системе 161 | Too Many Total Cores=Вы указали больше ядер между App / Game и Broadcaster, чем доступно в вашей системе 162 | -------------------------------------------------------------------------------- /Lang/Template.ini: -------------------------------------------------------------------------------- 1 | [File] 2 | Version= 3 | Language= 4 | Translator= 5 | 6 | [Font] 7 | Size=8.5 8 | Weight=400 9 | Name="" 10 | 11 | [Global Tips] 12 | Example=Example 13 | Usage=Usage 14 | Done=Done 15 | 16 | [Global UI] 17 | Include Children=Include Children 18 | Allocation Mode=Allocation Mode 19 | Custom Assignment=Custom Assignment 20 | 21 | [File Menu] 22 | File Menu=File 23 | Load Option=Load Profile 24 | Save Option=Save Profile 25 | Quit Option=Quit 26 | 27 | [Options Menu] 28 | Options Menu=Options 29 | Language Menu=Language 30 | Current Language=Current 31 | Load Language=Load Language File 32 | Sleep Menu=Sleep Timer 33 | Current Sleep=Current Timer 34 | Set Sleep=Set Sleep Timer 35 | Set Library=Set Steam Library 36 | Remove Library=Remove Steam Library 37 | 38 | [Help Menu] 39 | Help Menu=Help 40 | Website Option=Website 41 | Discord Option=Discord 42 | How To Option=How It Works 43 | Donate Option=Buy me a drink? 44 | Update Option=Check for Updates 45 | 46 | [Processes] 47 | Running Tab=Running 48 | Process List=Window Process 49 | Process Title=Window Title 50 | Excluded Tab=Excluded 51 | 52 | [Steam Games] 53 | Games Tab=Steam Games 54 | Game Name=Game Name 55 | Game ID=Game ID 56 | 57 | [SleepUI] 58 | Set Sleep Text=Decreasing this value can smooth FPS drops when new programs start, at the risk of NotCPUCores having more CPU usage itself 59 | New Sleep Text=New Sleep Timer 60 | 61 | [Files] 62 | Load Profile=Load Saved Settings 63 | Save Profile=Save Current Settings 64 | Load Language=Load Language File 65 | 66 | [Console] 67 | Debug Started=Debug Console Initialized 68 | Interrupted=Exiting Optimizations via Interrupt... 69 | 70 | [Simple Tips] 71 | Debug Tip=Toggle Debug Mode 72 | Refresh Tip=F5 or Sort to Refresh 73 | Process Tip=Enter the name of the process(es) here 74 | Import Tip=Import Selected Process from Process List 75 | Children Tip=Include other Processes started by this Program 76 | 77 | [MultiTips] 78 | Assign Line 1=To run on a Single Core, enter the number of that core. 79 | Assign Line 2=To run on Multiple Cores, separate them with commas. 80 | Assign Line 3=Ranges separated by a dash are supported. 81 | Assign Line 4=Maximum Cores 82 | 83 | [Play] 84 | Work/Play Tab=Work/Play 85 | Work/Play Text=Game/App Settings 86 | Process Select=Process 87 | Priority Select=Process Priority 88 | Optimize Text=ASSIGN 89 | Optimize Alt Text=Pause/Break to Stop 90 | Restore Text=RESET AFFINITIES 91 | Restore Alt Text=Restoring PC... 92 | 93 | [Stream] 94 | Stream Tab=Stream 95 | Stream Text=Streaming Settings 96 | Stream Software=Broadcast Software 97 | Other Processes=Assign Other Processes 98 | 99 | [Tools] 100 | Tools Tab=Tools 101 | Games Section=Gaming 102 | Game Mode= Game\n Mode 103 | Hardware Accel= HAGS 104 | HPET Tool= HPET 105 | Disk Section=Disk Health 106 | Disk Defrag=Disk\nDefrag 107 | Disk Check= Disk\n Check 108 | Disk Cleanup=Disk\nCleanup 109 | Storage Sense=Storage\nSense 110 | Reliability Section=System Info 111 | Recent Events= Recent\n Events 112 | Action Center= Action\n Center 113 | Power Options=Power\nOptions 114 | 115 | [Specs] 116 | Specs Tab=Specs 117 | OS Section=Operating System 118 | OS=OS 119 | Lanugage=Language 120 | Hardware Section=Hardware 121 | Motherboard=Motherboard 122 | CPU=CPU 123 | RAM=RAM 124 | GPU=GPU(s) 125 | 126 | [About] 127 | About Tab=About 128 | License=License 129 | Developer=Developed by 130 | Icon by=Icon by 131 | Translation by=Translation by 132 | 133 | [Dropdowns] 134 | Disabled=Disabled 135 | All Cores=All Cores 136 | First Core=First Core 137 | First Two Cores=First 2 Cores 138 | First Four Cores=First 4 Cores 139 | First Half=First Half 140 | First AMD CCX=First AMD CCX 141 | Even Cores=Even Cores 142 | Physical Cores=Physical Cores 143 | Odd Cores=Odd Cores 144 | Non-Physical Cores=Non-Physical Cores 145 | Last Core=Last Core 146 | Last Two Cores=Last 2 Cores 147 | Last Four Cores=Last 4 Cores 148 | Last Half=Last Half 149 | Last AMD CCX=Last AMD CCX 150 | Pairs=Every Other Pair 151 | Custom=Custom 152 | Broadcaster Cores=Broadcaster Cores 153 | Process Cores=Game/App Cores 154 | Remaining Cores=Remaining Cores 155 | Low Priority=Low 156 | Below Normal Priority=Below Normal 157 | Normal Priority=Normal 158 | Above Normal Priority=Above Normal 159 | High Priority=High 160 | Realtime Priority=Realtime 161 | 162 | [Running] 163 | Optimizing=optimizing in the background until all close... 164 | Reoptimizing=Process Count Changed, Optimization Reran 165 | Performance Mode=All Cores used for Assignment, Max Performance will be prioritized over Consistent Performance 166 | Restoring State=Exited. Restoring Previous State... 167 | 168 | [Updater] 169 | Too New=You're running a newer version than publicly available on Github 170 | No Updates=Your NotCPUCores version is up to date 171 | New Version=An update is available, opening download page 172 | 173 | [Console] 174 | HPET Change=HPET State Changed, Please Reboot to Apply Changes 175 | 176 | [Errors] 177 | Already Running Title=Already Running 178 | Already Running Message=NotCPUCores is already running. To prevent conflicts, this instance will now exit 179 | Incompatible Title=Incompatible Program 180 | Incompatible Message=is currently running. To prevent conflicts, NotCPUCores will now exit 181 | Broadcaster=Invalid Broadcaster Software! 182 | Broadcast Assignment=Invalid Broadcaster Assignment Mode! 183 | Process Assignment=Invalid App/Game Assigment Mode! 184 | Other Process Assignment=Invalid Other Process Assigment Mode! 185 | Priority Assignment=Invalid Priority Mode! 186 | Not Running=not currently running. Please run the program(s) first 187 | All Cores Used=No Cores Left for Other Processes, defaulting to last core 188 | Too Many Cores=You've specified more cores than available on your system 189 | Too Many Total Cores=You've specified more cores between App/Game and Broadcaster than available on your system 190 | Steam Not Running=Can't launch Steam Games if Steam isn't running. Please launch Steam, wait, and try again 191 | Update Check Fail=Unable to load Github API to check for updates. Are you connected to the internet? 192 | Update Data Fail=Data returned for Update Check was invalid or blocked. Please check your internet and retry 193 | Update Tags Fail=Data for available updates was missing or incomplete. Please try again later 194 | Update Type Fail=Data for available update types was missing or incomplete. Please try again later 195 | -------------------------------------------------------------------------------- /Plugins/child.au3: -------------------------------------------------------------------------------- 1 | Main() 2 | 3 | Func Main() 4 | 5 | Local $sStatus 6 | 7 | While True 8 | 9 | $sStatus = ConsoleRead() 10 | If @extended = 0 Then ContinueLoop 11 | 12 | Switch $sStatus 13 | 14 | Case "True" 15 | ;;; 16 | 17 | Case Else 18 | ConsoleWrite("Plugin Caught unhandled parameter: " & $sStatus) 19 | 20 | EndSwitch 21 | 22 | WEnd 23 | EndFunc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://img.shields.io/github/actions/workflow/status/rcmaehl/NotCPUCores/ncc.yml)](https://github.com/rcmaehl/NotCPUCores/actions?query=workflow%3Ancc) 2 | [![Download](https://img.shields.io/github/v/release/rcmaehl/NotCPUCores)](https://github.com/rcmaehl/NotCPUCores/releases/latest/) 3 | [![Ko-fi](https://img.shields.io/badge/Support%20me%20on-Ko--fi-FF5E5B.svg?logo=ko-fi)](https://ko-fi.com/rcmaehl) 4 | [![PayPal](https://img.shields.io/badge/Donate%20on-PayPal-00457C.svg?logo=paypal)](https://paypal.me/rhsky) 5 | [![Join the Discord chat](https://img.shields.io/badge/Discord-chat-7289da.svg?&logo=discord)](https://discord.gg/uBnBcBx) 6 | 7 | # NotCPUCores 8 | Work, Play, Stream - Without the Stutter | [Download Under Releases](https://github.com/rcmaehl/NotCPUCores/releases) | [Download Test Builds](https://nightly.link/rcmaehl/NotCPUCores/workflows/ncc/main/NCC.zip) 9 | 10 | ![Version 1.7.2.0](https://i.imgur.com/pfayHD5.gif) 11 | 12 | ## What is NotCPUCores? 13 | 14 | NotCPUCores is a GUI for quick CPU Resource Assignment and Priority adjustment, along with other minor tweaks. A lot of similar **snake oil marketed** Non-Free alternatives exist that like to call themselves names such as "Game Booster", "FPS Booster", "System Stabilizer", "Process Tweaker", "Game Tweaker" among other terms we don't like. We will not market ourselves as such. NotCPUCores does the same or similar tweaks compared to non-free alternatives as well as providing additional features. 15 | 16 | ## Is it worth using NotCPUCores/CPUCores/(Insert Other Optimizer/Booster Here)? 17 | 18 | All these "optimizers" do simple tweaks that you yourself can do, so probably not; You DEFINITELY should NOT be forced to pay money for it. You MAY see marginal returns, slightly better stability of FPS, but also more battery usage. There is SIMPLY NO REPLACEMENT for doing a hardware upgrade. 19 | 20 | ## How does it work? / Getting the Benefits without Installing / Etc 21 | 22 | Visit the [Wiki](https://github.com/rcmaehl/NotCPUCores/wiki) 23 | 24 | ## How to build from source code 25 | 26 | 1. Download and run "AutoIt Full Installation" from [official website](https://www.autoitscript.com/site/autoit/downloads). 27 | 1. Get the source code either by [downloading zip](https://github.com/rcmaehl/NotCPUCores/archive/master.zip) or do `git clone https://github.com/rcmaehl/NotCPUCores`. 28 | 1. Right click on `NotCPUCores.au3` in the NotCPUCores directory and select "Compile Script (x64) (or x86 if you have 32 bit Windows install). 29 | 1. This will create NotCPUCores.exe in the same directory. 30 | 31 | This program is free and open source. Feel free to download and modify. Please do not sell exact copies. 32 | -------------------------------------------------------------------------------- /Settings.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | Default Profile=.\Autoload.ncc 3 | [Steam] 4 | Library Path=Auto -------------------------------------------------------------------------------- /installer.nsi: -------------------------------------------------------------------------------- 1 | ; Enable Unicode 2 | Unicode True 3 | 4 | ; Use Modern UI 5 | !include "MUI2.nsh" 6 | 7 | ; Determine if OS is 32 or 64 bit 8 | !include "x64.nsh" 9 | 10 | ; Use If/IfNot/Else/EndIf 11 | !include "LogicLib.nsh" 12 | 13 | 14 | ; GLobal variables 15 | !define PRODUCT_NAME "NotCPUCores" 16 | !define PRODUCT_VERSION "1.7.2.1" 17 | !define INSTALLER_NAME "NCC" 18 | !define UNINSTALLER_NAME "uninstall" 19 | 20 | ; Enable debugging (Set 1 to debug and 0 for production) 21 | !define DEBUGGING_ENABLED 0 22 | 23 | 24 | ; The name of the installer 25 | Name "${PRODUCT_NAME} (${PRODUCT_VERSION})" 26 | 27 | ; The file to create 28 | OutFile "${INSTALLER_NAME}.exe" 29 | 30 | 31 | ; Registry key to check for directory (this means if the program is already 32 | ; installed, it automatically uses the same install directory) 33 | ;InstallDirRegKey HKLM "Software\${PRODUCT_NAME}" InstallLocation 34 | 35 | ; Request to run application as admin 36 | ; If there would be an option for normal users it seems things could get 37 | ; complicated: 38 | ; - A request for admin rights some time after the start does not seem easily 39 | ; possible 40 | ; - The admin state would need to be chcked at many points to not manipulate the 41 | ; registry and co which could also be challenging when allowing the user to 42 | ; select a directory since the rights to write must be verified or the error 43 | ; catched (this is also a problem regarding the uninstaller at that point) 44 | RequestExecutionLevel admin 45 | 46 | 47 | ; Run on initialization of the installer 48 | Function .onInit 49 | ${If} ${DEBUGGING_ENABLED} == 1 50 | MessageBox MB_OK "Initial install directory: $INSTDIR" 51 | ${EndIf} 52 | 53 | ; Try to read the installation location from the registry 54 | ReadRegStr $0 HKLM "Software\${PRODUCT_NAME}" "Path" 55 | StrCpy $INSTDIR "$0" 56 | 57 | ${If} ${DEBUGGING_ENABLED} == 1 58 | MessageBox MB_OK "Install directory after reading the registry: $INSTDIR" 59 | ${EndIf} 60 | 61 | ; Determine the default install location based on the arch of the PC 62 | ${If} $INSTDIR == "" 63 | ${If} ${RunningX64} 64 | StrCpy $INSTDIR "$PROGRAMFILES64\${PRODUCT_NAME}" 65 | ${Else} 66 | StrCpy $INSTDIR "$PROGRAMFILES32\${PRODUCT_NAME}" 67 | ${EndIf} 68 | ${If} ${DEBUGGING_ENABLED} == 1 69 | MessageBox MB_OK "Set install directory using the arch of the system: $INSTDIR" 70 | ${EndIf} 71 | ${Else} 72 | ${If} ${DEBUGGING_ENABLED} == 1 73 | MessageBox MB_OK "Existing install directory found in registry: $INSTDIR" 74 | ${EndIf} 75 | ${EndIf} 76 | FunctionEnd 77 | 78 | 79 | ;-------------------------------- 80 | 81 | ; Set installer icon 82 | !define MUI_ICON "Assets\icon.ico" 83 | 84 | ; Pages [Installer] 85 | 86 | !insertmacro MUI_PAGE_LICENSE "LICENSE.md" 87 | !insertmacro MUI_PAGE_COMPONENTS 88 | 89 | ; Possible save dialog to ask for installation location 90 | ;Page Custom AskForInstallationType 91 | ;Function AskForInstallationType 92 | ; MessageBox MB_YESNO "Install in user directory (no admin rights necessary)?" IDYES true IDNO false 93 | ; true: 94 | ; StrCpy $INSTDIR "$LOCALAPPDATA\${PRODUCT_NAME}" 95 | ; false: 96 | ; ; See above at RequestExecutionLevel for more info about why this is not 97 | ; ; an easy problem to solve 98 | ;FunctionEnd 99 | 100 | !insertmacro MUI_PAGE_DIRECTORY 101 | !insertmacro MUI_PAGE_INSTFILES 102 | 103 | ; Pages [Uninstaller] 104 | 105 | !insertmacro MUI_UNPAGE_CONFIRM 106 | !insertmacro MUI_UNPAGE_INSTFILES 107 | 108 | ; Set installer language 109 | !insertmacro MUI_LANGUAGE "English" 110 | 111 | ;-------------------------------- 112 | 113 | ; Things to install 114 | Section "${PRODUCT_NAME} (required)" ; required executable 115 | 116 | SectionIn RO ; read only 117 | 118 | ; Set output path to the installation directory. 119 | SetOutPath $INSTDIR 120 | ${If} ${DEBUGGING_ENABLED} == 1 121 | MessageBox MB_OK "Install directory for ${PRODUCT_NAME} (required): $INSTDIR" 122 | ${EndIf} 123 | 124 | ; Select file to be installed 125 | ${If} ${RunningX64} 126 | File "/oname=${PRODUCT_NAME}.exe" ${PRODUCT_NAME}.exe 127 | ${If} ${DEBUGGING_ENABLED} == 1 128 | MessageBox MB_OK "File that is used: ${PRODUCT_NAME}.exe" 129 | ${EndIf} 130 | ${Else} 131 | File "/oname=${PRODUCT_NAME}.exe" ${PRODUCT_NAME}_x86.exe 132 | ${If} ${DEBUGGING_ENABLED} == 1 133 | MessageBox MB_OK "File that is used: ${PRODUCT_NAME}_x86.exe" 134 | ${EndIf} 135 | ${EndIf} 136 | 137 | ; Copy icon for start menu shortcut 138 | File "/oname=${PRODUCT_NAME}.ico" Assets\icon.ico 139 | 140 | ; Write the installation path into the registry 141 | ; Write the uninstall keys for Windows 142 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" "${PRODUCT_NAME}" 143 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" '"$INSTDIR\${UNINSTALLER_NAME}.exe"' 144 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoModify" 1 145 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" 1 146 | WriteUninstaller "${UNINSTALLER_NAME}.exe" 147 | 148 | SectionEnd 149 | 150 | 151 | ; Optional section, shortcuts for now, can be used for translations in future? 152 | Section "Start Menu shortcuts" 153 | 154 | ; Solution with directory 155 | CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" 156 | CreateShortcut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe" "" "$INSTDIR\${PRODUCT_NAME}.ico" 0 157 | ; A link to the uninstaller is not necessary but provided for ease of use 158 | CreateShortcut "$SMPROGRAMS\${PRODUCT_NAME}\${UNINSTALLER_NAME}.lnk" "$INSTDIR\${UNINSTALLER_NAME}.exe" "" "$INSTDIR\${UNINSTALLER_NAME}.exe" 0 159 | 160 | ; Solution with direct link to program (don't forget to remove this file in 161 | ; the uninstaller when using this solution) 162 | ;CreateShortcut "$SMPROGRAMS\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe" "" "$INSTDIR\${PRODUCT_NAME}.ico" 0 163 | 164 | SectionEnd 165 | 166 | 167 | ; After installation success 168 | Function .onInstSuccess 169 | 170 | ; Update the installer path in the registry so that this path can be recognized 171 | ; when an updated installer is executed 172 | WriteRegStr HKLM "Software\${PRODUCT_NAME}" "Path" "$INSTDIR" 173 | 174 | FunctionEnd 175 | 176 | ;-------------------------------- 177 | 178 | ; Uninstaller 179 | 180 | Section "Uninstall" 181 | 182 | ; Remove registry keys 183 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" 184 | DeleteRegKey HKLM "SOFTWARE\${PRODUCT_NAME}" 185 | 186 | ; Remove files and uninstaller 187 | Delete $INSTDIR\${PRODUCT_NAME}.exe 188 | Delete $INSTDIR\${PRODUCT_NAME}.ico 189 | Delete $INSTDIR\${UNINSTALLER_NAME}.exe 190 | 191 | ; Remove shortcuts, if there are any 192 | Delete "$SMPROGRAMS\${PRODUCT_NAME}\*.*" 193 | ;Delete "$SMPROGRAMS\${PRODUCT_NAME}.lnk" 194 | 195 | ; Remove directories used 196 | RMDir "$SMPROGRAMS\${PRODUCT_NAME}" 197 | RMDir "$INSTDIR" 198 | 199 | SectionEnd 200 | -------------------------------------------------------------------------------- /r/rcmaehl/NotCPUCores/1.7.3.0/rcmaehl.NotCPUCores.installer.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.0.0.schema.json 2 | PackageIdentifier: rcmaehl.NotCPUCores 3 | PackageVersion: 1.7.3.0 4 | MinimumOSVersion: 10.0.0.0 5 | InstallModes: 6 | - interactive 7 | - silent 8 | - silentWithProgress 9 | Installers: 10 | - Architecture: x64 11 | InstallerType: exe 12 | InstallerUrl: https://github.com/rcmaehl/NotCPUCores/releases/download/1.7.3.0/NotCPUCores.exe 13 | InstallerSha256: F903D3CF2D8CEA51A27589B1494F93C5BFEDE1678F5EE7F12A611FF1B1964B16 14 | InstallerSwitches: 15 | Silent: /s 16 | SilentWithProgress: /s 17 | # ProductCode: 18 | # Scope: 19 | InstallerLocale: en-US 20 | UpgradeBehavior: install 21 | ManifestType: installer 22 | ManifestVersion: 1.0.0 23 | -------------------------------------------------------------------------------- /r/rcmaehl/NotCPUCores/1.7.3.0/rcmaehl.NotCPUCores.locale.en-US.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultlocale.1.0.0.schema.json 2 | PackageIdentifier: rcmaehl.NotCPUCores 3 | PackageVersion: 1.7.3.0 4 | PackageLocale: en-US 5 | Publisher: Robert Maehl 6 | PublisherUrl: https://fcofix.org 7 | PublisherSupportUrl: https://fcofix.org/NotCPUCores/issues 8 | #PrivacyUrl: 9 | Author: Robert Maehl 10 | PackageName: NotCPUCores 11 | PackageUrl: https://fcofix.org/NotCPUCores/ 12 | License: LGPL 13 | LicenseUrl: https://raw.githubusercontent.com/rcmaehl/NotCPUCores/master/LICENSE.md 14 | Copyright: Robert Maehl 15 | #CopyrightUrl: 16 | ShortDescription: A GUI for quick CPU Resource Assignment and Priority Adjustments 17 | Description: NotCPUCores is a GUI for quick CPU Resource Assignment and Priority adjustment, along with other minor tweaks. 18 | Moniker: ncc 19 | Tags: 20 | - performance 21 | - task manager 22 | - priority 23 | - affinity 24 | - gaming 25 | - streaming 26 | - optimization 27 | - tweaks 28 | ManifestType: defaultLocale 29 | ManifestVersion: 1.0.0 30 | -------------------------------------------------------------------------------- /r/rcmaehl/NotCPUCores/1.7.3.0/rcmaehl.NotCPUCores.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.0.0.schema.json 2 | PackageIdentifier: rcmaehl.NotCPUCores 3 | PackageVersion: 1.7.3.0 4 | DefaultLocale: en-US 5 | ManifestType: version 6 | ManifestVersion: 1.0.0 7 | --------------------------------------------------------------------------------