• <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 天下 閱讀(490) 評論(0)  編輯 收藏 引用 所屬分類: Win32WTL

            <2013年5月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            亚洲人成网站999久久久综合 | 热久久视久久精品18| 久久久国产精品| 久久有码中文字幕| 久久精品国产2020| 奇米影视7777久久精品| 91精品日韩人妻无码久久不卡| 欧美精品一本久久男人的天堂| 国内精品久久久久久久亚洲| 精品无码久久久久国产动漫3d| 国产精品久久久久久久久免费| 久久黄视频| 精品久久久噜噜噜久久久 | 一本久道久久综合狠狠爱| 国产精品99久久久久久www| 手机看片久久高清国产日韩| 国产精品青草久久久久婷婷 | 久久精品人妻中文系列| 18岁日韩内射颜射午夜久久成人| 久久久久av无码免费网| 久久无码精品一区二区三区| 国产亚洲精品美女久久久| 伊人久久国产免费观看视频| 久久精品国产影库免费看| 天堂久久天堂AV色综合| 国产免费久久精品99re丫y| 久久精品国产99国产精品| 狠狠色丁香婷婷久久综合不卡| 久久天天躁狠狠躁夜夜2020一| 久久国产成人| 久久不见久久见免费影院www日本| 99999久久久久久亚洲| 中文字幕乱码人妻无码久久| 大香伊人久久精品一区二区| 久久综合一区二区无码| 久久免费国产精品| 一级a性色生活片久久无少妇一级婬片免费放 | 久久久噜噜噜久久熟女AA片| 色综合久久无码五十路人妻| 久久AV无码精品人妻糸列| 日韩精品久久久久久久电影蜜臀 |