Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple PID Support #24

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ProcessNameListToPause
dlardo committed Nov 22, 2023
commit 21f3647ef7dc344d0f89f33763442474e5cf0618
19 changes: 18 additions & 1 deletion Main.c
Original file line number Diff line number Diff line change
@@ -163,7 +163,7 @@ void HandlePauseKeyPress(void)

// Either we configured it to pause/un-pause a specified process, or we will pause/un-pause
// the currently in-focus foreground window.
if (wcslen(gConfig.ProcessNameToPause) > 0)
if (wcslen(gConfig.ProcessNameToPause) > 0 || wcslen(gConfig.ProcessNameListToPause))
{
if (gIsPaused)
{
@@ -332,6 +332,14 @@ u32 LoadRegistrySettings(void)
.MinValue = NULL,
.MaxValue = NULL,
.Destination = &gConfig.ProcessNameToPause
},
{
.Name = L"ProcessNameListToPause",
.DataType = REG_SZ,
.DefaultValue = &(wchar_t[1024]) { L"" },
.MinValue = NULL,
.MaxValue = NULL,
.Destination = &gConfig.ProcessNameListToPause
}
};

@@ -441,6 +449,15 @@ u32 LoadRegistrySettings(void)
}
}

// Combine ProcessNameToPause and ProcessNameListToPause
if (wcslen(gConfig.ProcessNameListToPause) > 0)
{
wcscat_s(gConfig.ProcessNameListToPause, sizeof(gConfig.ProcessNameListToPause), L", ");
}
wcscat_s(gConfig.ProcessNameListToPause, sizeof(gConfig.ProcessNameListToPause), gConfig.ProcessNameToPause);

DbgPrint(L"Final List of Processes: %s.", gConfig.ProcessNameListToPause);

Exit:
if (RegKey != NULL)
{
1 change: 1 addition & 0 deletions Main.h
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ typedef struct _CONFIG
u32 TrayIcon;
u32 PauseKey;
wchar_t ProcessNameToPause[128];
wchar_t ProcessNameListToPause[1024];
} CONFIG;

// Function declarations.