Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Registers a preserved key.
HRESULT PreserveKey(
[in] TfClientId tid,
[in] REFGUID rguid,
[in] const TF_PRESERVEDKEY *prekey,
[in] const WCHAR *pchDesc,
[in] ULONG cchDesc
);
[in] tid
Contains the client identifier of the TSF text service. This value is passed to the TSF text service in its ITfTextInputProcessor::Activate method.
[in] rguid
Contains the command GUID of the preserved key. This value is passed to the TSF text service ITfKeyEventSink::OnPreservedKey method to identify the preserved key when the preserved key is activated.
[in] prekey
Pointer to a TF_PRESERVEDKEY structure that specifies the preserved key. The uVKey member contains the virtual key code and the uModifiers member identifies the modifiers of the preserved key.
[in] pchDesc
Pointer to a Unicode string that contains the description of the preserved key. This cannot be NULL unless cchDesc is zero.
[in] cchDesc
Specifies the number of characters in pchDesc. Pass zero for this parameter if no description is required.
This method can return one of these values.
| Value | Description |
|---|---|
|
The method was successful. |
|
The preserved key is registered. |
|
One or more parameters are invalid. |
|
A memory allocation error occurred. |
|
An unspecified error occurred. |
Preserved keys are registered by TSF text services and provide keyboard shortcuts to common commands implemented by the TSF text service.
| Requirement | Value |
|---|---|
| Minimum supported client | Windows 2000 Professional [desktop apps | UWP apps] |
| Minimum supported server | Windows 2000 Server [desktop apps | UWP apps] |
| Target Platform | Windows |
| Header | msctf.h |
| DLL | Msctf.dll |
| Redistributable | TSF 1.0 on Windows 2000 Professional |
ITfKeyEventSink::OnPreservedKey
ITfKeystrokeMgr::UnpreserveKey
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in