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

    Setting window size

    I want to set the window size and get the same values back.
    But, what SetWindowPos() takes are not the values returned by
    either GetWindowRect() or GetClientRect().
    Pl. suggest.


  2. #2
    Join Date
    Apr 1999
    Posts
    383

    Re: Setting window size

    Use SetWindowPos with the results of GetWindowPos.

    Dave


  3. #3
    Join Date
    Apr 1999
    Posts
    90

    Re: Setting window size

    The SetWindowPos() function takes coordinates relative to the parent window. However, GetWindowRect() returns screen coordinates. So you have to call the ScreenToClient() function using the same parent window in order to get the original coordinates. The GetClientRect() function returns coordinates relative to the window being used, so the top & left coordinate is always (0,0). In all cases, the width & height are always the same.


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