• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 224  文章 - 41  trackbacks - 0
            <2010年8月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            享受編程

            常用鏈接

            留言簿(11)

            隨筆分類(159)

            隨筆檔案(224)

            文章分類(2)

            文章檔案(4)

            經典c++博客

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            msdn的解釋:

            The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

            使用WM_NCLBUTTONDOWN 消息:
            利用標題欄的消息,欺騙windows使得點擊客戶區可實現窗體的移動。在打擊客戶區的時候假傳消息給windows,告訴他現在左擊標題欄。

            void CDragWindowDlg::OnLButtonDown(UINT nFlags, CPoint point)
            {
             // TODO: Add your message handler code here and/or call default
             PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
             CDialog::OnLButtonDown(nFlags, point);
            }

            C# 使用WM_NCLBUTTONDOWN消息實現任意位置移動窗體

            public const int WM_NCLBUTTONDOWN = 0xA1;
                   public const int HT_CAPTION = 0x2;
                [DllImportAttribute("user32.dll")]
              public static extern int SendMessage(IntPtr hWnd,
                            int Msg, int wParam, int lParam);
            [DllImportAttribute("user32.dll")]
             public static extern bool ReleaseCapture();

              private void Form1_MouseDown(object sender, MouseEventArgs e)
              {
                if (e.Button == MouseButtons.Left)
            {
              if ((e.Clicks == 1))
            {
            ReleaseCapture();

            SendMessage(this.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
             }

             }

             }
            posted on 2010-03-18 10:40 漂漂 閱讀(1667) 評論(0)  編輯 收藏 引用 所屬分類: 深入vc++
            一本一本久久aa综合精品| 久久乐国产精品亚洲综合| 久久国内免费视频| 亚洲国产精品18久久久久久| 香蕉久久av一区二区三区| 嫩草影院久久99| 久久天天躁狠狠躁夜夜2020一| 久久无码人妻一区二区三区午夜| 91秦先生久久久久久久| 久久www免费人成看片| 精品一区二区久久| 久久婷婷国产剧情内射白浆| 9久久9久久精品| 伊人久久久AV老熟妇色| 精品无码久久久久久久久久| 亚洲AV无码成人网站久久精品大| 久久精品国产精品亚洲艾草网美妙| 精品久久久久久中文字幕大豆网| 草草久久久无码国产专区| 亚洲午夜久久久久久久久电影网 | 久久综合亚洲色HEZYO社区 | 日本久久久久久中文字幕| 伊人久久大香线焦AV综合影院| 51久久夜色精品国产| 91精品国产综合久久精品| 久久精品一本到99热免费| 久久一区二区三区99| 久久成人国产精品一区二区| 久久国产精品成人免费 | 国产精品成人无码久久久久久 | 久久影院午夜理论片无码| 一本一道久久精品综合| 亚洲精品高清国产一久久| 国产精品久久久福利| 国产精品久久毛片完整版| 国内精品久久国产大陆| 久久精品成人国产午夜| 久久99精品久久久久久久久久 | 久久久亚洲裙底偷窥综合| 精品国产乱码久久久久久呢| 老男人久久青草av高清|