想问一下:当窗口最大化和最小化时除了触发WM_SIZE消息,还触发了什么消息?有没有专门针对最大化或最小化的消息?

解决方案 »

  1.   

    WM_SIZE消息的wParam参数就包含了最大化和最小化标记:
    SIZE_MAXHIDE Message is sent to all pop-up windows when some other window is maximized. 
    SIZE_MAXIMIZED The window has been maximized. 
    SIZE_MAXSHOW Message is sent to all pop-up windows when some other window has been restored to its former size. 
    SIZE_MINIMIZED The window has been minimized. 
    SIZE_RESTORED The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies. 
      

  2.   

    楼上都说完了.另外还可以通过函数CWnd::IsIconic 来判断窗口是否为最小化.通过函数:CWnd::IsZoomed来判断窗口是否为最大化.