Change the screen display area

zhaozj2021-02-16  103

I found these code when I find the task bar height, keep it down.

procedure FullScreenArea; var rcWork: TRect; begin rcWork.Top:=0; rcWork.Left: = 0; rcWork.Bottom: = GetSystemMetrics (SM_CYSCREEN); rcWork.Right: = GetSystemMetrics (SM_CXSCREEN); SystemParametersInfo (SPI_SETWORKAREA, 0, @ RCWORK, SPIF_SENDCHANGE); END;

procedure StandardArea; // addition taskbar var hApp: HWND; rcApp, rcWork: TRect; begin rcWork.Top:=0; rcWork.Left: = 0; rcWork.Bottom: = GetSystemMetrics (SM_CYSCREEN); rcWork.Right: = GetSystemMetrics (SM_CXSCREEN);

hApp: = FindWindow ( 'Shell_TrayWnd', ''); if hApp <> 0 then begin {get the size of the taskbar} GetWindowRect (hApp, rcApp); {cut the workarea to place the taskbar} if rcApp.Right 0 THEN RCWORK .Right: = rcapp.Left; {bar on right Edge} f {bar on right Edge} f rcWork.bottom: = rcapp.top; {bar on bottom Edge} END;

{SET WORKAREA} SystemParametersInfo (SPI_Setworkarea, 0, @rcwork, spif_sendchange); end; {standardarea}

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

New Post(0)