共用方式為


IVsUIShell.TranslateAcceleratorAsACmd Method

Causes the environment to use the active key binding table to convert, if possible, a keyboard message into the appropriate command, then route the command using the usual command routing mechanism.

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

Syntax

'宣告
Function TranslateAcceleratorAsACmd ( _
    pMsg As MSG() _
) As Integer
'用途
Dim instance As IVsUIShell
Dim pMsg As MSG()
Dim returnValue As Integer

returnValue = instance.TranslateAcceleratorAsACmd(pMsg)
int TranslateAcceleratorAsACmd(
    MSG[] pMsg
)
int TranslateAcceleratorAsACmd(
    [InAttribute] array<MSG>^ pMsg
)
abstract TranslateAcceleratorAsACmd : 
        pMsg:MSG[] -> int 
function TranslateAcceleratorAsACmd(
    pMsg : MSG[]
) : int

Parameters

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIShell::TranslateAcceleratorAsACmd(
   [in] LPMSG pMsg
);

This method is intended to be called by in-place components in their implementation of TranslateCntrAccelerator. This makes it possible for the in-place component to give priority for keystrokes to the usual command bindings of the environment before making it possible for them to be handled by a nested OLE object.

.NET Framework Security

See Also

Reference

IVsUIShell Interface

IVsUIShell Members

Microsoft.VisualStudio.Shell.Interop Namespace