Sign in to follow this  
Followers 0
GaryFrost

ListView Column count

3 posts in this topic

Been trying to get a column count, not sure what I'm doing wrong here

but any help would be greatly appreciated.

Func _GUICtrlGetListViewColsCount(ByRef $lv)

Local $LVM_FIRST=0x1000

Local $HDM_FIRST=0x1200

Local $LVM_GETHEADER=($LVM_FIRST + 31)

Local $HDM_GETITEMCOUNT=($HDM_FIRST + 0)

Local $hdr

$hdr = GUICtrlSendMsg($lv,$LVM_GETHEADER,0,0)

return GUICtrlSendMsg($hdr,$HDM_GETITEMCOUNT,0,0);

EndFunc


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites



See ControlListView in the help file.

"GetSubItemCount" - Returns the number of subitems.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks, forgot all about the regular control calls, makes life a little easier

;===============================================================================
;
; Function Name:    _GUICtrlGetListViewColsCount()
; Description:    Return the number of columns for a listview
;                  
; Parameter(s):  $lv            - ListView control
;                  $title          - Windows title
;                  $text         - Window text
;                  
; Requirement(s):   None
; Return Value(s):  Number of columns
;                  
; Author(s):        Gary Frost
;
;===============================================================================
Func _GUICtrlGetListViewColsCount(ByRef $lv,$title="",$text="")
    If(StringLen($title)==0) Then
        $title = WinGetTitle("")
    EndIf
    Return ControlListView($title ,$text, $lv, "GetSubItemCount")
EndFunc

;===============================================================================
;
; Function Name:    _GUICtrlGetListViewItemsCount()
; Description:    Return the number of columns for a listview
;                  
; Parameter(s):  $lv            - ListView control
;                  $title          - Windows title
;                  $text         - Window text
;                  
; Requirement(s):   None
; Return Value(s):  Number rows
;                  
; Author(s):        Gary Frost
;
;===============================================================================
Func _GUICtrlGetListViewItemsCount(ByRef $lv,$title="",$text="")
    If(StringLen($title)==0) Then
        $title = WinGetTitle("")
    EndIf
    Return ControlListView($title ,$text, $lv, "GetItemCount")
EndFunc

See ControlListView in the help file.

"GetSubItemCount" - Returns the number of subitems.

<{POST_SNAPBACK}>

Edited by GaryFrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0