Nuta
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować się zalogować lub zmienić katalog.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
Enables the specified keyboard layouts or text services for the specified user.
Syntax
BOOL CALLBACK InstallLayoutOrTipUserReg(
_In_opt_ LPCWSTR pszUserReg,
_In_opt_ LPCWSTR pszSystemReg,
_In_opt_ LPCWSTR pszSoftwareReg,
_In_ LPCWSTR psz,
_In_ DWORD dwFlags
);
Parameters
-
pszUserReg [in, optional]
-
The registry path of the user. If this parameter is NULL, HKEY_CURRENT_USER is used.
-
pszSystemReg [in, optional]
-
The registry path of the system. If this parameter is NULL, HKEY_LOCAL_MACHINE\System is used.
-
pszSoftwareReg [in, optional]
-
The registry path of the software. If this parameter is NULL, HKEY_LOCAL_MACHINE\Software is used.
-
psz [in]
-
A string that represents the keyboard layout list or text services profile list.
-
dwFlags [in]
-
A bitfield that specifies the following flags.
Note
The following identifiers are not defined in a public header file. You must either use the hexadecimal value or #define the identifiers. For example, to use ILOT_UNINSTALL you must include
#define ILOT_UNINSTALL 0x00000001in your code.Value Meaning - ILOT_UNINSTALL
- 0x00000001
Same as ILOT_DISABLED. - ILOT_DEFPROFILE
- 0x00000002
Sets the specified layout or tip as a default item. - ILOT_NOAPPLYTOCURRENTSESSION
- 0x00000020
The setting is saved but is not applied to the current session. - ILOT_CLEANINSTALL
- 0x00000040
Disables all of the current keyboard layouts and text services. - ILOT_DISABLED
- 0x00000080
Disables the specified keyboard layout and text service.
Return value
| Return code | Description |
|---|---|
|
The function was successful. |
|
An unspecified error occurred. |
Remarks
The string format of the layout list is:
<LangID 1>:<KLID 1>;[...<LangID N>:<KLID N>
The string format of the text service profile list is:
<LangID 1>:{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx};
The following is an example of a value for the psz parameter:
"0x0407:0x00000407"
"0x0407:0x00000407;0x040C:0x0000040C"
"0x0407:0x00000407;0x0412:{A028AE76-01B1-46C2-99C4-ACD9858AE02F}{B5FE1F02-D5F2-4445-9C03-C568F23C99A1};0x040C:0x0000040C"
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_ INSTALLLAYOUTORTIPUSERREG)(LPCWSTR pszUserReg,
LPCWSTR pszSystemReg,
LPCWSTR pszSoftwareReg,
LPCWSTR psz,
DWORD dwFlasg);
HMODULE hInputDLL = LoadLibrary(TEXT("input.dll"));
BOOL bRet = FALSE;
if(hInputDLL == NULL)
{
// Error loading module; fail as securely as possible.
}
else
{
PTF_ INSTALLLAYOUTORTIPUSERREG pfnInputLayoutOrTipUserReg;
pfnInputLayoutOrTipUserReg = (PTF_ INSTALLLAYOUTORTIPUSERREG)GetProcAddress(hInputDLL, "InputLayoutOrTipUserReg");
if(pfnInputLayoutOrTipUserReg)
{
bRet = (*pfnInputLayoutOrTipUserReg)(pszUserReg, pszSystemReg, pszSoftwareReg, psz, dwFlags);
}
FreeLibrary(hInputDLL);
}
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client |
Windows Vista [desktop apps only] |
| Minimum supported server |
Windows Server 2008 [desktop apps only] |
| DLL |
|