在 Visual Studio 中更改解决方案资源管理器的背景颜色

Change background color of Solution Explorer in Visual Studio

有没有办法使用主题更改 Visual Studio 中解决方案资源管理器的背景颜色? - 或任何其他方式?

我可以通过更改窗口范围的颜色设置来更改它,但显然影响太大了。


不到一个小时就为它创建了 VS 扩展,在扩展管理器中搜索 "SExColor"。享受;)


@aloneguid ...很久以前就应该看到这个了..谢谢先生!

@ver(关于解决方案的 vs 2008 解决方案;) - 一种 B52 类型的方法,对 devenv.exe 中的任何 SysTreeView32 进行地毯式轰炸。所需颜色的可能额外参数,否则 RGB(220,220,220) - 最适合我

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include windows.h
#include"psapi.h"
#include"shlwapi.h"
#include"commctrl.h"


COLORREF clr = RGB(220,220,220);

BOOL CALLBACK wenum( HWND hwnd, LPARAM lParam)
{
   const UINT cb = 261;
   static wchar_t    name[] = L"SysTreeView32",
                     tmp[cb] = {0};
   if( ::GetClassNameW( hwnd, tmp, 260 ) && 0 == _wcsicmp( name, tmp ) )
   {
      ::SendMessageW( hwnd, TVM_SETBKCOLOR, 0, (LPARAM)clr );
   }

   return TRUE;
}

BOOL CALLBACK EnumTops(HWND hwnd, LPARAM lParam)
{
    DWORD             dwThreadId  = 0,
                     dwProcessId = 0;
    HINSTANCE         hInstance;
   static wchar_t derVS[]     = L"devenv.exe";
   wchar_t  name[_MAX_PATH]   = {0},
            *exe              = 0;

    HANDLE hProcess;
   if (!hwnd)  return TRUE;     // Not a window
   if (!::IsWindowVisible(hwnd)) return TRUE;       // Not visible

   if (!SendMessage(hwnd, WM_GETTEXT, sizeof(name), (LPARAM)name))
      return TRUE;      // No window title
   dwThreadId = GetWindowThreadProcessId(hwnd, &dwProcessId);
   hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId);
   if( !GetModuleFileNameEx(hProcess, 0, name, sizeof(name))) goto exit;

   exe = ::PathFindFileNameW( name );
   if( (void*)exe == (void*)name ) goto exit; // mhm? maybe not exit?

   if( _wcsicmp( derVS, exe ) ) goto exit;

   EnumChildWindows( hwnd, wenum, (LPARAM)hProcess );

exit:
   CloseHandle(hProcess);
   int res = GetLastError();
   return res;
}

int wmain(int argc, wchar_t * argv[])
{
   if( argc = 2 )
   {
      wchar_t *end = 0;
      long l = wcstol( argv[1], &end, 16 );
      clr = (DWORD)l;
   }
   ::EnumWindows(EnumTops, NULL);
   return 0;
}


即使更改标准 Windows 背景颜色也不适用于解决方案资源管理器。这个 Visual Studio 错误报告提到了这个问题。 Microsoft 已将此标记为"已关闭 -- 不会修复。"

这很烦人!使用深色主题并将亮白色的解决方案资源管理器挂在屏幕一侧非常烦人。

一种可能的解决方案是根本不使用解决方案资源管理器。 Productivity Power Tools 提供了一个名为"Solution Navigator"的解决方案资源管理器替代品。它目前也被硬编码为白色。但我认为让该工具的开发人员添加对修改颜色的支持可能比让微软在 Visual Studio 中做这件事的机会更大。 (尽管微软创建了 PPT。)


不是通过 Visual Studio 本身的任何配置方式。

但是,您可能可以从 Win32 API 中"破解"窗口对象(查找"窗口枚举")。一旦你有了窗口句柄,你就可以设置你想要的所有字符。

问候

/罗伯特


你可以使用其他扩展,你有很大的可能性让你的 Visual Studio 看起来更漂亮;)(但我不确定你是否可以改变解决方案资源管理器的背景)

http://visualstudiogallery.msdn.microsoft.com/20cd93a2-c435-4d00-a797-499f16402378