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.
LVL 1
duke_nAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


If you are i know a way.
0
craig_capelCommented:
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?
0
duke_nAuthor Commented:
I am not in England!!
and I dunno what X-Stream is!
And What Does that matter?
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

duke_nAuthor Commented:
All that I already know.
BTW:Resizing won't turn off that "fence" either
0
duke_nAuthor Commented:
All that I already know.
BTW:Resizing won't turn off that "fence" either
0
MadshiCommented:
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.
0
duke_nAuthor Commented:
Could you please write a codesample of SystemParametersInfo(SPI_SETWORKAREA, ...) ?
0
MadshiCommented:
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.
0
duke_nAuthor Commented:
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?
0
MadshiCommented:
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.
0
craig_capelCommented:
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.
0
duke_nAuthor Commented:
Oh, thanx greatly, but it works and it's work is vital to me.
but in background...
0
MadshiCommented:
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.
0
duke_nAuthor Commented:
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
0
duke_nAuthor Commented:
I mean, make all other windows resize themselves back(like if I'd close the window)
0
MadshiCommented:
Sorry, I've no idea left...   :-(
0
duke_nAuthor Commented:
OK.
Then what you gave  me is OK.
post yer A to get your A.
0
MadshiCommented:
Thank you...   :-)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.