Programing

Visual Studio에서 솔루션 탐색기의 배경색 변경

lottogame 2020. 12. 26. 09:25
반응형

Visual Studio에서 솔루션 탐색기의 배경색 변경


테마를 사용하여 Visual Studio에서 솔루션 탐색기의 배경색을 변경하는 방법이 있습니까? -아니면 그 문제에 대한 다른 방법이 있습니까?

창 전체의 색상 설정을 변경하여 변경할 수 있지만 분명히 너무 많은 영향을 미칩니다.


한 시간 이내에 "SExColor"에 대한 검색 확장 관리자를 위해 VS 확장을 만들었습니다. 즐겨 ;)


@aloneguid ... 이런 오래 전에 봤어야했는데 .. 감사합니다!

@ver (솔루션에 대한 2008 솔루션과 관련하여;)-B52 유형의 접근 방식, devenv.exe 내부의 SysTreeView32에 대한 카펫 폭격. 원하는 색상에 대해 가능한 추가 매개 변수, 그렇지 않으면 RGB (220,220,220)-나에게 가장 적합합니다.

#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;
}

Even changing the standard Windows background color does not work for the Solution Explorer. This Visual Studio bug report mentions the issue. Microsoft has marked this as "Closed -- Won't Fix."

Which is very irritating! Using a dark theme and having a bright white Solution Explorer hanging on the side of the screen is extremely annoying.

One possible solution is to not use the Solution Explorer at all. The Productivity Power Tools provides a Solution Explorer replacement called the "Solution Navigator." It currently is also hard-coded to white. But I think there is probably a better chance of getting the developers of that tool to add support for modifying colors than of getting Microsoft to do it in Visual Studio. (even though Microsoft created the PPTs.)


Not by any means of configuration from Visual Studio itself.

You can however probably "hack" the window object from the Win32 API (look up "window enumeration"). Once you have the window handle, you can set all characterstics you want.

Regards

/Robert


You could use other extenssion, you have quite big possibilities to do your Visual Studio more good looking ;) (but I'm not sure if there you could change Solution Explorer background)

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

ReferenceURL : https://stackoverflow.com/questions/189043/change-background-color-of-solution-explorer-in-visual-studio

반응형