WM_GETMINMAXINFO problem when window is maximized
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: WM_GETMINMAXINFO problem when window is maximized

  1. #1
    Join Date
    Feb 2013
    Posts
    3

    Post WM_GETMINMAXINFO problem when window is maximized

    I want to reduce (by 1 only pixel) the height of a window when it is show maximized.
    In my window procedure I have the following code in C++:


    case WM_GETMINMAXINFO:
    LPMINMAXINFO minmaxinfopunt = (LPMINMAXINFO) lParam;
    minmaxinfopunt->ptMaxSize.y -= 1;
    return 0;


    Now a strange thing happen:
    - with values from 1 to 16 (that is, from "minmaxinfopunt->ptMaxSize.y -= 1;" to "minmaxinfopunt->ptMaxSize.y -= 16;") I always get the height previously memorized in ptMaxSize.y, that is, the mazimized (by the system) height of the window.

    - with values equal or greater than 17 I get the height of the window reduced as aspected.

    I can I solve this problem?
    Thanks.

  2. #2
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,557

    Re: WM_GETMINMAXINFO problem when window is maximized

    What is the value of GetSystemMetrics(SM_CYMIN)? What about the other SM_CY?? values on the system?

  3. #3
    Join Date
    Feb 2013
    Posts
    3

    Re: WM_GETMINMAXINFO problem when window is maximized

    GetSystemMetrics( SM_CYMIN ) is 38 on my system.
    But I don't understand what I have to do.

  4. #4
    Join Date
    Feb 2013
    Posts
    3

    Re: WM_GETMINMAXINFO problem when window is maximized

    Quote Originally Posted by 2kaud View Post
    What is the value of GetSystemMetrics(SM_CYMIN)? What about the other SM_CY?? values on the system?
    But I don't understand what I have to do.

  5. #5
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,557

    Re: WM_GETMINMAXINFO problem when window is maximized

    I was just wondering if it was the same problem I had a few years ago when trying to create a very narrow window. Amongst other things, system metrics state the smallest x and y size of a window. As the code works for you if the size is 17 or above but not if it is less then 17 I thought it might have to do with these metrics (there are loads of these if you look up the documentation for GetSystemMetrics). I was hoping for a value of 16!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center