Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 786
  • Last Modified:

CDDS_PREERASE notification in CListCtrl

How can I catch the CDDS_PREERASE notification in a CListCtrl? I am assuming that a return of CDRF_SKIPDEFAULT will stop the CListCtrl from erasing its contents before I start any custom drawing.
0
gunaro
Asked:
gunaro
1 Solution
 
AndyAinscowCommented:
About Custom Draw Notification Messages
All common controls that support custom draw send NM_CUSTOMDRAW notification messages at specific points during drawing operations. These notifications describe drawing operations that apply to the entire control as well as drawing operations specific to items within the control. Like many notification messages, NM_CUSTOMDRAW notifications are sent as WM_NOTIFY messages.

The lParam parameter of a custom draw notification message will be the address of an NMCUSTOMDRAW structure or a control-specific structure that contains an NMCUSTOMDRAW structure as its first member. The following table illustrates the relationship between the controls and the structures they use.

Structure  Used by
NMCUSTOMDRAW Rebar, trackbar, and header controls
NMLVCUSTOMDRAW  List-view controls
NMTBCUSTOMDRAW  Toolbar controls
NMTTCUSTOMDRAW  ToolTip controls
NMTVCUSTOMDRAW  Tree-view controls


I think what you require is to trap the notify message about custom draw, then in the NMCUSTOMDRAW structure check the dwDrawStage member for being set to CDDS_PREERASE.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now