• <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 漂漂 閱讀(1682) 評論(0)  編輯 收藏 引用 所屬分類: 深入vc++
            亚洲精品无码专区久久同性男| 一本久久a久久精品亚洲| AV无码久久久久不卡网站下载| 亚洲中文久久精品无码ww16| 久久中文字幕人妻丝袜| AV狠狠色丁香婷婷综合久久| 久久天堂AV综合合色蜜桃网| 久久不射电影网| 久久天天躁狠狠躁夜夜躁2014| 久久精品中文字幕无码绿巨人| 久久99精品免费一区二区| 伊人久久一区二区三区无码| 熟妇人妻久久中文字幕| 无码人妻少妇久久中文字幕| 99久久精品免费看国产一区二区三区| 色偷偷偷久久伊人大杳蕉| 久久亚洲AV无码精品色午夜麻豆| 99国产精品久久| 国产情侣久久久久aⅴ免费| 激情伊人五月天久久综合| 欧美一区二区三区久久综| 久久这里只有精品首页| 久久夜色精品国产亚洲| 久久国产精品成人免费| 久久天天婷婷五月俺也去| 女人香蕉久久**毛片精品| 2020国产成人久久精品| 久久久中文字幕日本| 人人狠狠综合88综合久久| 久久久噜噜噜久久中文字幕色伊伊 | 久久精品国产精品青草| 国产偷久久久精品专区| 99精品国产免费久久久久久下载| 国产一级做a爰片久久毛片| 国产精品久久国产精品99盘| 亚洲午夜久久久久久噜噜噜| 国产精品中文久久久久久久| 色欲av伊人久久大香线蕉影院| 久久久SS麻豆欧美国产日韩| 国内精品久久九九国产精品| 国产精品热久久无码av|