Solved

WM_MOVING in a not TitleBar window (How to)

Posted on 1998-09-23
3
456 Views
Last Modified: 2013-11-19
I have an MFC window without TitleBar. I want to handle WM_MOVE event in a given area. What can I do, when I catched that click? I tried to call CWnd::OnMoving(...) from there, but no.
Help please.
0
Comment
Question by:wau
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
danny_pav earned 50 total points
ID: 1322534
I am guessing you want to drag the window by clicking on some area and moving it as if you had clicked the title bar and moved it.

Then you should do this:
Override OnHitTest and tell the system that you are clicking in the title bar so that when clicked and moved, it will just do what it would for the title bar.


0
 

Author Comment

by:wau
ID: 1322535
I made like this:
UINT CMyDlg::OnNcHitTest(CPoint point)
{
      if( mouse_down ) //changed by WM_LBUTTONDOWN/UP
      {
            mouse_down=!mouse_down;
            return HTCAPTION;
      }
      else return CDialog::OnNcHitTest(point);
}
but no.
I tried also, calling this->SetCapture() and ::ReleaseCapture() every time mouse down/up occurs, but no.
Any of you have an idea what?
0
 
LVL 3

Expert Comment

by:danny_pav
ID: 1322536
you don't need to test the mouse, just return HTCAPTION when the point is in the area you want


      UINT CMyDlg::OnNcHitTest(CPoint point)
      {
      CRect rc;
      get_click_drag_rect(rc);
      if (rc.PtInRect(point))
            return HTCAPTION;
      return CDialog::OnNcHitTest(point);
      }


0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
configuration management 2 100
repeatEnd java challenge 42 83
repeateFront java challenge 31 87
fix34  challenge 9 97
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now