Autor Beitrag
CodeWicht
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 90

Win98, WinXP
D6
BeitragVerfasst: Sa 08.11.03 19:39 
Dieser Tipp ist ursprünglich von Francios Gaillard.

Den Arbeitsbereich gemäß der Auflösung setzen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure FullScreenArea; 
{ set workarea to full screen } 
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):
ausblenden volle Höhe 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:
24:
25:
26:
27:
28:
29:
30:
31:
procedure StandardArea; 
{ set workarea to standard screen (= excluding taskbar) } 
var 
  hApp: HWND; 
  rcApp, rcWork: TRect; 
begin 
  { prepare a default fullscreen workarea } 
  rcWork.Top:=0
  rcWork.Left:=0
  rcWork.Bottom:= GetSystemMetrics(SM_CYSCREEN); 
  rcWork.Right:= GetSystemMetrics(SM_CXSCREEN); 

  { get the taskbar handle } 
  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<rcWork.Right then 
      rcWork.Left:=rcApp.Right; { bar on left edge } 
    if rcApp.Bottom<rcWork.Bottom then 
      rcWork.Top:=rcApp.Bottom; { bar on top edge } 
    if rcApp.Left>0 then 
      rcWork.Right:=rcApp.Left; { bar on right edge } 
    if rcApp.Top>0 then 
      rcWork.Bottom:=rcApp.Top; { bar on bottom edge } 
  end

  { set workarea } 
  SystemParametersInfo (SPI_SETWORKAREA, 0, @rcWork, SPIF_SENDCHANGE ); 
end{ StandardArea }


Taskbar an oberster Stelle:
ausblenden 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 
  { get the taskbar handle } 
  hApp := FindWindow('Shell_TrayWnd'''); 
  if hApp <> 0 then begin 
    if   bOnTop then 
      setWindowPos(hApp,HWND_TOPMOST, 0000, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE) 
    else 
      setWindowPos(hApp,HWND_BOTTOM, 0000, 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:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure HideTaskBar; 
var 
  hApp: HWND; 
  rcWork: TRect; 
begin 
  { get the taskbar handle } 
  hApp := FindWindow('Shell_TrayWnd'''); 
  if hApp <> 0 then begin 
    { hide taskbar } 
    ShowWindow(hApp, SW_HIDE); 
    { set workarea to full screen } 
    FullScreenArea; 
  end
end;


Taskbar im "Normalmodus" anzeigen:
ausblenden 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 
  { get the taskbar handle } 
  hApp := FindWindow('Shell_TrayWnd'''); 
  if hApp <> 0 then begin 
    { restore taskbar } 
    ShowWindow(hApp, SW_RESTORE); 
    { set workarea excluding taskbar } 
    StandardArea; 
  end
end;

_________________
The equal is true.