procedure TForm1.Button1Click(Sender: TObject);
var
aDevMode: TDevmode;
begin
SetLastError(0);
Zeromemory(@aDevMode, sizeof(TDevmode));
aDevMode.dmSize := SizeOf(aDevMode);
aDevMode.
aDevMode.dmOrientation := DMDO_180;
aDevMode.dmFields := DM_DISPLAYORIENTATION;
ChangeDisplaySettingsEx(
nil, aDevMode,
Handle, 0,
nil);
ShowMessage(SysErrorMessage(GetLastError));
end;
procedure TForm1.Button2Click(Sender: TObject);
var
aDevMode: TDevmode;
begin
SetLastError(0);
Zeromemory(@aDevMode, sizeof(TDevmode));
aDevMode.dmSize := SizeOf(aDevMode);
aDevMode.dmOrientation := DMDO_0;
aDevMode.dmFields := DM_DISPLAYORIENTATION;
ChangeDisplaySettingsEx(
nil, aDevMode,
Handle, 0,
nil);
ShowMessage(SysErrorMessage(GetLastError));
end;