• <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年6月>
            303112345
            6789101112
            13141516171819
            20212223242526
            27282930123
            45678910

            享受編程

            常用鏈接

            留言簿(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++
            亚洲中文精品久久久久久不卡| 久久国产精品无码HDAV| 91亚洲国产成人久久精品网址| 欧美一区二区精品久久| 精品久久人人做人人爽综合 | 国产精品久久新婚兰兰| 久久久久亚洲AV成人片| 91久久精品电影| 色诱久久久久综合网ywww| 中文字幕精品无码久久久久久3D日动漫| 伊人久久综合成人网| 爱做久久久久久| 久久国产精品成人免费| 亚洲va久久久噜噜噜久久天堂| 久久久久久久综合日本| 久久香蕉国产线看观看乱码| 亚洲色欲久久久久综合网| 久久99毛片免费观看不卡| 合区精品久久久中文字幕一区| 88久久精品无码一区二区毛片| 中文字幕无码免费久久| 久久e热在这里只有国产中文精品99| 久久精品夜夜夜夜夜久久| 久久综合鬼色88久久精品综合自在自线噜噜 | 久久夜色精品国产噜噜亚洲a| 久久96国产精品久久久| 久久无码人妻一区二区三区午夜| 亚洲国产成人久久综合区| 精品国产青草久久久久福利| 国产精品美女久久久| 伊人久久大香线焦综合四虎| 色偷偷88888欧美精品久久久 | 久久中文字幕视频、最近更新| 人人狠狠综合久久亚洲88| 久久99精品久久久久久久久久| 久久精品aⅴ无码中文字字幕重口| 久久综合鬼色88久久精品综合自在自线噜噜| 国产高潮久久免费观看| 99久久精品免费观看国产| 久久久国产精品| 亚洲国产天堂久久综合|