Control Windows resolution

zhaozj2021-02-17  50

EnumDisplaySettings () and ChangeDisplaySettings (), function DynamicResolution (X, Y: word): BOOL; var lpDevMode: TDeviceMode; begin Result: = EnumDisplaySettings (nil, 0, lpDevMode); if Result thenbeginlpDevMode.dmFields: = DM_PELSWIDTH Or DM_PELSHEIGHT; lpDevMode .dmPelsWidth: = X; lpDevMode.dmPelsHeight: = Y; Result: = ChangeDisplaySettings (lpDevMode, 0) = DISP_CHANGE_SUCCESSFUL; endend; procedure TForm1.Button1Click (Sender: TObject); beginif DynamicResolution (640, 480) thenShowMessage ( 'Now is 640 * 480 '); End; Procedure TFORM1.BUTTON2CLICK (Sender: TOBJECT); Begin IF DynamicResolution (800, 600) Then ShowMessage (' NOW IS 800 * 600 ');

转载请注明原文地址:https://www.9cbs.com/read-30434.html

New Post(0)