用到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
Parameters
-
hwndLV
-
Type: HWND
A handle to a list-view control.
Return Value
Type: HWND
Returns the handle to the header control.