Taskbar state change notification.

G

Guest

I am developing a Windows Forms application using VS.Net 2003 in C#. My
application is normally sized to cover the entire desktop when it is not
iconified. I would like to resize the application depending on whether the
Windows TaskBar is in the hidden or displayed state.

Is there a notification that my application can hook to when its state
changes?
Is there a system variable my app can query to get its state (hidden or
displayed)?
Is there a system variable my app can query to get the position and size of
the TaskBar?

Thanks,
Dave
 
T

Tim Scott

Dave,

To get notified when the taskbar moves, try overriding
Control.PreProcessMessage() and look for the WM_SETTINGCHANGE message
and SPI_GETWORKAREA. See
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=188979&SiteID=1
and
http://msdn.microsoft.com/library/d...wsformscontrolclasspreprocessmessagetopic.asp

I haven't tried it so I don't know that it actually works.

Some stuff on finding the position of the system tray:
http://www.codeproject.com/shell/trayposition.asp

Or, if writing your own system tray type of control, Arik P. has a nice
CodeProject article on this using .NET:
http://www.codeproject.com/csharp/csdoesshell3.asp

I know that's a assortment of links, but it should get you started.
Post back if you get it working!

-- Tim Scott
http://geekswithblogs.net/tscott
 

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