• <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>

            天下

            記錄修行的印記

            How to move a dialog which does not have a caption(非標題欄移動對話框)

            How to move a dialog which does not have a caption
            Introduction
            This article is aimed at beginners, and presents two ways to move a dialog which does not have a caption by dragging its client area.
            1. WM_SYSCOMMAND message
            Sending the WM_SYSCOMMAND message starts the move operation. Add the following code to handle the mouse down event:
            BEGIN_MSG_MAP(CMainDlg)
                
            //...
                MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
            END_MSG_MAP()

            LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
            & bHandled)
            {
                SendMessage(WM_SYSCOMMAND, SC_MOVE
            |HTCAPTION);
                
            return 0;
            }


            2. WM_NCHITTEST message
            The idea is to handle the WM_NCHITTEST message to return HTCAPTION instead of HTCLIENT when the mouse is in the client area, to trick Windows to start moving the dialog.
            BEGIN_MSG_MAP(CMainDlg)
                
            //...
                MESSAGE_HANDLER(WM_NCHITTEST, OnNcHitTest)
            END_MSG_MAP()

            LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
            & bHandled)
            {
                
            if (::DefWindowProc(m_hWnd, uMsg, wParam, lParam) == 
                    HTCLIENT 
            && ::GetAsyncKeyState(MK_LBUTTON) < 0)
                  
            return HTCAPTION;

                
            return 0;
            }

            //For MFC
            //Devil for ever supplied the MFC solution that is shown below (thanks!). The idea is the same - to handle the WM_NCHITTEST message.
            UINT OnNcHitTest(CPoint point)
            {
                UINT nHit 
            = CDialog::OnNcHitTest(point);
                
            return (nHit == HTCLIENT ? HTCAPTION : nHit);
            }

            posted on 2012-02-16 10:24 天下 閱讀(501) 評論(0)  編輯 收藏 引用 所屬分類: Win32 、WTL

            <2016年6月>
            2930311234
            567891011
            12131415161718
            19202122232425
            262728293012
            3456789

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            国产毛片久久久久久国产毛片| 日日狠狠久久偷偷色综合0| 国产精品99久久久精品无码| 久久久久久久久波多野高潮| 久久久久久九九99精品| 办公室久久精品| 伊人色综合久久天天人手人婷 | 日韩欧美亚洲综合久久影院Ds| 中文字幕精品久久| 精品久久久久久成人AV| 久久本道久久综合伊人| 亚洲中文字幕久久精品无码APP| 久久精品视频网| 亚洲va久久久噜噜噜久久| 久久久精品视频免费观看| 韩国免费A级毛片久久| 亚洲欧美成人久久综合中文网 | 狠狠色丁香久久婷婷综合五月| 久久九九免费高清视频| 精品国产乱码久久久久久郑州公司| 久久久久亚洲爆乳少妇无| 国产精品久久99| 久久久久久国产精品免费无码| 怡红院日本一道日本久久 | 日本精品久久久中文字幕| 久久99久久99精品免视看动漫| 久久九九久精品国产| 岛国搬运www久久| 狠狠88综合久久久久综合网| 99久久精品免费看国产一区二区三区 | 久久久精品免费国产四虎| 日日躁夜夜躁狠狠久久AV| 精品国产日韩久久亚洲| 久久精品无码一区二区app| 丁香五月综合久久激情| 久久99国产精品久久99果冻传媒| 亚洲AV无码久久| 精品国产乱码久久久久久1区2区| 亚洲狠狠婷婷综合久久蜜芽 | 日本久久久精品中文字幕| 久久青青草原精品影院|