Compartir a través de


IVsFilterKeys.TranslateAccelerator Method

Takes a Windows message, translates it into a command, and, optionally, executes the command.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function TranslateAccelerator ( _
    pMsg As MSG(), _
    dwFlags As UInteger, _
    <OutAttribute> ByRef pguidCmd As Guid, _
    <OutAttribute> ByRef pdwCmd As UInteger _
) As Integer
int TranslateAccelerator(
    MSG[] pMsg,
    uint dwFlags,
    out Guid pguidCmd,
    out uint pdwCmd
)
int TranslateAccelerator(
    [InAttribute] array<MSG>^ pMsg, 
    [InAttribute] unsigned int dwFlags, 
    [OutAttribute] Guid% pguidCmd, 
    [OutAttribute] unsigned int% pdwCmd
)
abstract TranslateAccelerator : 
        pMsg:MSG[] * 
        dwFlags:uint32 * 
        pguidCmd:Guid byref * 
        pdwCmd:uint32 byref -> int
function TranslateAccelerator(
    pMsg : MSG[], 
    dwFlags : uint, 
    pguidCmd : Guid, 
    pdwCmd : uint
) : int

Parameters

  • dwFlags
    Type: UInt32

    [in] Bit flags to determine whether or not to perform default actions, or to execute the command. Values formed from the __VSTRANSACCELFLAGS enumeration.

  • pguidCmd
    Type: Guid%

    [out] Pointer to the GUID of the corresponding command.

  • pdwCmd
    Type: UInt32%

    [out] Pointer to the identifier of the command.

Return Value

Type: Int32
If the message does or will translate to a command, the method returns S_OK and fills the pguidCmd and pdwCmd parameters with the command's GUID and ID. If the message does not or will not translate to a command, the method returns S_FALSE, and sets the two parameters to zero.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsFilterKeys::TranslateAccelerator(
   [in] LPMSG pMsg, 
   [in] VSTRANSACCELFLAGS dwFlags, 
   [out] GUID *pguidCmd, 
   [out] DWORD *pdwCmd
);

.NET Framework Security

See Also

Reference

IVsFilterKeys Interface

Microsoft.VisualStudio.Shell.Interop Namespace