SaveSystemAcctInputSettings function

Applies the user keyboard layout and text service setting to the system accounts hive.

Syntax

BOOL CALLBACK SaveSystemAcctInputSettings(
  _In_ HWND hwndParent,
  _In_ HKEY hSourceRegKey
);

Parameters

hwndParent [in]

The parent window for the warning dialog box. The warning dialog box is not always shown and appears appropriately. If this parameter is NULL, the warning dialog box will not be shown.

hSourceRegKey [in]

The root registry key of the user setting to be copied.

Return value

Return code Description
TRUE
The function was successful.
FALSE
An unspecified error occurred.

Remarks

The system account hive is HKEY_USERS\.DEFAULT, HKEY_USERS\S-1-5-19, and HKEY_USERS\S-1-5-20.

Examples

There is no import library available that defines this function, so it is necessary to obtain a pointer to this function using LoadLibrary and GetProcAddress. The following example demonstrates how to obtain a pointer to this function.

Note

Using LoadLibrary incorrectly can compromise the security of your application by loading the wrong DLL. Refer to Dynamic-Link Library Search Order for information on how to correctly load DLLs with different versions of Microsoft Windows.

typedef HRESULT (WINAPI *PTF_ SAVESYSTEMACCTINPUTSETTINGS)(HWND hwndParent, HKEY hSourceRegKey);

HMODULE hInputDLL = LoadLibrary(TEXT("input.dll"));
BOOL bRet = FALSE;

if(hInputDLL == NULL)
{
    // Error loading module; fail as securely as possible. 
}
else
{
    PTF_ SAVESYSTEMACCTINPUTSETTINGS pfnSaveSystemAcctInputSettings;
    
    pfnSaveSystemAcctInputSettings = (PTF_ SAVESYSTEMACCTINPUTSETTINGS)GetProcAddress(hInputDLL, "SaveSystemAcctInputSettings ");

    if(pfnSaveSystemAcctInputSettings)
    {
        bRet = (*pfnSaveSystemAcctInputSettings)( hwndParent, hSourceRegKey);
    }

    FreeLibrary(hInputDLL);
}

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
DLL
Input.dll