CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2007
    Location
    China
    Posts
    13

    Is there any way to Raise WM_NCCALCSIZE message?

    Is there any way to Raise WM_NCCALCSIZE message? I mean to force the window to recalculate its client area. Send what message to do that?Thanks.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Is there any way to Raise WM_NCCALCSIZE message?

    You can send it yourself . . .

  3. #3
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Is there any way to Raise WM_NCCALCSIZE message?

    Quote Originally Posted by Skizmo
    You can send it yourself . . .
    Hm.. no good. WM_NCCALCSIZE is something that windows sends and then windows does the rest of the job. So, if windows is not the one sending it, it would not do anything. Your window will simply handle it and nothing comes out of it.

    Anyways, a little poking around the APIs listed under See Also for WM_NCCALCSIZE would have revealed that there are some APIs that trigger this message.

    Why don't people read documentation anymore

  4. #4
    Join Date
    Feb 2025
    Posts
    1

    Re: Is there any way to Raise WM_NCCALCSIZE message?

    So to close the thread the answer seems to be, after reading @kirants reply who for some reason concealed his answer in a shroud of mystery, you use SetWindowPos with flag SWP_FRAMECHANGED that will trigger WM_NCCALCSIZE even when the size of the window hasn't changed. Tested it in my case and it works as expected.

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