Finding taskbar location

L

Lee

Hi,

I'm looking for a way to determine the location of the taskbar, whether it's
located at the top, bottom, left or right of the screen. Is there any way
this can be done and if so, would anyone be kind enough to post example
code?

Thanks.
 
R

rowe_newsgroups

Hi,

I'm looking for a way to determine the location of the taskbar, whether it's
located at the top, bottom, left or right of the screen. Is there any way
this can be done and if so, would anyone be kind enough to post example
code?

Thanks.

I'm curious, why would you need this?

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
L

Lee

Hi,

I want a form to pop up on hovering over a notifyicon (instead of a tooltip)
and i want it to display in the vicinity of the taskbar. To do this, I need
to know where the taskbar is located.


Hi,

I'm looking for a way to determine the location of the taskbar, whether
it's
located at the top, bottom, left or right of the screen. Is there any way
this can be done and if so, would anyone be kind enough to post example
code?

Thanks.

I'm curious, why would you need this?

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
R

rowe_newsgroups

Hi,

I want a form to pop up on hovering over a notifyicon (instead of a tooltip)
and i want it to display in the vicinity of the taskbar. To do this, I need
to know where the taskbar is located.






I'm curious, why would you need this?

Thanks,

Seth Rowe [MVP]http://sethrowe.blogspot.com/

You might be able to use the FindWindowEx WinAPI function to find the
taskbar window if it has a standard name (couldn't tell you if it
does). Once you have a reference to it you should be able to find it's
location.

What I would suggest however, is to have the form initially pop-up in
the bottom-right corner of the window. Then make sure that the window
can be moved by the user and simply remember where the form was
dragged. That way the user can have the form pop-up where ever they
want (a very good thing) and your job will be much easier, especially
from a testing standpoint.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
L

Lee

It would seem that the taskbar does have a standard name "Shell_TrayWnd"
from which you can get it's location. There seems to be plenty of examples
dealing with this and the FindWindowEx command, so thank you for pointing me
in the right direction!

I'm also considering your suggestion about allowing the user to move the
pop-up to a desired location. To be honest, it's something that never even
crossed my mind but I guess it gives the user more flexibility in how it's
displayed.

Thanks again.


Hi,

I want a form to pop up on hovering over a notifyicon (instead of a
tooltip)
and i want it to display in the vicinity of the taskbar. To do this, I
need
to know where the taskbar is located.






I'm curious, why would you need this?

Thanks,

Seth Rowe [MVP]http://sethrowe.blogspot.com/

You might be able to use the FindWindowEx WinAPI function to find the
taskbar window if it has a standard name (couldn't tell you if it
does). Once you have a reference to it you should be able to find it's
location.

What I would suggest however, is to have the form initially pop-up in
the bottom-right corner of the window. Then make sure that the window
can be moved by the user and simply remember where the form was
dragged. That way the user can have the form pop-up where ever they
want (a very good thing) and your job will be much easier, especially
from a testing standpoint.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
R

rowe_newsgroups

It would seem that the taskbar does have a standard name "Shell_TrayWnd"
from which you can get it's location. There seems to be plenty of examples
dealing with this and the FindWindowEx command, so thank you for pointing me
in the right direction!

When it comes to WinApi a site that could be very handy for you is
http://pinvoke.net/
I'm also considering your suggestion about allowing the user to move the
pop-up to a desired location. To be honest, it's something that never even
crossed my mind but I guess it gives the user more flexibility in how it's
displayed.

That's actually the main reason I asked why you were looking to do
something. Often times developers can get "tunnel vision" and not see
an alternative way to accomplish the same goal.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top