The above window is a borderless form:
To remove a window border from the window properties:
First define two variables:
To initialize in the constructor:
Because you want to press the left mouse button to drag, so increase the left mouse button message:
Tips:
Capture mouse to position mouse to run out of the current window: increase mobile Mouse messages:
The function of the mouse button down the hour is as follows:
Increase the message that the mouse is bouncing off:
Mouse movement of the message function is implemented as follows: the mouse position minus the beginning of the mouse to move the distance, in order to reduce the window flicker, so that the distance is greater than two pixels to let him move, because the movement will have a noticeable flicker. Getwindowsrect () Gets the original position of the window. Offsetrect () Gets the new position after the rectangle offset
Before ' Capture mouse now to release, this is a pair to use together
Dealing with the second problem when the mouse loses focus: to let go of the mouse bounce, prohibit movement. To increase the window activation message:
Inactive when the mouse becomes out of focus during movement
From for notes (Wiz)
Cheetah MFC 、--dragging a borderless form