Customer area drag technology and its Application in Windows window

Source: Internet
Author: User

The Windows application window generally includes two types: the normal window and the Changgui Advanced window at the top of the bar. The former is customized by Windows internal functionality and has all the common features of Windows application windows: a title bar, a window border, a maximized button, a minimized button and a system default shortcut key, and a mouse support feature. Drag the title bar of the window with the left mouse button to move the window anywhere on the screen. You can change the window size when the mouse cursor is positioned over the window's border; the latter is a custom advanced window that does not have any properties of a normal window, and the control of the entire window must be determined by the programmer one by one, Typical examples of this type of window are IME input applications in Windows, UCWIN4.0 platforms, various floating toolkits, desktop toolbars in office, and Third-party-developed Chinese character input platforms.

One notable feature of Windows, which is a top-level top-level window with no title, is that you do not need to change the window size but must have the client area drag feature of the window. Because the drag function of the normal window is done by the system, it is difficult for a typical programmer to run into the problem, not to mention how to implement it, without having to consider the problem of customer area drag. Developers often want to develop their own software with the Classic Software window customer area Drag function, the author used to imitate the system mouse click title bar Drag window and Windows system provided by the API sent inside the internal drag command to achieve no title often top level window of the customer drag function, The results are not ideal. Later had to in the window function by directly processing Wm_lbuttondown, Wm_mousemove and Wm_lbuttonup message, control the client command area that the window drags, drag Start, window move, drag the virtual box to draw, the virtual frame move and drag to end process, To implement the customer area drag scheme for the Advanced top-level window. The following is a detailed description of the specific methods and key techniques for implementing the programme in its own practical experience.

One, the Windows detects the customer to drag the command and the mouse cursor dynamic hint realization method

The client areas of WINDOWS with no title bar that often reside in the top-level high-level window are generally divided into two types: the specific customer command area and the neutral Customer command area. A specific customer command area is a specific subset of rectangular areas defined by using "RECT", which detects and processes mouse commands that occur within the zone; a neutral customer command area is a section of the client area of a window that is not explicitly defined, that is, a portion of all the specific customer command areas, The window function determines whether the mouse commands that occur within the zone are processed, depending on the actual needs. The primary problem in implementing the top-most advanced window drag function is how to detect and handle mouse commands within a specific customer command area and in a neutral customer command area, and how to use the mouse cursor to dynamically prompt a user to drag a window at this point.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.