문제

화면 해상도를 프로그래밍 방식으로 변경하거나 Windows XP에서 여러 모니터를 활성화/비활성화하는 방법이 있습니까? 예를 들어, 하나의 모니터가있는 1024x768에서 두 모니터에서 1280x104로 변경하려면? 이 작업을 수행하기 위해 Win32 기능에 가장 관심이 있지만 Windows 바로 가기에 묶을 수있는 것은 충분합니다.

도움이 되었습니까?

해결책

당신이 사용할 수있는 EnumDisplayDevices 사용 가능한 디스플레이를 파악하려면 EnumDisplaySettings 디스플레이에 사용 가능한 해상도 목록을 얻으려면. 사용 ChangeisPlaySettings 해상도를 설정하려면 필요한 해상도를 설정합니다.

다른 팁

예, 그러나 .NET의 일부는 아닙니다. Win32 API에 액세스하려면 래퍼를 사용, 호출 또는 작성해야합니다.

보다 ChangeisPlaySettings 및 관련 기능.

여기 기본 예를 찾을 수 있습니다.

이것을 쉽게 스크립트 할 수 있습니다 http://www.autohotkey.com

다음은 하나의 모니터와 Windows+1 및 Windows+2가있는 두 개의 모니터를 교환하기위한 스크립트입니다.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Recommended for catching common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#1::
Send {LWin}
WinWaitActive Start menu
Send Adjust Screen Resolution
Send {enter}
WinWaitActive Screen Resolution
ControlClick ComboBox3
Send {PgDn}
Send {Up} ; Select "Show desktop only on 1"
Send {enter}
Sleep 3000 ; workaround - cannot select accept/revert window?
Send {left}
Send {enter} ; accept changes
Return
#2::
Send {LWin}
WinWaitActive Start menu
Send Adjust Screen Resolution
Send {enter}
WinWaitActive Screen Resolution
ControlClick ComboBox3
Send {PgDn}
Send {Up}
Send {Up} ; Select "Extend these displays"
Send {enter}
Sleep 3000 ; workaround - cannot select accept/revert window?
Send {left}
Send {enter} ; accept changes
Return

주어진 링크를 쉽게 읽으십시오.

DLL을 다운로드 할 수 있습니다.

mytactics.blogspot.in

Screen Srn=Screen.PrimaryScreen;

int tempWidth=Srn.Bounds.Width;
int tempHeight=Srn.Bounds.Height;
Console.WriteLine("Current Screen width is {0} and height is {1}.",
                   tempWidth,
                   tempHeight);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top