클리엘
CLIEL LAB
클리엘
전체 방문자
오늘
어제
  • 분류 전체보기 (513)
    • Mobile (47)
      • Kotlin (47)
    • Web (84)
      • NestJS (9)
      • HTML5 & CSS3 (38)
      • Javascript (20)
      • TypeScript (6)
      • JQuery (11)
    • .NET (300)
      • C# (83)
      • ASP.NET (67)
      • Windows API for .NET (128)
    • Server (53)
      • SQL Server (10)
      • MariaDB (18)
      • Windows Server (6)
      • node.js (19)
    • System (12)
      • 작업LOG (12)
    • Review (11)
    • ETC (6)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

  • 블로그 정리

인기 글

태그

  • android
  • 변수
  • asp.net core
  • exception
  • NestJS
  • jQuery
  • Windows API
  • CSS3
  • MariaDB
  • HTML5
  • node.js
  • .NET
  • JavaScript
  • android studio
  • LINQ
  • Kotlin
  • asp.net core web api
  • ASP.NET
  • Entity Framework
  • c#

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
클리엘

CLIEL LAB

.NET/Windows API for .NET

SetSysColor - Windows System 색상 설정

2019. 8. 5. 16:49
728x90
Private Declare Function SetSysColors Lib "user32.dll" (ByVal nChanges As Integer, ByRef lpSysColor As ieSystemColor, ByRef lpColorValues As Integer) As Integer

- VB.NET 선언

Public Enum ieSystemColor As Integer
        iScrollBar = 0
        iBackGround = 1
        iActiveCaption = 2
        iInactiveCaption = 3
        iMenu = 4
        iWindow = 5
        iWindowFrame = 6
        iMenuText = 7
        iWindowText = 8
        iCaptionText = 9
        iActiveBorder = 10
        iInactiveBorder = 11
        iAppWorkspace = 12
        iHighlight = 13
        iHighlightText = 14
        iBtnFace = 15
        iBtnShadow = 16
        iGrayText = 17
        iBtnText = 18
        iInactiveCaptionText = 19
        iBtnHightList = 20
        iSecondActiveCatpion = 27
        iSecondInactiveCaption = 28
End Enum

SetSysColors(1, ieSystemColor.iBackGround, RGB(0, 0, 0))

- VB.NET 호출

[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern bool SetSysColors(int nChanges, int[] lpSysColor, int[] lpColorValues);

- C# 선언

public enum ieSystemColor : int
{
            iScrollBar = 0,
            iBackGround = 1,
            iActiveCaption = 2,
            iInactiveCaption = 3,
            iMenu = 4,
            iWindow = 5,
            iWindowFrame = 6,
            iMenuText = 7,
            iWindowText = 8,
            iCaptionText = 9,
            iActiveBorder = 10,
            iInactiveBorder = 11,
            iAppWorkspace = 12,
            iHighlight = 13,
            iHighlightText = 14,
            iBtnFace = 15,
            iBtnShadow = 16,
            iGrayText = 17,
            iBtnText = 18,
            iInactiveCaptionText = 19,
            iBtnHightList = 20,
            iSecondActiveCatpion = 27,
            iSecondInactiveCaption = 28
};

int[] systemcolor = { (int)(ieSystemColor.iBackGround) };
int[] color = { System.Drawing.ColorTranslator.ToWin32(System.Drawing.Color.Black) };

SetSysColors(systemcolor.Length, systemcolor, color);

- C# 호출

 

SetSysColors를 통해 Windows의 어떤 색상을 바꿀지 열거형을 참고하여 지정합니다.(ex iBackGround : Windows 배경색)

열거형이 싫다면 정수형 숫자만으로도 작성하실 수 있습니다.

728x90
저작자표시 비영리 변경금지

'.NET > Windows API for .NET' 카테고리의 다른 글

CreateDirectory - Directory의 생성  (0) 2019.08.05
GetDriveType - Disk Drive 유형 판단  (0) 2019.08.05
MoveFile - File의 이동및 복사수행  (0) 2019.07.31
IsWindowVisible - 특정 Window가 현재 화면에 보이는지 여부를 판단  (0) 2019.07.31
PaintDesktop - 배경화면 맞추기  (0) 2019.07.31
    '.NET/Windows API for .NET' 카테고리의 다른 글
    • CreateDirectory - Directory의 생성
    • GetDriveType - Disk Drive 유형 판단
    • MoveFile - File의 이동및 복사수행
    • IsWindowVisible - 특정 Window가 현재 화면에 보이는지 여부를 판단
    클리엘
    클리엘
    누구냐 넌?

    티스토리툴바