By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

Finding taskbar location

P: n/a
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.
Sep 4 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Sep 4, 4:50*pm, "Lee" <L...@nospam.netwrote:
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/
Sep 4 '08 #2

P: n/a
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.
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:bc**********************************@w7g2000h sa.googlegroups.com...
On Sep 4, 4:50 pm, "Lee" <L...@nospam.netwrote:
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/

Sep 4 '08 #3

P: n/a
On Sep 4, 5:10*pm, "Lee" <L...@nospam.netwrote:
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.

"rowe_newsgroups" <rowe_em...@yahoo.comwrote in message

news:bc**********************************@w7g2000h sa.googlegroups.com...
On Sep 4, 4:50 pm, "Lee" <L...@nospam.netwrote:
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/
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/
Sep 5 '08 #4

P: n/a
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.
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:86**********************************@2g2000hs n.googlegroups.com...
On Sep 4, 5:10 pm, "Lee" <L...@nospam.netwrote:
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.

"rowe_newsgroups" <rowe_em...@yahoo.comwrote in message

news:bc**********************************@w7g2000h sa.googlegroups.com...
On Sep 4, 4:50 pm, "Lee" <L...@nospam.netwrote:
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/
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/

Sep 5 '08 #5

P: n/a
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/
Sep 5 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.