[英]Windows Phone: Change title text to image in Visual Studio 2013
[英]How to change the title text of Visual Studio 2017
我正在嘗試添加將更改標題欄文本的VS擴展名。 我找到了工具,但我的擴展程序中需要它。
我試過了:
var dte = GetServiceAsync(typeof(DTE)) as DTE2;
if(!(dte is null))
dte.MainWindow.Caption = "Name";
但這不起作用。
同樣,
[DllImport("user32.dll")]
private static extern bool SetWindowText(IntPtr hWnd, string lpString);
var proc = Process.GetCurrentProcess();
SetWindowText(proc.MainWindowHandle, "Name);
只是更改Process.MainWindowTitle
如果我沒記錯的話,我相信擴展是在它自己的進程中,因此您首先需要找到正在運行的VS2017進程,然后獲取該句柄並運行SetWindowText
。
var processes = Process.GetProcessesByName("devenv");
foreach(var process in processes)
{
SetWindowText(process.MainWindowHandle, "Name");
}
大提示:
作為開發人員,請不要在Visual Studio中弄亂我的標題欄。 在重構和其他各種任務時,我經常將它們用作工作項目和參考項目之間的參考。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.