Results 1 to 2 of 2

Thread: Accesssing the title bar

  1. #1

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    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.
    Baaaaaaaaah

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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
  •  



Click Here to Expand Forum to Full Width