Skip to content

Commit

Permalink
feat: add reset button
Browse files Browse the repository at this point in the history
  • Loading branch information
DemoJameson committed Jun 7, 2023
1 parent 5be55c3 commit 9b18938
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kkapture/kkapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,19 @@ static void SaveSettingsToRegistry()
}
}

static void ResetSettings()
{
RegDeleteKey(HKEY_CURRENT_USER,RegistryKeyName);

TCHAR szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, MAX_PATH);

STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
if (CreateProcess(szPath, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
ExitProcess(0);
}

static int IntPow(int a,int b)
{
int x = 1;
Expand Down Expand Up @@ -383,6 +396,10 @@ static INT_PTR CALLBACK MainDialogProc(HWND hWndDlg,UINT uMsg,WPARAM wParam,LPAR
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_RESET:
ResetSettings();
return TRUE;

case IDCANCEL:
EndDialog(hWndDlg,0);
return TRUE;
Expand Down
1 change: 1 addition & 0 deletions kkapture/kkapture.rc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "kkapture!",IDOK,149,319,50,14
PUSHBUTTON "Exit",IDCANCEL,201,319,50,14
PUSHBUTTON "Reset",IDC_RESET,7,319,50,14
EDITTEXT IDC_DEMO,51,7,146,13,ES_AUTOHSCROLL
LTEXT "Application:",IDC_STATIC,9,9,38,8
PUSHBUTTON "Browse...",IDC_BDEMO,201,7,50,13
Expand Down
1 change: 1 addition & 0 deletions kkapture/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#define IDC_FFMPEGINOPTS 1037
#define IDC_FFMPEGOUTLABEL 1038
#define IDC_FFMPEGOUTOPTS 1039
#define IDC_RESET 1040

// Next default values for new objects
//
Expand Down

0 comments on commit 9b18938

Please sign in to comment.