Link to home
Start Free TrialLog in
Avatar of duke_n
duke_n

asked on

Hiding a handmade taskbar

There's a window docked on the  top of screen. the fact that it's docked there makes a "Fence" for all other windows to move,get maximized,ect.(=acts like a taskbar)  If I execute the following
ShowWindow(FindWindow(nil,'Name'),sw_hide),
then the window is being hidden, but the "fence" stays. How to hide it so the "fence" will go too.
Avatar of craig_capel
craig_capel

I have a funny feeling that your in England? and your using x-stream correct?


If you are i know a way.
Wait.... i am VERY wrong, once you have the window handle, then you can resize the windows if you like, or close the window down, is this a program or what that does this? can i have a look?
Avatar of duke_n

ASKER

I am not in England!!
and I dunno what X-Stream is!
And What Does that matter?
Avatar of duke_n

ASKER

All that I already know.
BTW:Resizing won't turn off that "fence" either
Avatar of duke_n

ASKER

All that I already know.
BTW:Resizing won't turn off that "fence" either
Well, there are several approaches. Probably this bar uses those SHAppBarMessage API. Then you could either try to send an official SHAppBarMessage to that bar (don't know how). Or you could find out to which process the bar belongs (GetWindowThreadProcessID) and stop that application (e.g. PostThreadMessage(GetWindowThreadProcessID(barWindow, nil), WM_QUIT, 0, 0)). Or you could hide the bar like you already do. But then you have to call SystemParametersInfo(SPI_SETWORKAREA, ...) to turn that fence of.

Regards, Madshi.
Avatar of duke_n

ASKER

Could you please write a codesample of SystemParametersInfo(SPI_SETWORKAREA, ...) ?
I did not test it, but this should remove the top fence, you're talking about:

procedure RemoveTopFence;
var r1 : TRect;
begin
  SystemParametersInfo(SPI_GETWORKAREA, 0, @r1, 0);
  r1.Top := 0;
  SystemParametersInfo(SPI_SETWORKAREA, 0, @r1, 0);
end;

Regards, Madshi.
Avatar of duke_n

ASKER

this is great.
but there was taskbar(Another one-One I needed for work) over the taskbar I hidden, and setting the fence top to 0 didn't move the "vital" taskbar to the
top of fence. it left it "hanging in the middle of the screen. How o treat that?
Well, I think the best way would be to stop the program to which the taskbar belongs, that you want to hide. Then the program should delete the taskbar correctly, so that the other taskbar takes it place at the top of the screen.
Try the PostThreadMessage suggestion from my answer.

Regards, Madshi.
i wrote a program with Madshi's help a while back, i turned it
into a small program that kills windows threads...

when i say help, i copied his post thread command, and experimented witht the rest!....

http://members.xoom.com/craig_c/killthre.zip


Craig C.
Avatar of duke_n

ASKER

Oh, thanx greatly, but it works and it's work is vital to me.
but in background...
Well, okay, try this one:

procedure HideAppBar(window: THandle);
var abd : TAppBarData;
begin
  ZeroMemory(@abd, sizeOf(TAppBarData));
  abd.cbSize := sizeOf(TAppBarData);
  abd.hWnd := FindWindow(nil,'Name');
  SHAppBarMessage(ABM_REMOVE, abd);
end;

Regards, Madshi.
Avatar of duke_n

ASKER

Nope.
this one doesn't do anything at all.


Look with pieces of your code, I managed to hide it, and to remove the fence for windows maximizing, but the Icons on the desktop are still aligned to the fence.....
how to kill the fence once and for all
Avatar of duke_n

ASKER

I mean, make all other windows resize themselves back(like if I'd close the window)
Sorry, I've no idea left...   :-(
Avatar of duke_n

ASKER

OK.
Then what you gave  me is OK.
post yer A to get your A.
ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial