简体   繁体   中英

Visual Studio Addin - automated right mouse click

Is there any way that I can make my addin press the right mouse button and then select one option from the opened context menu?

Something like this:

_applicationObject.Windows.Item(EnvDTE.Constants.vsWindowKindSolutionExplorer).Activate();
_applicationObject.ToolWindows.SolutionExplorer.GetItem(projectName).Select(vsUISelectionType.vsUISelectionTypeSelect);
_applicationObject.ExecuteCommand("PRESS RIGHT MOUSE BUTTON");
_applicationObject.ExecuteCommand("CLICK OPTION XPTO FROM CONTECT MENU");

遵循@Adriano Repetti的建议,发现了这一点

_applicationObject.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Rebuild");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM