CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    How Do I Get the Rect WITHIN a Window?

    Ho do I get the Rect dimensions of the drawable area WITHIN a window in MFC/win32? Is there a way to set this- it seems that playing around with a CREATESTRUCT structure's .cx & .cy values just modify the window's dimensions and I need to set or at least determin the area within.

    Thanks to one and all!




  2. #2
    Guest

    Re: How Do I Get the Rect WITHIN a Window?

    DO this:

    void SomeWindowDerivedClass::YourFunction()
    {
    RECT rect;

    GetClientRect(&rect);
    }

    rect will then contain the coordinates for the window. It will exclude the area of the window taken up by the menu and title bar.

    There is a function similar to GetClientRect which will get that area including the title bar and menu but I forget what it is. The documentation for GetClientRect will probably tell you about it (but I doubt you want that function anyway)


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

Featured