https://git.reactos.org/?p=reactos.git;a=commitdiff;h=34c812365f81686c99f0c2ad2602da712617183e

commit 34c812365f81686c99f0c2ad2602da712617183e
Author:     Bișoc George <[email protected]>
AuthorDate: Sat Nov 17 21:27:33 2018 +0100
Commit:     Hermès BÉLUSCA - MAÏTO <[email protected]>
CommitDate: Sat Nov 17 21:27:33 2018 +0100

    [OSK] Implement the welcome box (#1007)
    
    In Windows XP, both in On-Screen Keyboard and in Magnify there is a welcome 
box which is shown upon startup of the application. This feature is already 
implemented for Magnify in ReactOS which however in On-Screen Keyboard is still 
unimplemented.
---
 base/applications/osk/CMakeLists.txt |   2 +-
 base/applications/osk/lang/ar-DZ.rc  |  12 ++++
 base/applications/osk/lang/cs-CZ.rc  |  12 ++++
 base/applications/osk/lang/de-DE.rc  |  12 ++++
 base/applications/osk/lang/en-GB.rc  |  12 ++++
 base/applications/osk/lang/en-US.rc  |  12 ++++
 base/applications/osk/lang/es-ES.rc  |  12 ++++
 base/applications/osk/lang/fr-CA.rc  |  12 ++++
 base/applications/osk/lang/fr-FR.rc  |  12 ++++
 base/applications/osk/lang/he-IL.rc  |  12 ++++
 base/applications/osk/lang/it-IT.rc  |  12 ++++
 base/applications/osk/lang/pl-PL.rc  |  12 ++++
 base/applications/osk/lang/ro-RO.rc  |  12 ++++
 base/applications/osk/lang/ru-RU.rc  |  12 ++++
 base/applications/osk/lang/tr-TR.rc  |  12 ++++
 base/applications/osk/lang/zh-CN.rc  |  12 ++++
 base/applications/osk/lang/zh-TW.rc  |  12 ++++
 base/applications/osk/main.c         |  54 ++++++++++++++++++
 base/applications/osk/main.h         |   1 +
 base/applications/osk/osk_res.h      |   3 +
 base/applications/osk/settings.c     | 104 +++++++++++++++++++++++++++++++++++
 base/applications/osk/settings.h     |  15 +++++
 22 files changed, 370 insertions(+), 1 deletion(-)

diff --git a/base/applications/osk/CMakeLists.txt 
b/base/applications/osk/CMakeLists.txt
index a6451ea227..51ff4f3a42 100644
--- a/base/applications/osk/CMakeLists.txt
+++ b/base/applications/osk/CMakeLists.txt
@@ -1,7 +1,7 @@
 
 file(GLOB osk_rc_deps res/*.*)
 add_rc_deps(rsrc.rc ${osk_rc_deps})
-add_executable(osk main.c rsrc.rc)
+add_executable(osk main.c settings.c rsrc.rc)
 set_module_type(osk win32gui UNICODE)
 add_importlibs(osk comdlg32 shell32 user32 gdi32 advapi32 comctl32 msvcrt 
kernel32)
 add_cd_file(TARGET osk DESTINATION reactos/system32 FOR all)
diff --git a/base/applications/osk/lang/ar-DZ.rc 
b/base/applications/osk/lang/ar-DZ.rc
index fa99defaaa..3fc9a277c2 100644
--- a/base/applications/osk/lang/ar-DZ.rc
+++ b/base/applications/osk/lang/ar-DZ.rc
@@ -125,4 +125,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/cs-CZ.rc 
b/base/applications/osk/lang/cs-CZ.rc
index 7361e3cbaa..f3d03f7d5b 100644
--- a/base/applications/osk/lang/cs-CZ.rc
+++ b/base/applications/osk/lang/cs-CZ.rc
@@ -125,4 +125,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/de-DE.rc 
b/base/applications/osk/lang/de-DE.rc
index 704dfedabf..02f714ec32 100644
--- a/base/applications/osk/lang/de-DE.rc
+++ b/base/applications/osk/lang/de-DE.rc
@@ -126,4 +126,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/en-GB.rc 
b/base/applications/osk/lang/en-GB.rc
index e3e541ba72..03572dd06c 100644
--- a/base/applications/osk/lang/en-GB.rc
+++ b/base/applications/osk/lang/en-GB.rc
@@ -126,4 +126,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/en-US.rc 
b/base/applications/osk/lang/en-US.rc
index 9c29b65aff..890894b09f 100644
--- a/base/applications/osk/lang/en-US.rc
+++ b/base/applications/osk/lang/en-US.rc
@@ -125,4 +125,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,443,15,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/es-ES.rc 
b/base/applications/osk/lang/es-ES.rc
index 5fe569721e..aa8c6a3e0c 100644
--- a/base/applications/osk/lang/es-ES.rc
+++ b/base/applications/osk/lang/es-ES.rc
@@ -127,4 +127,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/fr-CA.rc 
b/base/applications/osk/lang/fr-CA.rc
index 0cbbf7abb1..faa3b5cdfc 100644
--- a/base/applications/osk/lang/fr-CA.rc
+++ b/base/applications/osk/lang/fr-CA.rc
@@ -126,4 +126,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/fr-FR.rc 
b/base/applications/osk/lang/fr-FR.rc
index 5e126341fc..5c490481bd 100644
--- a/base/applications/osk/lang/fr-FR.rc
+++ b/base/applications/osk/lang/fr-FR.rc
@@ -126,4 +126,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/he-IL.rc 
b/base/applications/osk/lang/he-IL.rc
index 52d0887db3..7be0c0278f 100644
--- a/base/applications/osk/lang/he-IL.rc
+++ b/base/applications/osk/lang/he-IL.rc
@@ -125,4 +125,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/it-IT.rc 
b/base/applications/osk/lang/it-IT.rc
index 3af1a12e2d..6a7a34e8bf 100644
--- a/base/applications/osk/lang/it-IT.rc
+++ b/base/applications/osk/lang/it-IT.rc
@@ -126,4 +126,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,443,15,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/pl-PL.rc 
b/base/applications/osk/lang/pl-PL.rc
index 4c89b54e31..8e97f9877b 100644
--- a/base/applications/osk/lang/pl-PL.rc
+++ b/base/applications/osk/lang/pl-PL.rc
@@ -125,4 +125,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/ro-RO.rc 
b/base/applications/osk/lang/ro-RO.rc
index 4910a6f6e7..7a4d358ac7 100644
--- a/base/applications/osk/lang/ro-RO.rc
+++ b/base/applications/osk/lang/ro-RO.rc
@@ -126,4 +126,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,443,15,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/ru-RU.rc 
b/base/applications/osk/lang/ru-RU.rc
index 3a042884e3..a551634828 100644
--- a/base/applications/osk/lang/ru-RU.rc
+++ b/base/applications/osk/lang/ru-RU.rc
@@ -125,4 +125,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,443,15,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/tr-TR.rc 
b/base/applications/osk/lang/tr-TR.rc
index 107233d9a9..1d1f16ca4f 100644
--- a/base/applications/osk/lang/tr-TR.rc
+++ b/base/applications/osk/lang/tr-TR.rc
@@ -125,4 +125,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/zh-CN.rc 
b/base/applications/osk/lang/zh-CN.rc
index 33d219a41c..e873cc4434 100644
--- a/base/applications/osk/lang/zh-CN.rc
+++ b/base/applications/osk/lang/zh-CN.rc
@@ -127,4 +127,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/lang/zh-TW.rc 
b/base/applications/osk/lang/zh-TW.rc
index 3a9325dab4..e38779503d 100644
--- a/base/applications/osk/lang/zh-TW.rc
+++ b/base/applications/osk/lang/zh-TW.rc
@@ -127,4 +127,16 @@ BEGIN
     CONTROL         "",IDC_LED_SCROLL,"Static",SS_CENTER|SS_NOTIFY,580,16,4,3
 END
 
+IDD_WARNINGDIALOG_OSK DIALOGEX 0, 0, 250, 97
+STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION "On-Screen Keyboard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14
+    ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20
+    LTEXT "On-Screen Keyboard provides a minimum level of functionality for 
mobility-impaired users. Mobility-impaired users will need a utility program 
with higher functionality for daily use.", IDC_STATIC, 36, 7, 207, 33
+    CONTROL "Do not show this message again", IDC_SHOWWARNINGCHECK, "Button",
+            BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10
+END
+
 /* EOF */
diff --git a/base/applications/osk/main.c b/base/applications/osk/main.c
index 9932f7937a..6c1793353c 100644
--- a/base/applications/osk/main.c
+++ b/base/applications/osk/main.c
@@ -9,6 +9,7 @@
 /* INCLUDES 
*******************************************************************/
 
 #include "osk.h"
+#include "settings.h"
 
 /* GLOBALS 
********************************************************************/
 
@@ -57,6 +58,47 @@ int OSK_SetImage(int IdDlgItem, int IdResource)
     return TRUE;
 }
 
+/***********************************************************************
+ *
+ *          OSK_WarningProc
+ *
+ *  Function handler for the warning dialog box on startup
+ */
+INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM 
lParam)
+{
+    UNREFERENCED_PARAMETER(lParam);
+
+    switch (Msg)
+    {
+        case WM_INITDIALOG:
+        {
+            return TRUE;
+        }
+
+        case WM_COMMAND:
+        {
+            switch (LOWORD(wParam))
+            {
+                case IDC_SHOWWARNINGCHECK:
+                {
+                    Globals.bShowWarning = !IsDlgButtonChecked(hDlg, 
IDC_SHOWWARNINGCHECK);
+                    return TRUE;
+                }
+
+                case IDOK:
+                case IDCANCEL:
+                {
+                    EndDialog(hDlg, LOWORD(wParam));
+                    return TRUE;
+                }
+            }
+            break;
+        }
+    }
+
+    return FALSE;
+}
+
 
 /***********************************************************************
  *
@@ -74,6 +116,9 @@ int OSK_DlgInitDialog(HWND hDlg)
     /* Save handle */
     Globals.hMainWnd = hDlg;
 
+    /* Load the settings from the registry hive */
+    LoadDataFromRegistry();
+
     /* Get screen info */
     memset(&Pt, 0, sizeof(Pt));
     monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY );
@@ -115,6 +160,12 @@ int OSK_DlgInitDialog(HWND hDlg)
     /* Set a timer for periodics tasks */
     Globals.iTimer = SetTimer(hDlg, 0, 200, NULL);
 
+    /* If the member of the struct (bShowWarning) is set then display the 
dialog box */
+    if (Globals.bShowWarning)
+    {
+        DialogBox(Globals.hInstance, MAKEINTRESOURCE(IDD_WARNINGDIALOG_OSK), 
Globals.hMainWnd, OSK_WarningProc);
+    }
+
     return TRUE;
 }
 
@@ -139,6 +190,9 @@ int OSK_DlgClose(void)
     /* delete GDI objects */
     if (Globals.hBrushGreenLed) DeleteObject(Globals.hBrushGreenLed);
 
+    /* Save the settings to the registry hive */
+    SaveDataToRegistry();
+
     return TRUE;
 }
 
diff --git a/base/applications/osk/main.h b/base/applications/osk/main.h
index 9c698e6aa7..ca7922d030 100644
--- a/base/applications/osk/main.h
+++ b/base/applications/osk/main.h
@@ -23,6 +23,7 @@ typedef struct
     UINT_PTR   iTimer;
     /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
     HWND       hActiveWnd;
+    BOOL       bShowWarning;
 } OSK_GLOBALS;
 
 /* DEFINES 
********************************************************************/
diff --git a/base/applications/osk/osk_res.h b/base/applications/osk/osk_res.h
index 3c88d8bafc..120632d742 100644
--- a/base/applications/osk/osk_res.h
+++ b/base/applications/osk/osk_res.h
@@ -11,6 +11,7 @@
 #define IDC_LED_NUM             100
 #define IDC_LED_CAPS            101
 #define IDC_LED_SCROLL          102
+#define IDC_SHOWWARNINGCHECK    103
 
 #define IDI_OSK                 200
 #define IDI_BACK                201
@@ -28,6 +29,8 @@
 #define IDI_RIGHT               213
 #define IDI_BOTTOM              214
 
+#define IDD_WARNINGDIALOG_OSK   215
+
 #define IDC_STATIC              -1
 
 
diff --git a/base/applications/osk/settings.c b/base/applications/osk/settings.c
new file mode 100644
index 0000000000..33f8893d57
--- /dev/null
+++ b/base/applications/osk/settings.c
@@ -0,0 +1,104 @@
+/*
+ * PROJECT:         ReactOS On-Screen Keyboard
+ * LICENSE:         GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE:         Settings file for warning dialog on startup
+ * COPYRIGHT:       Copyright 2018 Bișoc George (fraizeraust99 at gmail dot 
com)
+ */
+
+/* INCLUDES 
*******************************************************************/
+
+#include "osk.h"
+#include "settings.h"
+
+/* FUNCTIONS 
*******************************************************************/
+
+BOOL LoadDataFromRegistry()
+{
+    HKEY hKey;
+    LONG lResult;
+    DWORD dwData;
+    DWORD cbData = sizeof(DWORD);
+
+    /* Set the structure member to TRUE */
+    Globals.bShowWarning = TRUE;
+
+    /* Open the key, so that we can query it */
+    lResult = RegOpenKeyExW(HKEY_CURRENT_USER,
+                            L"Software\\Microsoft\\osk",
+                            0,
+                            KEY_READ,
+                            &hKey);
+
+    if (lResult != ERROR_SUCCESS)
+    {
+        /* Bail out and return FALSE if we fail */
+        return FALSE;
+    }
+
+    /* Query the key */
+    lResult = RegQueryValueExW(hKey,
+                               L"ShowWarning",
+                               0,
+                               0,
+                               (BYTE *)&dwData,
+                               &cbData);
+
+    if (lResult != ERROR_SUCCESS)
+    {
+        /* Bail out and return FALSE if we fail */
+        RegCloseKey(hKey);
+        return FALSE;
+    }
+
+    /* Load the data value (it can be either FALSE or TRUE depending on the 
data itself) */
+    Globals.bShowWarning = (dwData != 0);
+    
+    /* If we're here then we succeed, close the key and return TRUE */
+    RegCloseKey(hKey);
+    return TRUE;
+}
+
+BOOL SaveDataToRegistry()
+{
+    HKEY hKey;
+    LONG lResult;
+    DWORD dwData;
+
+    /* If no key has been made, create one */
+    lResult = RegCreateKeyExW(HKEY_CURRENT_USER,
+                              L"Software\\Microsoft\\osk",
+                              0,
+                              NULL,
+                              0,
+                              KEY_WRITE,
+                              NULL,
+                              &hKey,
+                              NULL);
+
+    if (lResult != ERROR_SUCCESS)
+    {
+        /* Bail out and return FALSE if we fail */
+        return FALSE;
+    }
+
+    /* The data value of the subkey will be appended to the warning dialog 
switch */
+    dwData = Globals.bShowWarning;
+
+    lResult = RegSetValueExW(hKey,
+                             L"ShowWarning",
+                             0,
+                             REG_DWORD,
+                             (BYTE *)&dwData,
+                             sizeof(dwData));
+
+    if (lResult != ERROR_SUCCESS)
+    {
+        /* Bail out and return FALSE if we fail */
+        RegCloseKey(hKey);
+        return FALSE;
+    }
+
+    /* If we're here then we succeed, close the key and return TRUE */
+    RegCloseKey(hKey);
+    return TRUE;
+}
diff --git a/base/applications/osk/settings.h b/base/applications/osk/settings.h
new file mode 100644
index 0000000000..05e122a4ff
--- /dev/null
+++ b/base/applications/osk/settings.h
@@ -0,0 +1,15 @@
+/*
+ * PROJECT:         ReactOS On-Screen Keyboard
+ * LICENSE:         GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE:         Settings header file with function prototypes
+ * COPYRIGHT:       Copyright 2018 Bișoc George (fraizeraust99 at gmail dot 
com)
+ */
+
+#ifndef SETTINGS_OSK_H
+#define SETTINGS_OSK_H
+
+BOOL LoadDataFromRegistry(VOID);
+BOOL SaveDataToRegistry(VOID);
+INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM 
lParam);
+
+#endif // SETTINGS_OSK_H

Reply via email to