From 1888104b32126a34d5c1919877613b79a3a4fa1c Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 16 Apr 2006 13:56:57 +0000 Subject: [PATCH] Implement screensaver setting and preiw of screen setting working in windows not tested in reactos svn path=/trunk/; revision=21609 --- reactos/dll/cpl/desk/screensaver.c | 47 ++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/reactos/dll/cpl/desk/screensaver.c b/reactos/dll/cpl/desk/screensaver.c index bc4b1120bdd..f20f97e9e02 100644 --- a/reactos/dll/cpl/desk/screensaver.c +++ b/reactos/dll/cpl/desk/screensaver.c @@ -68,7 +68,28 @@ ScreenSaverPageProc(HWND hwndDlg, case IDC_SCREENS_TESTSC: // Screensaver Preview { if(command == BN_CLICKED) - MessageBox(NULL, TEXT("That button doesn't do anything yet"), TEXT("Whoops"), MB_OK); + { + /* + /p: Run in preview + /s Run normal + /c: Run configuration, hwnd is handle of calling window + /a Run change password + */ + + WCHAR szCmdline[2048]; + STARTUPINFO si; + PROCESS_INFORMATION pi; + swprintf(szCmdline, L"%s /p",g_ScreenSaverItems[ImageListSelection].szFilename); + + ZeroMemory( &si, sizeof(si) ); + si.cb = sizeof(si); + ZeroMemory( &pi, sizeof(pi) ); + if(CreateProcess( NULL, szCmdline, NULL, NULL, FALSE, 0, NULL,NULL,&si, &pi )) + { + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + } } break; case IDC_SCREENS_DELETE: // Delete Screensaver @@ -82,7 +103,29 @@ ScreenSaverPageProc(HWND hwndDlg, case IDC_SCREENS_SETTINGS: // Screensaver Settings { if(command == BN_CLICKED) - MessageBox(NULL, TEXT("That button doesn't do anything yet"), TEXT("Whoops"), MB_OK); + { + /* + /p: Run in preview + /s Run normal + /c: Run configuration, hwnd is handle of calling window + /a Run change password + + */ + + WCHAR szCmdline[2048]; + STARTUPINFO si; + PROCESS_INFORMATION pi; + swprintf(szCmdline, L"%s /c",g_ScreenSaverItems[ImageListSelection].szFilename); + + ZeroMemory( &si, sizeof(si) ); + si.cb = sizeof(si); + ZeroMemory( &pi, sizeof(pi) ); + if(CreateProcess( NULL, szCmdline, NULL, NULL, FALSE, 0, NULL,NULL,&si, &pi )) + { + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + } } break; case IDC_SCREENS_USEPASSCHK: // Screensaver Is Secure {