listview控件的一些用法

来源:互联网 发布:人工智能语言是什么 编辑:程序博客网 时间:2024/06/01 10:07

用到listview,要获得其列数

      handList=ListView_GetHeader(GetDlgItem(hWnd,IDC_CTROL));
     cols = (int)SendMessage(handList, HDM_GETITEMCOUNT, 0, 0 ); //总列数

查看宏:

Gets the handle to the header control used by a list-view control. You can use this macro or send theLVM_GETHEADER message explicitly.

Syntax

Copy
HWND ListView_GetHeader(  HWND hwndLV);

Parameters

hwndLV

Type: HWND

A handle to a list-view control.

Return Value

Type: HWND

Returns the handle to the header control.




原创粉丝点击