IVsFilterKeys2.TranslateAcceleratorEx Method (MSG[], UInt32, UInt32, Guid[], Guid, UInt32, Int32, Int32)
Takes a Windows message, translates it into a command, and, optionally, executes the command.
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
int TranslateAcceleratorEx( MSG[] pMsg, uint dwFlags, uint cKeyBindingScopes, Guid[] rgguidKeyBindingScopes, out Guid pguidCmd, out uint pdwCmd, out int fCmdTranslated, out int pfKeyComboStartsChord )
Parameters
- pMsg
-
Type:
Microsoft.VisualStudio.OLE.Interop.MSG[]
[in] Pointer to the Windows message.
- dwFlags
-
Type:
System.UInt32
[in] Bit flags to determine whether or not to perform default actions, to execute the command, and the key bindings to use. Values formed from the __VSTRANSACCELEXFLAGS enumeration.
- cKeyBindingScopes
-
Type:
System.UInt32
[in] Number of key binding scopes to check. Length of the rgguidKeyBindingScopes array.
- rgguidKeyBindingScopes
-
Type:
System.Guid[]
[in] Array of GUIDs of the key binding scopes to use such as CMDUIGUID_TextEditor to use the current text editor key bindings.
- pguidCmd
-
Type:
System.Guid
[out] Pointer to the GUID of the corresponding command.
- pdwCmd
-
Type:
System.UInt32
[out] Pointer to the identifier of the command.
- fCmdTranslated
-
Type:
System.Int32
[out] Boolean. Set to true if the message will translate to a command.
- pfKeyComboStartsChord
-
Type:
System.Int32
[out] Boolean. Set to true if the key is the start of a multi-key sequence (chord).
Return Value
Type: System.Int32If the message does or will translate to a command, the method returns S_OK, fills the pguidCmd and pdwCmd parameters with the command's GUID and ID, and sets fCmdTranslated to true. If the message does not or will not translate to a command, the method returns S_FALSE, sets the GUID and ID parameters to zero, and sets fCmdTranslated to false.
From vsshell80.idl:
HRESULT TranslateAcceleratorEx( [in] LPMSG pMsg, [in] VSTRANSACCELEXFLAGS dwFlags, [in] DWORD cKeyBindingScopes, [in, size_is(cKeyBindingScopes)] const GUID rgguidKeyBindingScopes[], [out] GUID *pguidCmd, [out] DWORD *pdwCmd, [out] BOOL *fCmdTranslated, [out] BOOL *pfKeyComboStartsChord );
If you do not specify VSTAEXF_IgnoreActiveKBScopes, the currently active scopes are searched after those specified by the flags in dwFlags.