• <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++
            亚洲精品国产成人99久久| 综合久久精品色| 久久精品国产第一区二区| 日日狠狠久久偷偷色综合免费| 99精品国产99久久久久久97| 久久99国产精品二区不卡| 久久一区二区三区免费| 日本强好片久久久久久AAA| 九九久久精品无码专区| 久久综合香蕉国产蜜臀AV| 开心久久婷婷综合中文字幕| 精品久久久久久国产潘金莲| 久久亚洲中文字幕精品一区| 成人a毛片久久免费播放| 久久午夜伦鲁片免费无码| 欧美午夜A∨大片久久| 亚洲国产精品久久| 99re久久精品国产首页2020| 久久国产劲爆AV内射—百度| 久久人妻少妇嫩草AV蜜桃| 国产精品免费久久久久影院 | 久久99精品久久久久久9蜜桃| 伊人久久亚洲综合影院| 国产69精品久久久久777| 久久精品成人欧美大片| 久久这里有精品视频| 国内精品久久久久久不卡影院| 99久久精品毛片免费播放| 精品熟女少妇a∨免费久久| 久久久这里有精品| 香蕉久久夜色精品国产尤物| 热久久视久久精品18| 国产69精品久久久久观看软件| 日本亚洲色大成网站WWW久久 | 99久久精品国产毛片| 一级做a爰片久久毛片人呢| 91久久精品国产91性色也| 9191精品国产免费久久| 久久久久无码国产精品不卡| 久久九九免费高清视频| 久久亚洲精品无码VA大香大香|