Dieser Tipp ist ursprünglich von Francios Gaillard.
Den Arbeitsbereich gemäß der Auflösung setzen:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| 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; |
Den Arbeitsbereich auf den Standard setzen (exclusive der Taskbar):
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| procedure StandardArea; 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 GetWindowRect(hApp, rcApp); if rcApp.Right<rcWork.Right then rcWork.Left:=rcApp.Right; if rcApp.Bottom<rcWork.Bottom then rcWork.Top:=rcApp.Bottom; if rcApp.Left>0 then rcWork.Right:=rcApp.Left; if rcApp.Top>0 then rcWork.Bottom:=rcApp.Top; end;
SystemParametersInfo (SPI_SETWORKAREA, 0, @rcWork, SPIF_SENDCHANGE ); end; |
Taskbar an oberster Stelle:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
| procedure TaskBarOnTop(bOnTop: boolean); var hApp: HWND; begin hApp := FindWindow('Shell_TrayWnd', ''); if hApp <> 0 then begin if bOnTop then setWindowPos(hApp,HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE) else setWindowPos(hApp,HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE); end; end;
procedure SetTaskBarOnTop; begin TaskBarOnTop(True); end;
procedure SetTaskBarAtBottom; begin TaskBarOnTop(False); end; |
Taskbar verstecken & Vollbildmodus:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| procedure HideTaskBar; var hApp: HWND; rcWork: TRect; begin hApp := FindWindow('Shell_TrayWnd', ''); if hApp <> 0 then begin ShowWindow(hApp, SW_HIDE); FullScreenArea; end; end; |
Taskbar im "Normalmodus" anzeigen:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| procedure ShowTaskBar; var hApp: HWND; rcApp, rcWork: TRect; begin hApp := FindWindow('Shell_TrayWnd', ''); if hApp <> 0 then begin ShowWindow(hApp, SW_RESTORE); StandardArea; end; end; |
The equal is true.