MSDN NM_CUSTOMDRAW (list view) 中文翻译

NM_CUSTOMDRAW (list view) Notification

NM_CUSTOMDRAW(list view)通知


Sent by a list-view control to notify its parent windows about drawing operations. This notification is sent in the form of a WM_NOTIFY message.

list-view控件向其父窗口发送重绘操作的通知。这些通知以WM_NOTIFY消息的形式发送。

Syntax

NM_CUSTOMDRAW

    lpNMCustomDraw = (LPNMLVCUSTOMDRAW) lParam;

Parameters

lpNMCustomDraw

Pointer to a NMLVCUSTOMDRAW structure that contains information about the drawing operation. The first member of this structure, nmcd, is a pointer to an NMCUSTOMDRAW structure. The dwItemSpec member of the structure pointed to by nmcd contains the identifier of the item being drawn and the lItemlParam member contains its application-defined data.

包含重绘操作信息的NMLVCUSTOMDRAW结构体指针。Nmcd是此结构体的第一个成员,它是指向NMCUSTOMDRAW结构体的指针。Nmcd的结构体包含了正被重绘成员的标识符dwItemSpec和应用程序定义的数据lItemlParam

Return Value

The value your application can return depends on the current drawing stage. The dwDrawState member of the associated NMCUSTOMDRAW structure holds a value that specifies the drawing stage. You must return one of the following values.

程序的返回值可以根据当前的绘制阶段而定。NMCUSTOMDRAW结构体成员dwDrawState指定了一个代表当前状态的值。你必须返回下列这些值。

CDRF_DODEFAULT

The control will draw itself. It will not send any additional NM_CUSTOMDRAW messages for this paint cycle. This occurs when dwDrawState equals CDDS_PREPAINT.

控件将绘制自己。它将不再为循环绘画发送额外的NM_CUSTOMDRAW消息。当dwDrawStateCDDS_PREPAINT时将发生这种情况。

CDRF_DOERASE

Windows Vista. The control will not draw the focus rect around an item.

Windows Vista中,控件将不再绘制项目焦点周围的矩形。

CDRF_NOTIFYITEMDRAW

The control will notify the parent of any item-related drawing operations. It will send NM_CUSTOMDRAW notification messages before and after drawing items. This occurs when dwDrawState equals CDDS_PREPAINT.

控件将通知绘画操作给任何项目相关的父窗口。在重绘前后它将发送CUSTOMDRAW通知。当dwDrawStateCDDS_PREPAINT时将发生这种情况。

CDRF_NOTIFYITEMERASE

Windows NT 4.0 only. The control will notify the parent when an item will be erased. It will send NM_CUSTOMDRAW notification messages before and after erasing items. This occurs when dwDrawState equals CDDS_PREPAINT.

只对Windows NT 4.0有效。当控件要擦除一个项目时它将通知其父窗口。在重绘前后它将发送CUSTOMDRAW通知。当dwDrawStateCDDS_PREPAINT时将发生这种情况。

CDRF_NOTIFYPOSTERASE

The control will notify the parent after erasing an item. This occurs when dwDrawState equals CDDS_PREPAINT.

当控件擦除一个项目后它将通知其父窗口。当dwDrawStateCDDS_PREPAINT时将发生这种情况。

CDRF_NOTIFYPOSTPAINT

The control will notify the parent after painting an item. This occurs when dwDrawState equals CDDS_PREPAINT.

当控件重绘一个项目后它将通知其父窗口。当dwDrawStateCDDS_PREPAINT时将发生这种情况。

CDRF_NEWFONT

The application specified a new font for the item; the control will use the new font. For more information about changing fonts, see Changing fonts and colors. This occurs when dwDrawState equals CDDS_ITEMPREPAINT.

当应用程序为项目设定新字体,控件也将使用这个新字体。更多关于改变字体的信息请参考Changing fonts and colors。当dwDrawStateCDDS_ITEMPREPAINT时将发生这种情况。

CDRF_NOTIFYSUBITEMDRAW

Version 4.71. Your application will receive an NM_CUSTOMDRAW message with dwDrawState set to CDDS_ITEMPREPAINT | CDDS_SUBITEM before each list-view subitem is drawn. You can then specify font and color for each subitem separately or return CDRF_DODEFAULT for default processing. This occurs when dwDrawState equals CDDS_ITEMPREPAINT.

4.71版本。在list-view 子项目被重绘前应用程序将接收到NM_CUSTOMDRAW消息,而dwDrawState 被设置为 CDDS_ITEMPREPAINT | CDDS_SUBITEM。当dwDrawStateCDDS_ITEMPREPAINT时将发生这种情况。

CDRF_SKIPDEFAULT

The application drew the item manually. The control will not draw the item. This occurs when dwDrawState equals CDDS_ITEMPREPAINT.

应用程序手动重绘项目。控件不会绘制项目。当dwDrawStateCDDS_ITEMPREPAINT时将发生这种情况。

CDRF_SKIPPOSTPAINT

Windows Vista. The control will only paint the background.

Windows Vista中,控件将只绘制背景。

 

Remarks

Version 5.80. If you change the font by returning CDRF_NEWFONT, the list-view control might display clipped text. This behavior is necessary for backward compatibility with earlier versions of the common controls. If you want to change the font of a list-view control, you will get better results if you send a CCM_SETVERSION message with the wParam value set to 5 before adding any items to the control.

Version 5.80.如果你通过返回CDRF_NEWFONT改变字体,list-view控件可能会显示省略的文本信息。这样做主要是为了向后兼容早期的通用控件版本。如果你想改变list-view控件的字体,在给控件添加任何项目前发送CCM_SETVERSION消息并将wParam设为5,你将得到更好的结果。

Notification Requirements

Minimum DLL Version

comctl32.dll version 4.70 or later

Header

commctrl.h

Minimum operating systems

Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0

 

MSDN是微软开发者网络(Microsoft Developer Network)的缩写,它是微软为开发者提供的一个资源平台。MSDN提供了丰富的技术文档、示例代码、开发工具、SDK(软件开发工具包)、研究论文等资源,旨在帮助开发者更好地理解和应用微软的各种产品和技术。 MSDN上的文档覆盖了广泛的主题,包括操作系统(如WindowsWindows Server)、开发框架(如.NET Framework、ASP.NET)、数据库(如SQL Server)、云计算(如Azure)以及其他微软的产品和服务。这些文档不仅提供了产品的详细说明和使用指南,还包含了最佳实践、常见问题解答和示例代码,方便开发者学习和应用。 除了文档外,MSDN还提供了丰富的开发工具和资源。开发者可以在这里下载各种开发工具,包括Visual Studio IDE(集成开发环境)、编译器、调试器等。此外,MSDN还提供了各种SDK,让开发者可以扩展并与微软的产品进行集成开发。这些工具和资源可以帮助开发者更高效地开发、测试和部署应用程序。 对于开发者来说,MSDN是一个非常重要的学习和交流平台。开发者可以在MSDN社区中与其他开发者共享经验、解决问题,并参与到各种技术论坛和社区活动中。这样的交流和互动可以帮助开发者更好地提升自己的技术能力,并与其他开发者共同进步。 总之,MSDN是一个开发者们不可或缺的资源平台,提供了大量的技术文档、开发工具和交流机会。无论是初学者还是资深开发者,都可以在MSDN上找到自己需要的资源,提高开发效率,更好地应用和创新微软的产品和技术。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值