Skip to content

Commit

Permalink
FIx #45
Browse files Browse the repository at this point in the history
Fix #45
TODO: Fix Pause/Break hotkey
  • Loading branch information
rcmaehl committed May 4, 2019
1 parent e4e16b8 commit 0efe69a
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions NotCPUCores.au3
Expand Up @@ -39,12 +39,10 @@ Opt("TrayAutoPause", 0)
Opt("GUICloseOnESC", 0)
Opt("GUIResizeMode", $GUI_DOCKALL)

Global $bRefresh = False
Global $bInterrupt = False

HotKeySet("{F5}", "_Refresh")
HotKeySet("{PAUSE}", "_Interrupt")
HotKeySet("{BREAK}", "_Interrupt")
; HotKeySet("{PAUSE}", "_Interrupt")
; HotKeySet("{BREAK}", "_Interrupt")

#cs
Expand Down Expand Up @@ -101,7 +99,7 @@ Func Main()
Local $iSleep = 100
Local $hLibrary = ""
Local $hProfile = "None"
Local $sVersion = "1.7.0.0"
Local $sVersion = "1.7.1.0"
Local $iAllCores
Local $sPriority = "High"
Local $aProcesses[4] = ["", "obs.exe", "obs32.exe", "obs64.exe"]
Expand All @@ -116,6 +114,10 @@ Func Main()

Local $hGUI = GUICreate("NotCPUCores", 640, 480, -1, -1, BitOr($WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU))

#Region ; Dummy Controls
Local $hRefresh = GUICtrlCreateDummy()
#EndRegion

#Region ; File Menu
Local $hMenu1 = GUICtrlCreateMenu($_sLang_FileMenu)
Local $hLoad = GUICtrlCreateMenuItem($_sLang_FileLoad, $hMenu1)
Expand Down Expand Up @@ -406,6 +408,10 @@ Func Main()
Local $hOptimize = GUICtrlCreateButton($_sLang_Optimize, 140, 275, 135, 20)

$hQuickTabs = GUICreate("", 360, 300, 280, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)

Local $aHotkeys[3][2] = [["{F5}", $hRefresh], ["{PAUSE}", $hReset], ["{BREAK}", $hReset]]
GUISetAccelerators($aHotkeys)

$hTabs = GUICtrlCreateTab(0, 0, 360, 300)

#Region ; Process List
Expand Down Expand Up @@ -443,6 +449,8 @@ Func Main()
$bCHidden = True
#EndRegion

GUISetAccelerators($aHotkeys)

WinMove($hGUI, "", Default, Default, 285, 345, 1)
GUISetState(@SW_SHOW, $hGUI)

Expand All @@ -468,6 +476,7 @@ Func Main()
#EndRegion
#ce


While 1

; Optimize first, always
Expand Down Expand Up @@ -643,17 +652,14 @@ Func Main()
EndIf

Case $hMsg = $hProcesses
$bRefresh = False
_GetProcessList($hProcesses)
_GUICtrlListView_SortItems($hProcesses, GUICtrlGetState($hProcesses))

Case $hMsg = $hGames
$bRefresh = False
_GetSteamGames($hGames, $hLibrary)
_GUICtrlListView_SortItems($hGames, GUICtrlGetState($hGames))

Case $bRefresh = True
$bRefresh = False
Case $hMsg = $hRefresh
_GetSteamGames($hGames, $hLibrary)
_GetProcessList($hProcesses)
_GUICtrlListView_SortItems($hGames, 0)
Expand Down Expand Up @@ -1355,10 +1361,6 @@ Func _IsChecked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_IsChecked

Func _Refresh()
$bRefresh = True
EndFunc

#cs
#include <StaticConstants.au3>
Expand Down

0 comments on commit 0efe69a

Please sign in to comment.