2 * PROJECT: ReactOS On-Screen Keyboard
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Settings file for warning dialog on startup
5 * COPYRIGHT: Copyright 2018 Bișoc George (fraizeraust99 at gmail dot com)
8 /* INCLUDES *******************************************************************/
13 /* FUNCTIONS *******************************************************************/
15 BOOL
LoadDataFromRegistry()
20 DWORD cbData
= sizeof(DWORD
);
22 /* Set the structure member to TRUE */
23 Globals
.bShowWarning
= TRUE
;
25 /* Open the key, so that we can query it */
26 lResult
= RegOpenKeyExW(HKEY_CURRENT_USER
,
27 L
"Software\\Microsoft\\osk",
32 if (lResult
!= ERROR_SUCCESS
)
34 /* Bail out and return FALSE if we fail */
39 lResult
= RegQueryValueExW(hKey
,
46 if (lResult
!= ERROR_SUCCESS
)
48 /* Bail out and return FALSE if we fail */
53 /* Load the data value (it can be either FALSE or TRUE depending on the data itself) */
54 Globals
.bShowWarning
= (dwData
!= 0);
56 /* If we're here then we succeed, close the key and return TRUE */
61 BOOL
SaveDataToRegistry()
67 /* If no key has been made, create one */
68 lResult
= RegCreateKeyExW(HKEY_CURRENT_USER
,
69 L
"Software\\Microsoft\\osk",
78 if (lResult
!= ERROR_SUCCESS
)
80 /* Bail out and return FALSE if we fail */
84 /* The data value of the subkey will be appended to the warning dialog switch */
85 dwData
= Globals
.bShowWarning
;
87 lResult
= RegSetValueExW(hKey
,
94 if (lResult
!= ERROR_SUCCESS
)
96 /* Bail out and return FALSE if we fail */
101 /* If we're here then we succeed, close the key and return TRUE */