Board index » delphi » Hiding the Windows Task Bar from Delphi?

Hiding the Windows Task Bar from Delphi?

Hi folks

When I Hide and Show the windows TaskBar how do I force my program to
open and shrink to Match the new window size.

To hide the TaskBar I use
var
  wndHandle : THandle;
  wndClass : array[0..50] of Char;
begin
  StrPCopy(@wndClass[0], 'Shell_TrayWnd');
  wndHandle := FindWindow(@wndClass[0], nil);
  ShowWindow(wndHandle, SW_HIDE);

// Then in this procedure I've tried
  Form1.ClientHeight := Screen.Height;

// and I've tried
  Form1.Height := Screen.Height;

// And I've tried them both
  Form1.ClientHeight := Screen.Height;
  Form1.Height := Screen.Height;
end;

But the program just stays the same height as it was before the
Taskbar was hidden.

Cheers
Don
BTW: Thanks to
http://www.used-disks.com/Programming/Pascal/FAQ/WinAPI/
where I found the procedures for hiding and showing the taskbar.

 

Re:Hiding the Windows Task Bar from Delphi?


Have you tried setting Form1.WindowState to wsMaximized?

Because your code doesn't work, I think TScreen is initialized only at
application start, and not refresed when the display properties change. You
could try making a new instance of a TScreen object and set the form's
height and width according to the values in that object.

Quote
"Don" <[email protected]> wrote in message
> When I Hide and Show the windows TaskBar how do I force my program to
> open and shrink to Match the new window size.

> But the program just stays the same height as it was before the
> Taskbar was hidden.

Re:Hiding the Windows Task Bar from Delphi?


Thanks for you quick reply.

The forms window default state is maximized but I but the command
Form1.WindowState := wsMaximized; in the HideTaskBar procedure anyway
just to see what happens but it still made no difference.

I don't know what you mean by creating a new instance of TScreen.

Cheers
Don

On Fri, 13 Apr 2001 19:46:10 +0200, "B. Garvelink"

Quote
<[email protected]> wrote:

>Have you tried setting Form1.WindowState to wsMaximized?

>Because your code doesn't work, I think TScreen is initialized only at
>application start, and not refresed when the display properties change. You
>could try making a new instance of a TScreen object and set the form's
>height and width according to the values in that object.

>"Don" <[email protected]> wrote in message
>> When I Hide and Show the windows TaskBar how do I force my program to
>> open and shrink to Match the new window size.

>> But the program just stays the same height as it was before the
>> Taskbar was hidden.

Re:Hiding the Windows Task Bar from Delphi?


I got it working. I found that if I turn off the border icons in the
form it resizes to fit the whole screen.

Cheers
Don

Other Threads