Sign in to follow this  
Followers 0
tresa

How can I get a listView Header height

3 posts in this topic

I know there is a _GUICtrlListViewGetHeader function

but I don't know what to do with it to get the info

thx in adv

Share this post


Link to post
Share on other sites



I know there is a _GUICtrlListViewGetHeader function

but I don't know what to do with it to get the info

thx in adv

For those who are interested...

#Include <GuiListView.au3>
dim $rect,$headerHle,$l,$top,$r,$bottom

...


$rect   = DllStructCreate("int;int;int;int")
$headerHle=_GUICtrlListViewGetHeader($ListView1)

;make the DllCall
DLLCall("user32.dll","int","GetWindowRect", _
        "hwnd",$headerHle, _
        "ptr",DllStructGetPtr($rect)) ; use DllStructGetPtr when calling DllCall

;get the returned rectangle
$l = DllStructGetData($rect,1)
$top = DllStructGetData($rect,2)
$r = DllStructGetData($rect,3)
$bottom = DllStructGetData($rect,4)

;free the struct
$rect = 0

msgbox(0,"","The Header heigth is :" & $bottom-$top)

Share this post


Link to post
Share on other sites

in a udf , to get a rect from a win handle...

Func getHandleRect($hle)
    local $lRect,$rectArray[4]
    $lRect = DllStructCreate("int;int;int;int")
    DLLCall("user32.dll","int","GetWindowRect", "hwnd",$hle, "ptr",DllStructGetPtr($lRect)) ; use DllStructGetPtr when calling DllCall
    ;get the returned rectangle
    $rectArray[0] = DllStructGetData($lRect,1)
    $rectArray[1] = DllStructGetData($lRect,2)
    $rectArray[2] = DllStructGetData($lRect,3)
    $rectArray[3] = DllStructGetData($lRect,4)
    $lRect=0
    Return $rectArray
EndFunc

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