|
-
Jun 28th, 2001, 11:27 PM
#1
Thread Starter
PowerPoster
Accesssing the title bar
OK that was funny. I can put the text any where on the window including the title bar but I cannot put or move my button in there.
I used this code but it moves the button on the top left corner of the CLIENT area of the window:
Code:
HDC hdc;
case WM_PAINT:
hdc = GetWindowDC(hwnd);
MoveWindow(buttonhwnd, 0, 0, 300,300, true);
That code should get the DC of the whole window and then the if the x value is 0 then it should be the top left corner on the title bar.... but that is not what it is.
Why does not that code work.
-
Jun 29th, 2001, 05:12 AM
#2
Monday Morning Lunatic
The non-client area (title bar, menu bar, borders, etc.) aren't really a window, so you can't put controls into them. You need to draw onto the HDC you get (taking into account different window metrics). Handle the WM_NC_HITTEST (I think, look in MSDN) message to notice if it's been clicked.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|