Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to put an Picture on Form's Title bar

Status
Not open for further replies.

TNKPro

Programmer
Jan 7, 2003
2
0
0
VN
I've been searching for so long but couldn't find out HOW to PUT an PICTURE on Form's Title bar with APIs function.
Does any one know the code or the solution for it ? Please show me whatever you know to make it !
Thanks
 
First of all you should obtain tha handle to the window's device context (NOT the cliet area device context) by using GetWindowDC. This will enable you to paint anywhere in the non client area (including the title bar).

The next question is how to render the picture there...
Check out IPicture in the MSDN, this will enable you to render all sorts of pictures, however I never used this in VB (but since it is a COM interface it probably will).
 
You should also subclass the form to prevent flickering of the picture. WM_NCACTIVATE and WM_NCPAINT are I believe the message's to be processed.

Used it once to make a fourth button aside from the three that windows provides. Great fun....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top