网站首页  词典首页

请输入您要查询的函数:

 

术语 loadkeyboardlayout
释义 LoadKeyboardLayout
语法:
HKL LoadKeyboardLayout( LPCTSTR pwszKLID,
UINT Flags
);
LoadKeyboardLayout功能
该LoadKeyboardLayout函数加载一个新的输入区域设置标识符(前称的键盘布局)进入系统。几个输入法区域设置标识符可以被装载在某一时间,但只有一个进程,是一次积极的。装入多个输入法区域设置标识符使得有可能在它们之间快速切换。
参数
pwszKLID
[in]指向的缓冲区指定输入法区域设置标识符名称加载。此名称是对语言标识符(低位字)和设备标识符(高字)十六进制值组成的字符串。例如,美国英语的0x0409语言标识符,因此主美国英语的布局被命名为“00000409”。美国英语布局的变体(如德沃夏克布局)被命名为“00010409”,“00020409”,等等。

[in]指定如何输入法区域设置标识符是要加载。此参数可以是下列值之一。
KLF_ACTIVATE
如果指定的输入区域设置标识符不是已经加载,该函数加载并激活当前线程的输入法区域设置标识符。
KLF_NOTELLSHELL
无法接收到HSHELL_LANGUAGE钩子代码当新的输入法区域设置标识符是装载ShellProc挂钩过程。这值通常用于纷纷当应用程序加载多个输入法区域设置标识符之一。运用这一增值的,但最后的输入区域设置标识符延误shell的处理,直到所有输入法区域设置标识符已被添加。
KLF_REORDER
移动指定的输入法区域设置标识符的输入法区域设置标识符列表的头部,使该区域设置标识符为当前线程活动的区域设置标识符。此值重新排序输入法区域设置标识符列表,即使KLF_ACTIVATE不提供。
KLF_REPLACELANG
Windows 95/98/Me中时,Windows NT 4.0和Windows 2000/XP的:如果新的输入法区域设置标识符有作为当前输入区域设置标识符相同的语言标识符,新的输入法区域设置标识符替换为输入法区域设置标识符目前的1该语言。如果此值不提供的输入法区域设置标识符具有相同的语言标识符,当前输入区域设置标识符不更换,而该函数返回NULL。
KLF_SUBSTITUTE_OK
与其他区域的用户的首选替代品指定的输入区域设置标识符。系统会出现这个标志设置,并建议您的应用程序始终使用此标志。替代只发生如果注册表项HKEY_CURRENT_USER \\键盘\\布局\\代用品明确定义了一个替代的语言环境。例如,如果主要包括值名称“00000409”值为“00010409”,装载美国英语布局(“00000409”)会导致美国英语的德沃夏克布局(“00010409”)被加载,而不是。该系统使用KLF_SUBSTITUTE_OK启动时,它建议所有的应用程序使用此值时,负载输入法区域设置标识符,以确保用户的喜好选择。
KLF_SETFORPROCESS
视窗2000/XP的::这个标志有效的KLF_ACTIVATE只。激活整个过程中指定的输入区域设置标识符和发送WM_INPUTLANGCHANGE消息发送到当前线程的焦点或活动窗口。 Typically, LoadKeyboardLayout activates an input locale identifier only for the current thread.
KLF_UNLOADPREVIOUS
这个标志是不受支持的。使用UnloadKeyboardLayout函数来代替。
返回值
如果函数成功,返回值是输入法区域设置标识符与请求的名称相匹配的语言环境。如果没有匹配的语言环境是可用的,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
此功能只影响当前进程或线程布局。
输入法区域设置标识符是一个比键盘布局更广泛的概念,因为它也可以包括演讲到文本转换器,输入法编辑器(IME),或任何其他形式的投入。
应用程序可以和通常会加载默认的语言输入法区域设置标识符或输入法,并可以通过仅指定一个标识符字符串的语言版本的。如果应用程序要加载一个特定的地区或输入法,应该读取注册表,以确定特定的输入区域设置标识符传递给LoadKeyboardLayout。在这种情况下,请求以激活默认输入的区域设置标识符将启动第一个匹配之一。一个具体的输入法应该被激活使用一个明确的输入区域设置标识符从GetKeyboardLayout或LoadKeyboardLayout返回。
Windows 95/98/Me的:如果输入区域设置标识符是与作为一个以前加载输入法区域设置标识符和KLF_REPLACELANG标志相同的语言加载未设置,调用失败。只有一个加载的区域可能与一种语言。 (这是可以接受多种输入法装载同一语言协会。)
在Windows 95/98/Me:LoadKeyboardLayoutW是支持的Unicode(MSLU)微软层。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
键盘输入,ActivateKeyboardLayout,GetKeyboardLayoutName,MAKELANGID,UnloadKeyboardLayout
==英文原文==LoadKeyboardLayout Function
The LoadKeyboardLayout function loads a new input locale identifier (formerly called the keyboard layout) into the system. Several input locale identifiers can be loaded at a time, but only one per process is active at a time. Loading multiple input locale identifiers makes it possible to rapidly switch between them.
Syntax
HKL LoadKeyboardLayout( LPCTSTR pwszKLID,
UINT Flags
);
Parameters
pwszKLID
[in] Pointer to the buffer that specifies the name of the input locale identifier to load. This name is a string composed of the hexadecimal value of the Language Identifier (low word) and a device identifier (high word). For example, U.S. English has a language identifier of 0x0409, so the primary U.S. English layout is named "00000409". Variants of U.S. English layout (such as the Dvorak layout) are named "00010409", "00020409", and so on.
Flags
[in] Specifies how the input locale identifier is to be loaded. This parameter can be one of the following values.
KLF_ACTIVATE
If the specified input locale identifier is not already loaded, the function loads and activates the input locale identifier for the current thread.
KLF_NOTELLSHELL
Prevents a ShellProc hook procedure from receiving an HSHELL_LANGUAGE hook code when the new input locale identifier is loaded. This value is typically used when an application loads multiple input locale identifiers one after another. Applying this value to all but the last input locale identifier delays the shell's processing until all input locale identifiers have been added.
KLF_REORDER
Moves the specified input locale identifier to the head of the input locale identifier list, making that locale identifier the active locale identifier for the current thread. This value reorders the input locale identifier list even if KLF_ACTIVATE is not provided.
KLF_REPLACELANG
Windows 95/98/Me, Windows NT 4.0, and Windows 2000/XP: If the new input locale identifier has the same language identifier as a current input locale identifier, the new input locale identifier replaces the current one as the input locale identifier for that language. If this value is not provided and the input locale identifiers have the same language identifiers, the current input locale identifier is not replaced and the function returns NULL.
KLF_SUBSTITUTE_OK
Substitutes the specified input locale identifier with another locale preferred by the user. The system starts with this flag set, and it is recommended that your application always use this flag. The substitution occurs only if the registry key HKEY_CURRENT_USER\\Keyboard\\Layout\\Substitutes explicitly defines a substitution locale. For example, if the key includes the value name "00000409" with value "00010409", loading the U.S. English layout ("00000409") causes the Dvorak U.S. English layout ("00010409") to be loaded instead. The system uses KLF_SUBSTITUTE_OK when booting, and it is recommended that all applications use this value when loading input locale identifiers to ensure that the user's preference is selected.
KLF_SETFORPROCESS
Windows 2000/XP:: This flag is valid only with KLF_ACTIVATE. Activates the specified input locale identifier for the entire process and sends the WM_INPUTLANGCHANGE message to the current thread's Focus or Active window. Typically, LoadKeyboardLayout activates an input locale identifier only for the current thread.
KLF_UNLOADPREVIOUS
This flag is unsupported. Use the UnloadKeyboardLayout function instead.
Return Value
If the function succeeds, the return value is the input locale identifier to the locale matched with the requested name. If no matching locale is available, the return value is NULL. To get extended error information, call GetLastError .
Remarks
This function only affects the layout for the current process or thread.
The input locale identifier is a broader concept than a keyboard layout, since it can also encompass a speech-to-text converter, an Input Method Editor (IME), or any other form of input.
An application can and will typically load the default input locale identifier or IME for a language and can do so by specifying only a string version of the language identifier. If an application wants to load a specific locale or IME, it should read the registry to determine the specific input locale identifier to pass to LoadKeyboardLayout. In this case, a request to activate the default input locale identifier for a locale will activate the first matching one. A specific IME should be activated using an explicit input locale identifier returned from GetKeyboardLayout or LoadKeyboardLayout.
Windows 95/98/Me: If an input locale identifier is to be loaded with the same language as a previously loaded input locale identifier and the KLF_REPLACELANG flag is not set, the call fails. Only one loaded locale may be associated with a language. (It is acceptable for multiple IMEs to be loaded with associations to the same language.)
Windows 95/98/Me: LoadKeyboardLayoutW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Keyboard Input , ActivateKeyboardLayout , GetKeyboardLayoutName , MAKELANGID , UnloadKeyboardLayout
==原始网址==http://msdn.microsoft.com/en-us/library/ms646305(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:38