SaveDefaultUserInputSettings function

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

Syntax

BOOL CALLBACK SaveDefaultUserInputSettings(
  _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.

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_ SAVEDEFAULTUSERINPUTSETTINGS)(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_ SAVEDEFAULTUSERINPUTSETTINGS pfnSaveDefaultUserInputSettings;
    
    pfnSaveDefaultUserInputSettings = (PTF_ SAVEDEFAULTUSERINPUTSETTINGS)GetProcAddress(hInputDLL, "SaveDefaultUserInputSettings ");

    if(pfnSaveDefaultUserInputSettings)
    {
        bRet = (*pfnSaveDefaultUserInputSettings)( 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