zoukankan      html  css  js  c++  java
  • 关于WM_NCACTIVATE消息(重绘窗口非工作区难题解析)

    转自:http://blog.csdn.net/commandos/article/details/1904558

     case Win32.WM_NCACTIVATE:
                        if (m.WParam == (IntPtr)Win32.WM_FALSE)
                        {                         
                            m.Result = (IntPtr)Win32.WM_TRUE;
                        }
                        return;

    WM_NCACTIVATE消息。

     base.WndProc(ref m)负责画窗体被激活或者没有被激活时的样子,

    自己重画窗体非客户区域之后,就不能再调用base.WndProc(ref m)了。否则窗体又会被重新画成原来的样子。

    一开始使用

                    case Win32.WM_NCACTIVATE:
                       return;

    问题来了。发现这个窗体成了“霸王”窗口,没法激活其他的窗体了。

    原因就在这个消息的返回值上。

    if (m.WParam == (IntPtr)Win32.WM_FALSE)
     {                         
            m.Result = (IntPtr)Win32.WM_TRUE;
      }

    当WM_NCACTIVATE消息的wParam参数为true 时表示窗体被激活,为false 时表示窗体改为未被激活的状态,这个时候。消息的返回值。为true 表示允许激活它的窗体,为false 表示不允许激活其他的窗体

  • 相关阅读:
    JavaScript学习(五)
    浏览器输入地址到返回页面
    session cookie
    springboot 运行jar包
    mysql:The user specified as a definer ('root'@'%') does not exist
    easyUI
    json
    json fastjson
    springboot:because it is a JDK dynamic proxy that implements:
    git 提示错误:(non-fast-forward)
  • 原文地址:https://www.cnblogs.com/guanshan/p/guan2020-8-31.html
Copyright © 2011-2022 走看看