共用方式為


InstallLayoutOrTipUserReg 函式

為指定的使用者啟用指定的鍵盤配置或文字服務。

語法

BOOL CALLBACK InstallLayoutOrTipUserReg(
  _In_opt_ LPCWSTR pszUserReg,
  _In_opt_ LPCWSTR pszSystemReg,
  _In_opt_ LPCWSTR pszSoftwareReg,
  _In_     LPCWSTR psz,
  _In_     DWORD   dwFlags
);

參數

pszUserReg [in, optional]

使用者的登錄路徑。 如果此參數為 Null,則會使用HKEY_CURRENT_USER。

pszSystemReg [in, optional]

系統的登錄路徑。 如果此參數為 Null,則會使用HKEY_LOCAL_MACHINE\System。

pszSoftwareReg [in, optional]

軟體的登錄路徑。 如果此參數為 Null,則會使用HKEY_LOCAL_MACHINE\Software。

psz [in]

表示鍵盤配置清單或文字服務配置檔案清單的字串。

dwFlags [in]

指定下列旗標的 bitfield。

注意

公用標頭檔中未定義下列識別碼。 您必須使用十六進位值,或#define識別碼。 例如,若要使用 ILOT_UNINSTALL 您必須包含在 #define ILOT_UNINSTALL 0x00000001 程式碼中。

意義
ILOT_UNINSTALL
0x00000001
ILOT_DISABLED相同。
ILOT_DEFPROFILE
0x00000002
將指定的版面配置或提示設定為預設專案。
ILOT_NOAPPLYTOCURRENTSESSION
0x00000020
設定會儲存,但不會套用至目前的會話。
ILOT_CLEANINSTALL
0x00000040
停用所有目前的鍵盤配置和文字服務。
ILOT_DISABLED
0x00000080
停用指定的鍵盤配置和文字服務。

傳回值

傳回碼 Description
TRUE
函式成功。
FASE
發生未指定的錯誤。

備註

版面配置清單的字串格式為:

<LangID 1 > : < KLID 1 > ;[...<LangID N > : < KLID N>

文字服務配置檔案清單的字串格式為:

<LangID 1 > :{xxxxxxxx-xxxx-xxx}{xxxxxxxx-xxxx-xxxx-xxxxxxxxx};

以下是 psz 參數值的範例:

"0x0407:0x00000407"
"0x0407:0x00000407;0x040C:0x0000040C"
"0x0407:0x00000407;0x0412:{A028AE76-01B1-46C2-99C4-ACD9858AE02F}{B5FE1F02-D5F2-4445-9C03-C568F23C99A1};0x040C:0x0000040C"

範例

沒有可定義此函式的匯入程式庫,因此必須使用 LoadLibraryGetProcAddress取得此函式的指標。 下列範例示範如何取得此函式的指標。

注意

使用 LoadLibrary 不正確可能會藉由載入錯誤的 DLL 來危害應用程式的安全性。 如需如何使用不同 Microsoft Windows 版本正確載入 DLL 的資訊,請參閱 動態連結程式庫搜尋順序

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);
}

規格需求

需求
最低支援的用戶端
Windows Vista [僅限傳統型應用程式]
最低支援的伺服器
Windows Server 2008 [僅限傳統型應用程式]
DLL
Input.dll