Link to home
Start Free TrialLog in
Avatar of cecheto
cecheto

asked on

Window with Taskbar behavior

Hi all,

How can I create a window (form) the acts like the windows task bar.  This means it resize it self whe the mouse enter and leaves.

Avatar of nrico
nrico

What do you mean "When the mouse enters and leaves"?
The taskbar doesn't automatically resize itself when the mouse enters and leaves...

Oh, got it! You're hiding your taskbar.

Well, your form has two events
OnMouseOver and OnMouseOut (I believe those are the names) that occur when the mouse enters respectively leaves the form, so perhaps you could use those.
You can have a timer on your form that each time it fires, it checks to see where the mouse is (using GetCursorPos), and if the mouse is near enough, resize the form...

Tim.
 
Ex:

Procedure Form1.Form1MouseOver(Sender:TObject);
Begin
  Form1.Width:=300;
  Form1.Height:=200;
End;

Procedure Form1.Form1MouseOut(Sender:TObject);
Begin
  Form1.Width:=50;
  Form1.Height:=50;
End;

Align the form to any side of the screen to simulate the effect.
I had a form-class somewhere that does it. You want me to send it to ya?
(makes the form act fully like a taksbar, that is)
ASKER CERTIFIED SOLUTION
Avatar of TheNeil
TheNeil

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
Avatar of cecheto

ASKER

Ok nico, I think your aproach is the correct, The correct events are OnMouseEnter and OnMouseLeave, (The names really don't matter) wich respond to the windows messages CN_OnMouseEnter and CN_OnMouseLeave.  I have also attached a timer that wait for a time before closing.

The problem I have is that whe I move the mouse over the form (speccially whe I change from one component to another) the form hides and restores itself.
Avatar of cecheto

ASKER

Please duke_n, send your form (It could help a lot) (cecheto@teleline.es)
Avatar of cecheto

ASKER

The Neil got the solved the problem I had (Important to check the mouse position before hiding the form)
Cecheto

Depends which idea you go with. Certain solutions would get around that for you... (and wouldn't need doing anything that Delphi doesn't do itself)

The Neil
Cecheto

Depends which idea you go with. Certain solutions would get around that for you... (and wouldn't need doing anything that Delphi doesn't do itself)

The Neil
You can use Application Desktop Toolbars API. See Win32 help
Avatar of cecheto

ASKER

nrico and TheNeil got the answers, who gets the points?
Well, nrico got an answer before me but I think that mine is a little easier (then again I'm a little biased). If nrico agrees, you could delete this question and then post a question for each of us with half the points

The Neil
Hey!
Wait for my class to arrive! :-)
I sent it rared(takes only 360K this way) assuming that if you're an expert then you have winrar. otherwise www.rarsoft.com
duke_n are you sending appbar14 by any chance ?
if so this is good delphi example of creating a taskbar form,and shouldnt be overlooked ..then agin maybe too deep for this purpose..
some appbar, yes
Avatar of cecheto

ASKER

Thanks a lot for you component Duke_n, but it's far more advanced than what I am looking for.  Anyway I saw the demos and it works perfectly. I'll take a look inside to see how it works.  Then, who get's the points? All of you have help a lot (Is there a way to divide the points?)
Sorry, I didn't read all the comments. My suggestion is: Make your window a top most window. Don't really hide it, just move it out of the screen so that rests a one pixel line at the screen border. When the mouse moves over it, then move it in the visible area. When the mouse leaves move it outside till there's the one pixel line...
Regards, ptm.
Avatar of cecheto

ASKER

I have given the points to TheNeil because he fixed the problems I was having, any way the full answer is build with rnicos comments also
Thanks cecheto

The Neil