• <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++
            中文字幕人妻色偷偷久久| 亚洲精品无码久久不卡| 日本五月天婷久久网站| 久久人人爽人人爽人人爽| 亚洲AV无码1区2区久久| 国产精品久久久99| 亚洲欧美一级久久精品| 狠狠88综合久久久久综合网| 精品久久综合1区2区3区激情| 久久精品极品盛宴观看| 1000部精品久久久久久久久| 色婷婷噜噜久久国产精品12p| 亚洲国产另类久久久精品小说| 99久久99久久精品国产片| 婷婷久久五月天| 久久青青草原精品影院| 精品熟女少妇AV免费久久 | 久久国产精品久久国产精品| 精品久久久无码中文字幕天天| 2021国内久久精品| 国产成人久久精品二区三区| 久久久无码一区二区三区| 亚洲精品综合久久| 久久久久亚洲AV无码去区首| 国产精品久久成人影院| 亚洲精品蜜桃久久久久久| 久久婷婷五月综合97色直播| 国产成人精品久久一区二区三区av| 久久永久免费人妻精品下载| 香港aa三级久久三级老师2021国产三级精品三级在| 欧美精品久久久久久久自慰| 7777久久久国产精品消防器材| 久久亚洲国产成人精品无码区| 精品久久久久久无码人妻蜜桃| 久久久久久午夜成人影院| 久久精品一区二区影院| 99久久精品免费国产大片| 久久免费国产精品一区二区| 久久精品人人槡人妻人人玩AV| 精品伊人久久久| 国产精品久久久久久久久软件 |