[Delphi XE3] 取得螢幕解析度

[delphi]
uses Winapi.Windows;

procedure TMainForm.Button1Click(Sender: TObject);
var
ScreenHorizontal :integer;
ScreenVertical:integer;
begin
ScreenPixelX:= GetDeviceCaps(GetDC(Application.Handle),HORZRES); // Horizontal width in pixels
ScreenPixelY:= GetDeviceCaps(GetDC(Application.Handle),VERTRES); // Vertical height in pixels
// 取得螢幕解析度
ShowMessage(IntToStr(ScreenHorizontal)+’ X ‘+ IntToStr(ScreenVertical));
end;
[/delphi]