Cedit non-customer zone, customer zone, text Zone

Source: Internet
Author: User

Cedit attributes:
In mulitline, edit is divided into three layers: NC, client (wordless area), and text area (setrect)
In singleline, edit is only divided into the NC and client regions, that is, the client region and the text region overlap (in this case, setrect is invalid)
Getrect, setrect -- set the text area and subtract one from the client. It is only valid for multiple rows? When a single row is used, the two always overlap. Es_multiline, es_wantreturn!
Wm_nccalcsize: lprect rc = (lprect) lparam; Calculate non-customer zones

Crect rcttext;
: Sendmessage (heditdir, em_getrect, 0, (lparam) & rcttext );
Rcttext. offsetrect (0, 10 );
: Sendmessage (heditdir, em_setrect, 0, (lparam) & rcttext );


After the edit window is subclass-type, since the edit window has been created, your editproc cannot receive wm_nccalcsize, so you can move the edit window after subclass to re-trigger this message

Cedit draw sequence:
Wm_ncpaint: When multi line is used, ncpaint will fl the customer area, so you need to pay attention to tailoring; when single line is used, it cannot be flushed If You Want To fl the customer area.
Erasebk -- fl the client area (it is useless in single line mode, because it overlaps with the text area, and the text area is finally drawn)
Wm_ctlcolor nctlcolor = ctlcolor_edit; here, the background of the text area is flushed. (You can paint the image directly here, but return the null brush, or if you do not paint the image, but return a non-null brush)
Wm_paint won't get it ???

Case wm_ncpaint:
{
HDC;
HDC = getdcex (hwnd, (hrgn) wparam, dcx_window | dcx_intersectrgn );
// Paint into this DC
Releasedc (hwnd, HDC );
}

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.