943,015 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 509
  • C++ RSS
Sep 2nd, 2010
0

Custom Title Bar

Expand Post »
I realize that there are plenty of tutorials on how to create a "Custom Win32 Title Bar." The problem is.. none of the tutorials I have found so far.. discusses how a person would be able to "drag" the replaced title bar.. as one would drag the "normal" title bar.

If you do not know what I mean by "custom" title bar.. it only means that I would like to remove the "initial" window title bar (..the bar upon which the window's title resides) and replace it with one that I drew myself. Not only would I like to replace the standard title bar however.. but I would like to learn how to be able to drag the window from MY custom title bar image.. as one would drag the screen with the standard title bar.

Also.. if it is possible.. I would like to replicate the functionality which the WS_THICKFRAME attribute provides to a window.. only on custom bitmaps.

Example: I want a user to be able to click on lines that I drew.... which would reuslt in the window being scaled.. (as would occur if a person scaled a window with the default window sides provided).
Last edited by PixelExchange; Sep 2nd, 2010 at 11:12 am.
Similar Threads
Reputation Points: 11
Solved Threads: 2
Junior Poster in Training
PixelExchange is offline Offline
92 posts
since May 2010
Sep 3rd, 2010
0
Re: Custom Title Bar
I've found two tutorials on how to drag a window from a custom title bar.. the problem is.. none of the tutorials work.

The first tutorial.. found on Catch22.com's website..
tells me that I need to handle the WM_NCHITEST event.. and have it to return the value of HTCAPTION to signify the caption bar was clicked.

The problem is.. if I attempt to handle any portion of the WM_NCHITEST event.. my screen freezes.. and I am unable to perform ANY actions on the window.. not even clicks.. or mouse movements.

Here is some sample code I used to try to handle the WM_NCHITEST event:
c++ Syntax (Toggle Plain Text)
  1. case WM_NCHITTEST:
  2. if (mouseclicked == true)
  3. {return HTCAPTION;}
  4. break;

Also.. on another tutorial found at
http://www.flipcode.com/archives/Win...Skinning.shtml

I was told that if sent the window message: SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION,NULL);
On a left mouse click.. the window would be fooled into believing that the caption bar was clicked.. and thusly begin to drag as though the caption bar WAS clicked. However.. the above method also.. did not work.

Does any one know why neither of the two window drag methods mentioned above.. worked?
Also.. can someone please offer up another suggestion as to how one would be able to drag a window (with a custom title bar) using Win32?
Last edited by PixelExchange; Sep 3rd, 2010 at 9:51 am.
Reputation Points: 11
Solved Threads: 2
Junior Poster in Training
PixelExchange is offline Offline
92 posts
since May 2010
Sep 3rd, 2010
0
Re: Custom Title Bar
Alright.. I've managed to get the drag window portion working.. Now I need to simulate the window "scale" functionality on a custom bitmap. Does anyone know the window event that is sent.. when the window is being scaled? Thank you.
Last edited by PixelExchange; Sep 3rd, 2010 at 9:53 am.
Reputation Points: 11
Solved Threads: 2
Junior Poster in Training
PixelExchange is offline Offline
92 posts
since May 2010
Sep 3rd, 2010
0
Re: Custom Title Bar
Solved. Thanks.
Reputation Points: 11
Solved Threads: 2
Junior Poster in Training
PixelExchange is offline Offline
92 posts
since May 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: returning a 2d array
Next Thread in C++ Forum Timeline: Restrict friend to one method





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC