[MAZESCR]
authorDaniel Reimer <reimer.daniel@freenet.de>
Wed, 20 May 2015 01:57:07 +0000 (01:57 +0000)
committerDaniel Reimer <reimer.daniel@freenet.de>
Wed, 20 May 2015 01:57:07 +0000 (01:57 +0000)
INI files for setting parameters? Lets get to the past Win 3.11 standards and make a configure dialog for that which reads and writes the stuff to the registry.

svn path=/trunk/; revision=67833

15 files changed:
rosapps/applications/screensavers/mazescr/CMakeLists.txt
rosapps/applications/screensavers/mazescr/lang/bg-BG.rc [deleted file]
rosapps/applications/screensavers/mazescr/lang/de-DE.rc
rosapps/applications/screensavers/mazescr/lang/en-US.rc
rosapps/applications/screensavers/mazescr/lang/es-ES.rc [deleted file]
rosapps/applications/screensavers/mazescr/lang/fr-FR.rc [deleted file]
rosapps/applications/screensavers/mazescr/lang/lt-LT.rc [deleted file]
rosapps/applications/screensavers/mazescr/lang/no-NO.rc [deleted file]
rosapps/applications/screensavers/mazescr/lang/pl-PL.rc [deleted file]
rosapps/applications/screensavers/mazescr/lang/ro-RO.rc [deleted file]
rosapps/applications/screensavers/mazescr/lang/sk-SK.rc [deleted file]
rosapps/applications/screensavers/mazescr/lang/uk-UA.rc [deleted file]
rosapps/applications/screensavers/mazescr/maze.c
rosapps/applications/screensavers/mazescr/maze.rc
rosapps/applications/screensavers/mazescr/resource.h

index 608ec27..e3778ac 100644 (file)
@@ -4,5 +4,5 @@ add_executable(mazescr maze.c maze.rc)
 set_module_type(mazescr win32gui UNICODE)
 set_target_properties(mazescr PROPERTIES SUFFIX ".scr")
 target_link_libraries(mazescr scrnsave)
-add_importlibs(mazescr user32 gdi32 msvcrt kernel32)
+add_importlibs(mazescr user32 gdi32 advapi32 msvcrt kernel32)
 add_cd_file(TARGET mazescr DESTINATION reactos/system32 FOR all)
diff --git a/rosapps/applications/screensavers/mazescr/lang/bg-BG.rc b/rosapps/applications/screensavers/mazescr/lang/bg-BG.rc
deleted file mode 100644 (file)
index b0459b1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Екранен предпазител „Лабиринт”"
-    IDS_TITLE       "За..."
-    IDS_TEXT        "Няма нужда от настройки."
-END
index 0225130..4f6d582 100644 (file)
@@ -1,8 +1,45 @@
 LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
 
-STRINGTABLE DISCARDABLE
+IDD_DLG_SCREEN DIALOGEX DISCARDABLE  0, 0, 276, 112
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Maze Bildschirmschoner Einstellungen"
+FONT 8, "MS Shell Dlg"
 BEGIN
-    IDS_DESCRIPTION "Maze Bildschirmschoner"
-    IDS_TITLE       "Über"
-    IDS_TEXT        "Keinerlei Einstellungen notwendig."
+    LTEXT           "Labyrinthgröße:",IDC_STATIC,7,7,90,12,SS_CENTERIMAGE
+    CONTROL         "Slider1",IDC_SLIDER_SIZE,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,101,7,140,12
+    CTEXT           "Static",IDC_TEXT_SIZE,245,7,24,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
+    LTEXT           "Vor-Lösungsverzögerung:",IDC_STATIC,7,28,90,12,SS_CENTERIMAGE
+    CONTROL         "Slider2",IDC_SLIDER_PRESD,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,101,28,140,12
+    CTEXT           "Static",IDC_TEXT_PRESD,245,28,24,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
+    LTEXT           "Nach-Lösungsverzögerung:",IDC_STATIC,7,49,90,12,SS_CENTERIMAGE
+    CONTROL         "Slider3",IDC_SLIDER_POSTSD,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,101,49,140,12
+    CTEXT           "Static",IDC_TEXT_POSTSD,245,49,24,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
+    LTEXT           "Lösungsverzögerung:",IDC_STATIC,7,70,90,12,SS_CENTERIMAGE
+    CONTROL         "Slider4",IDC_SLIDER_SD,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,101,70,140,12
+    CTEXT           "Static",IDC_TEXT_SD,245,70,24,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
+    DEFPUSHBUTTON   "OK",IDOK,59,91,50,14
+    PUSHBUTTON      "Abbrechen",IDCANCEL,113,91,50,14
+    PUSHBUTTON      "Über",IDABOUT,167,91,50,14
+END
+
+IDD_DLG_ABOUT DIALOGEX DISCARDABLE  0, 0, 229, 121
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Über"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    CTEXT           "Maze Bildschirmschoner 1.0",IDC_STATIC,7,7,215,9
+    LTEXT           "[06-21-85] Martin Weiss - Original Code",IDC_STATIC,7,20,215,8
+    LTEXT           "[01-29-88] Dave Lemke - Hacked für X11",IDC_STATIC,7,29,215,8
+    LTEXT           "[10-04-88] Richard Hess - UnHacked für X11",IDC_STATIC,7,38,215,8
+    LTEXT           "[03-03-93] Jim Randell - UnHacked für X11",IDC_STATIC,7,47,215,8
+    LTEXT           "[03-07-93] Jamie Zawinski - Bereinigung und Code Sauberkeit",IDC_STATIC,7,56,215,8
+    LTEXT           "[10-08-94] Ge van Geldorp - Portiert auf Windows",IDC_STATIC,7,65,215,8
+    LTEXT           "[08-15-03] Ge van Geldorp - Portiert auf ReactOS",IDC_STATIC,7,74,215,8
+    CTEXT           "R.I.P. Ge van Geldorp, wir vermissen dich!",IDC_STATIC,7,87,215,10,SS_SUNKEN
+    DEFPUSHBUTTON   "OK",IDOK,87,100,56,14
+END
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DESCRIPTION         "Maze Bildschirmschoner"
 END
index 75fb756..52de0a5 100644 (file)
@@ -1,8 +1,45 @@
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 
-STRINGTABLE DISCARDABLE
+IDD_DLG_SCREEN DIALOGEX DISCARDABLE  0, 0, 276, 112
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Maze ScreenSaver Settings"
+FONT 8, "MS Shell Dlg"
 BEGIN
-    IDS_DESCRIPTION "Maze ScreenSaver"
-    IDS_TITLE       "About"
-    IDS_TEXT        "No options need to be set."
+    LTEXT           "Maze Size:",IDC_STATIC,7,7,90,12,SS_CENTERIMAGE
+    CONTROL         "Slider1",IDC_SLIDER_SIZE,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,101,7,140,12
+    CTEXT           "Static",IDC_TEXT_SIZE,245,7,24,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
+    LTEXT           "Pre Solve Delay:",IDC_STATIC,7,28,90,12,SS_CENTERIMAGE
+    CONTROL         "Slider2",IDC_SLIDER_PRESD,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,101,28,140,12
+    CTEXT           "Static",IDC_TEXT_PRESD,245,28,24,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
+    LTEXT           "Post Solve Delay:",IDC_STATIC,7,49,90,12,SS_CENTERIMAGE
+    CONTROL         "Slider3",IDC_SLIDER_POSTSD,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,101,49,140,12
+    CTEXT           "Static",IDC_TEXT_POSTSD,245,49,24,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
+    LTEXT           "Solve Delay:",IDC_STATIC,7,70,90,12,SS_CENTERIMAGE
+    CONTROL         "Slider4",IDC_SLIDER_SD,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,101,70,140,12
+    CTEXT           "Static",IDC_TEXT_SD,245,70,24,12,SS_CENTERIMAGE,WS_EX_STATICEDGE
+    DEFPUSHBUTTON   "OK",IDOK,59,91,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,113,91,50,14
+    PUSHBUTTON      "About",IDABOUT,167,91,50,14
+END
+
+IDD_DLG_ABOUT DIALOGEX DISCARDABLE  0, 0, 229, 121
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    CTEXT           "Maze ScreenSaver 1.0",IDC_STATIC,7,7,215,9
+    LTEXT           "[06-21-85] Martin Weiss - Original Code",IDC_STATIC,7,20,215,8
+    LTEXT           "[01-29-88] Dave Lemke - Hacked for X11",IDC_STATIC,7,29,215,8
+    LTEXT           "[10-04-88] Richard Hess - UnHacked for X11",IDC_STATIC,7,38,215,8
+    LTEXT           "[03-03-93] Jim Randell - UnHacked for X11",IDC_STATIC,7,47,215,8
+    LTEXT           "[03-07-93] Jamie Zawinski - Cleanup and Code tidiness",IDC_STATIC,7,56,215,8
+    LTEXT           "[10-08-94] Ge van Geldorp - Ported to Windows",IDC_STATIC,7,65,215,8
+    LTEXT           "[08-15-03] Ge van Geldorp - Ported to ReactOS",IDC_STATIC,7,74,215,8
+    CTEXT           "R.I.P. Ge van Geldorp, we miss you!",IDC_STATIC,7,87,215,10,SS_SUNKEN
+    DEFPUSHBUTTON   "OK",IDOK,87,100,56,14
+END
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DESCRIPTION         "Maze Screensaver"
 END
diff --git a/rosapps/applications/screensavers/mazescr/lang/es-ES.rc b/rosapps/applications/screensavers/mazescr/lang/es-ES.rc
deleted file mode 100644 (file)
index 711c4c5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Laberinto"
-    IDS_TITLE       "Acerca de"
-    IDS_TEXT        "Ninguna opción necesita ser configurada."
-END
diff --git a/rosapps/applications/screensavers/mazescr/lang/fr-FR.rc b/rosapps/applications/screensavers/mazescr/lang/fr-FR.rc
deleted file mode 100644 (file)
index 70aa6ba..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Écran de veille labyrinthe"
-    IDS_TITLE       "À propos de"
-    IDS_TEXT        "Il n'y a aucune option à définir."
-END
diff --git a/rosapps/applications/screensavers/mazescr/lang/lt-LT.rc b/rosapps/applications/screensavers/mazescr/lang/lt-LT.rc
deleted file mode 100644 (file)
index 2d9af05..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LANGUAGE LANG_LITHUANIAN, SUBLANG_DEFAULT
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Labirintas"
-    IDS_TITLE       "Apie"
-    IDS_TEXT        "Nėra keičiamų parametrų."
-END
diff --git a/rosapps/applications/screensavers/mazescr/lang/no-NO.rc b/rosapps/applications/screensavers/mazescr/lang/no-NO.rc
deleted file mode 100644 (file)
index 2a9a086..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Maze Skjermsparer"
-    IDS_TITLE       "Om"
-    IDS_TEXT        "Ingen valg trengs å settes."
-END
diff --git a/rosapps/applications/screensavers/mazescr/lang/pl-PL.rc b/rosapps/applications/screensavers/mazescr/lang/pl-PL.rc
deleted file mode 100644 (file)
index f67be78..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- *      translated by Caemyr - Olaf Siejka (Feb, 2008)
- *      Use ReactOS forum PM or IRC to contact me
- *      http://www.reactos.org
- *      IRC: irc.freenode.net #reactos-pl;
- */
-
-LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Wygaszacz Labirynt"
-    IDS_TITLE       "O programie"
-    IDS_TEXT        "Brak opcji do ustawiania."
-END
diff --git a/rosapps/applications/screensavers/mazescr/lang/ro-RO.rc b/rosapps/applications/screensavers/mazescr/lang/ro-RO.rc
deleted file mode 100644 (file)
index 23af4cf..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * PROJECT:     ReactOS Maze ScreenSaver
- * LICENSE:     GPL - See COPYING in the top level directory
- * FILE:        rosapps/applications/screensavers/mazescr/lang/ro-RO.rc
- * PURPOSE:     Romanian Language File for Maze ScreenSaver
- * TRANSLATOR:  Ștefan Fulea (stefan dot fulea at mail dot md)
- */
-
-LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
-
-#pragma code_page(65001)
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Labirint (animație de inactivitate)"
-    IDS_TITLE       "Despre"
-    IDS_TEXT        "Nu este necesară stabilirea de opțiuni."
-END
diff --git a/rosapps/applications/screensavers/mazescr/lang/sk-SK.rc b/rosapps/applications/screensavers/mazescr/lang/sk-SK.rc
deleted file mode 100644 (file)
index d2f1d68..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* TRANSLATOR:  Mário Kačmár /Mario Kacmar/ aka Kario (kario@szm.sk)
- * DATE OF TR:  30-01-2008
- */
-
-LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Bludisko - šetrič obrazovky"
-    IDS_TITLE       "Čo je ..."
-    IDS_TEXT        "Nie sú potrebné žiadne nastavenia."
-END
diff --git a/rosapps/applications/screensavers/mazescr/lang/uk-UA.rc b/rosapps/applications/screensavers/mazescr/lang/uk-UA.rc
deleted file mode 100644 (file)
index 167f9f3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * PROJECT:     Maze ScreenSaver
- * LICENSE:     Public Domain
- * FILE:        rosapps/applications/screensavers/mazescr/lang/uk-UA.rc
- * PURPOSE:     Ukraianian Language File for Maze ScreenSaver
- * TRANSLATOR:  Artem Reznikov
- */
-
-LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION "Заставка ""Лабіринт"""
-    IDS_TITLE       "Про"
-    IDS_TEXT        "Ця заставка не має налаштовуваних параметрів."
-END
index fc40949..aef0e06 100644 (file)
 
 #define STRICT
 
+#include <windows.h>       /* required for all Windows applications */
+#include <scrnsave.h>
+#include <tchar.h>
 #include <stdlib.h>
+#include <commctrl.h>
 #include <string.h>
 #include <time.h>
-#include <windows.h>       /* required for all Windows applications */
-#include <scrnsave.h>
 #include "resource.h"
 
 #define APPNAME _T("Maze")
 
-//static BOOL InitInstance(HWND hParent);
 LRESULT CALLBACK ScreenSaverProc(HWND hWnd, UINT message, WPARAM uParam, LPARAM lParam);
 static int choose_door();
 static long backup();
@@ -71,9 +72,8 @@ HBRUSH hBrushDead;
 HBRUSH hBrushLiving;
 HPEN   hPenWall;
 HDC    hDC;
-//static BOOL waiting;
 
-static int solve_delay, pre_solve_delay, post_solve_delay;
+static int solve_delay, pre_solve_delay, post_solve_delay, size;
 
 #define MAX_MAZE_SIZE_X    ((unsigned long) 1000) // Dynamic detection?
 #define MAX_MAZE_SIZE_Y    ((unsigned long) 1000) // Dynamic detection?
@@ -119,6 +119,63 @@ static int start_x, start_y, start_dir, end_x, end_y, end_dir;
 static int grid_width, grid_height;
 static int bw;
 static int state = 1, pathi = 0;
+static LPCWSTR registryPath = _T("Software\\Microsoft\\ScreenSavers\\mazescr");
+
+static void SetDefaults()
+{
+    size = 10;
+    pre_solve_delay = 5000;
+    post_solve_delay = 5000;
+    solve_delay = 1;
+}
+
+static void ReadRegistry()
+{
+    LONG result;
+    HKEY skey;
+    DWORD valuetype, valuesize, val_size, val_presd, val_postsd, val_sd;
+
+    SetDefaults();
+
+    result = RegOpenKeyEx(HKEY_CURRENT_USER, registryPath, 0, KEY_READ, &skey);
+    if(result != ERROR_SUCCESS)
+        return;
+
+    valuesize = sizeof(DWORD);
+
+    result = RegQueryValueEx(skey, _T("size"), NULL, &valuetype, (LPBYTE)&val_size, &valuesize);
+    if(result == ERROR_SUCCESS)
+        size = val_size;
+    result = RegQueryValueEx(skey, _T("pre_solve_delay"), NULL, &valuetype, (LPBYTE)&val_presd, &valuesize);
+    if(result == ERROR_SUCCESS)
+        pre_solve_delay = val_presd;
+    result = RegQueryValueEx(skey, _T("post_solve_delay"), NULL, &valuetype, (LPBYTE)&val_postsd, &valuesize);
+    if(result == ERROR_SUCCESS)
+        post_solve_delay = val_postsd;
+    result = RegQueryValueEx(skey, _T("solve_delay"), NULL, &valuetype, (LPBYTE)&val_sd, &valuesize);
+    if(result == ERROR_SUCCESS)
+        solve_delay = val_sd;
+
+    RegCloseKey(skey);
+}
+
+static void WriteRegistry()
+{
+    LONG result;
+    HKEY skey;
+    DWORD disp;
+
+    result = RegCreateKeyEx(HKEY_CURRENT_USER, registryPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &skey, &disp);
+    if(result != ERROR_SUCCESS)
+        return;
+
+    RegSetValueEx(skey, _T("size"), 0, REG_DWORD, (LPBYTE)&size, sizeof(size));
+    RegSetValueEx(skey, _T("pre_solve_delay"), 0, REG_DWORD, (LPBYTE)&pre_solve_delay, sizeof(pre_solve_delay));
+    RegSetValueEx(skey, _T("post_solve_delay"), 0, REG_DWORD, (LPBYTE)&post_solve_delay, sizeof(post_solve_delay));
+    RegSetValueEx(skey, _T("solve_delay"), 0, REG_DWORD, (LPBYTE)&solve_delay, sizeof(solve_delay));
+
+    RegCloseKey(skey);
+}
 
 static void set_maze_sizes(width, height)
 int width, height;
@@ -417,7 +474,7 @@ static void draw_maze_border(HWND hWnd)    /* draw the maze outline */
         }
     }
 
-    hBrush = GetStockObject(WHITE_BRUSH);  // FIXME: do not hardcode
+    hBrush = GetStockObject(WHITE_BRUSH);
     draw_solid_square(start_x, start_y, start_dir, hDC, hBrush);
     draw_solid_square(end_x, end_y, end_dir, hDC, hBrush);
 }
@@ -520,14 +577,9 @@ static void start_timer(HWND hWnd, int iTimeout)
 
 static BOOL OnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
 {
-    int size;
-
     srand((unsigned) time(NULL));
 
-    size = GetPrivateProfileIntW(L"maze", L"gridsize", 10, L"maze.ini");
-    pre_solve_delay = GetPrivateProfileIntW(L"maze", L"predelay", 5000, L"maze.ini");
-    post_solve_delay = GetPrivateProfileIntW(L"maze", L"postdelay", 5000, L"maze.ini");
-    solve_delay = GetPrivateProfileIntW(L"maze", L"solvedelay", 1, L"maze.ini");
+    ReadRegistry();
 
     if (size < 2) {
         size = 7 + (rand() % 30);
@@ -580,6 +632,34 @@ static BOOL OnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
     return TRUE;
 }
 
+BOOL WINAPI AboutProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
+{
+    switch(message){
+    case WM_COMMAND:
+        switch(LOWORD(wparam)){
+        case IDOK:
+            EndDialog(hWnd, LOWORD(wparam));
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+static void ReadSettings(HWND hWnd)
+{
+    size = SendDlgItemMessage(hWnd, IDC_SLIDER_SIZE, TBM_GETPOS, 0, 0);
+    SetDlgItemInt(hWnd, IDC_TEXT_SIZE, size, FALSE);
+
+    pre_solve_delay = SendDlgItemMessage(hWnd, IDC_SLIDER_PRESD, TBM_GETPOS, 0, 0);
+    SetDlgItemInt(hWnd, IDC_TEXT_PRESD, pre_solve_delay, FALSE);
+    
+    post_solve_delay = SendDlgItemMessage(hWnd, IDC_SLIDER_POSTSD, TBM_GETPOS, 0, 0);
+    SetDlgItemInt(hWnd, IDC_TEXT_POSTSD, post_solve_delay, FALSE);
+
+    solve_delay = SendDlgItemMessage(hWnd, IDC_SLIDER_SD, TBM_GETPOS, 0, 0);
+    SetDlgItemInt(hWnd, IDC_TEXT_SD, solve_delay, FALSE);
+}
+
 LRESULT CALLBACK ScreenSaverProc(
     HWND hWnd,         // window handle
     UINT message,      // type of message
@@ -646,18 +726,48 @@ LRESULT CALLBACK ScreenSaverProc(
 
 BOOL WINAPI ScreenSaverConfigureDialog(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
 {
-    return TRUE;
+    switch (message)
+    {
+        case WM_INITDIALOG:
+            ReadRegistry();
+            //Set slider ranges
+            SendDlgItemMessage(hWnd, IDC_SLIDER_SIZE, TBM_SETRANGE, FALSE, MAKELPARAM(5, 64));
+            SendDlgItemMessage(hWnd, IDC_SLIDER_PRESD, TBM_SETRANGE, FALSE, MAKELPARAM(1, 10000));
+            SendDlgItemMessage(hWnd, IDC_SLIDER_POSTSD, TBM_SETRANGE, FALSE, MAKELPARAM(1, 10000));
+            SendDlgItemMessage(hWnd, IDC_SLIDER_SD, TBM_SETRANGE, FALSE, MAKELPARAM(1, 10000));
+            //Set current values to slider
+            SendDlgItemMessage(hWnd, IDC_SLIDER_SIZE, TBM_SETPOS, TRUE, size);
+            SendDlgItemMessage(hWnd, IDC_SLIDER_PRESD, TBM_SETPOS, TRUE, pre_solve_delay);
+            SendDlgItemMessage(hWnd, IDC_SLIDER_POSTSD, TBM_SETPOS, TRUE, post_solve_delay);
+            SendDlgItemMessage(hWnd, IDC_SLIDER_SD, TBM_SETPOS, TRUE, solve_delay);
+            //Set current values to texts
+            SetDlgItemInt(hWnd, IDC_TEXT_SIZE, size, FALSE);
+            SetDlgItemInt(hWnd, IDC_TEXT_PRESD, pre_solve_delay, FALSE);
+            SetDlgItemInt(hWnd, IDC_TEXT_POSTSD, post_solve_delay, FALSE);
+            SetDlgItemInt(hWnd, IDC_TEXT_SD, solve_delay, FALSE);
+            return TRUE;
+        case WM_COMMAND:
+            switch (LOWORD(wparam))
+            {
+                case IDOK:
+                    WriteRegistry();
+                    EndDialog(hWnd, TRUE);
+                    return TRUE;
+                case IDCANCEL:
+                    EndDialog(hWnd, TRUE);
+                    break;
+                case IDABOUT:
+                    DialogBox(hMainInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hWnd, (DLGPROC)AboutProc);
+                    break;
+            }
+        case WM_HSCROLL:
+            ReadSettings(hWnd);
+            return TRUE;
+    }
+    return FALSE;
 }
 
 BOOL WINAPI RegisterDialogClasses(HANDLE hmodule)
 {
-    TCHAR szTitle[256];
-    TCHAR szText[256];
-
-    LoadString(hmodule, IDS_TITLE, szTitle, 256);
-
-    LoadString(hmodule, IDS_TEXT, szText, 256);
-
-    MessageBox(0, szText, szTitle, MB_OK | MB_ICONWARNING);
     return TRUE;
 }
index 023c2c1..9775f52 100644 (file)
@@ -1,5 +1,4 @@
 #include <windows.h>
-#include <scrnsave.h>
 #include "resource.h"
 
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
@@ -8,46 +7,23 @@ IDI_ICON  ICON  DISCARDABLE  "res/icon_mazescr.ico"
 
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION    "Maze ScreenSaver\0"
-#define REACTOS_STR_INTERNAL_NAME       "maze\0"
-#define REACTOS_STR_ORIGINAL_FILENAME   "maze.scr\0"
+#define REACTOS_STR_INTERNAL_NAME       "Maze\0"
+#define REACTOS_STR_ORIGINAL_FILENAME   "mazescr.scr\0"
 
 #include <reactos/version.rc>
 
 #include <reactos/manifest_exe.rc>
 
+#ifndef IDC_STATIC
+#define IDC_STATIC    -1
+#endif
+
 /* UTF-8 */
 #pragma code_page(65001)
 
-#ifdef LANGUAGE_BG_BG
-    #include "lang/bg-BG.rc"
-#endif
 #ifdef LANGUAGE_DE_DE
     #include "lang/de-DE.rc"
 #endif
 #ifdef LANGUAGE_EN_US
     #include "lang/en-US.rc"
 #endif
-#ifdef LANGUAGE_ES_ES
-    #include "lang/es-ES.rc"
-#endif
-#ifdef LANGUAGE_FR_FR
-    #include "lang/fr-FR.rc"
-#endif
-#ifdef LANGUAGE_LT_LT
-    #include "lang/lt-LT.rc"
-#endif
-#ifdef LANGUAGE_NO_NO
-    #include "lang/no-NO.rc"
-#endif
-#ifdef LANGUAGE_PL_PL
-    #include "lang/pl-PL.rc"
-#endif
-#ifdef LANGUAGE_RO_RO
-    #include "lang/ro-RO.rc"
-#endif
-#ifdef LANGUAGE_SK_SK
-    #include "lang/sk-SK.rc"
-#endif
-#ifdef LANGUAGE_UK_UA
-    #include "lang/uk-UA.rc"
-#endif
index 4b748e5..efc3850 100644 (file)
@@ -1,6 +1,15 @@
 #pragma once
 
-#define IDS_DESCRIPTION 1
-#define IDS_TITLE       2
-#define IDS_TEXT        3
-#define IDI_ICON        101
+#define IDS_DESCRIPTION    1
+#define IDABOUT            10
+#define IDI_ICON           101
+#define IDD_DLG_ABOUT      110
+#define IDC_SLIDER_SIZE    1000
+#define IDC_SLIDER_PRESD   1001
+#define IDC_SLIDER_POSTSD  1002
+#define IDC_SLIDER_SD      1003
+#define IDC_TEXT_SIZE      1004
+#define IDC_TEXT_PRESD     1005
+#define IDC_TEXT_POSTSD    1006
+#define IDC_TEXT_SD        1007
+#define IDD_DLG_SCREEN     2003