zoukankan      html  css  js  c++  java
  • NM_CUSTOMDRAW 消息

    When the control first starts to paint itself, in response to a WM_PAINT, you receive a NM_CUSTOMDRAW notification message, with the draw stage set to CDDS_PREPAINT. If you don’t handle this yourself that will be the end of it, as the default message handler will just tell the control to carry on with default drawing and not to interrupt you again.

    If you do handle the message, you have a chance to do a bit of painting yourself if you want. You can then set a flag in the return result that says whether you want the control to do its default painting; you usually will. You can also set flags to say whether you want to receive further notifications. You can ask the control to send you a WM_CUSTOMDRAW notification for the CDDS_POSTPAINT draw stage when the control has finished drawing (you can then do some extra drawing yourself). You can also say that you want to get notifications for the CDDS_ITEMPREPAINT draw stage for each item drawn.

    Similarly, when you get each WM_CUSTOMDRAW notification for the CDDS_ITEMPREPAINT draw stage, you can set up the colours to use, make changes to the device context including font changes, and maybe do some drawing yourself. You can then say whether you want the default painting for the item and whether you want to receive a CDDS_ITEMPOSTPAINT when the item drawing is finished.

    If you are in report mode, you can also ask for individual notifications for each subitem. These have the draw stage set to (CDDS_ITEMPREPAINT | CDDS_SUBITEM), and again you can fiddle with the device context, do your own drawing and/or let the control do some drawing and optionally receive a (CDDS_ITEMPOSTPAINT | CDDS_SUBITEM) drawing stage message at the end of each subitem.

    NOTE: subitem notifications are only available for custom controls V4.71 (that is, for IE4.0 or Windows 98) or later, so please ensure that you check the version of COMCTL32 you have on your machine if you intend to use custom draw controls.

  • 相关阅读:
    Linux学习笔记:常用100条命令(三)
    Linux学习笔记:常用100条命令(二)
    k8s的imagePullSecrets如何生成及使用
    Jenkins基于https的k8s配置
    ubuntu supervisor管理uwsgi+nginx
    ubuntu Django + Uwsgi + Nginx 的生产环境部署
    ubuntu 安装和配置 GitLab
    ubuntu 安装harbor仓库
    ubuntu 安装Jenkins
    php过滤html标签截取部分内容
  • 原文地址:https://www.cnblogs.com/findumars/p/5402948.html
Copyright © 2011-2022 走看看