In order to do the below you need to subclass the WndProc for the application
you are targetting, trap drawing messages for WM_NCPAINT (I think, it's been
a while), let the base handler paint, then paint your stuff over the top. In
order to
get the region you'll be painting over, you'll have to do some special work to
get
the area the title bar occupies, some additional special work to pad out your
drawing so you don't mess up the system glyphs on the right, etc... It isn't a
very
easy task if I recall, and it would require a large number of PInvoke calls.
A simpler mechanism is simply to overdraw that region. You can always get the
hDC of the desktop which enables you to paint over any region of the screen.
You can attach a Graphics object and simply do your drawing in that manner.
You'll have to look for when the application moves or repaints it's own title
bar
so that you can update your stuff appropriately (normally the title bar only
repaints if something is moved over it I believe). Still, not an easy task
considering
you'll still have to find the right margin for drawing based on system glyphs,
etc...
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers
supster said:
Thanks for your input.
I was actually hoping to display some System.Drawing objects such as a
series of different colored/sized rectangles on the title bar.
I'm checking out
www.pinvoke.net, but I don't think its what I was
looking for.
edit:
heres a photoshop of what I want to do:
http://members.cox.net/preluge/titlebar.png