Forum Discussion

suvidhshetty_1's avatar
suvidhshetty_1
Occasional Contributor
13 years ago

To know check box is checked or not of extended style of "ListViewWndClass"

Hi,



I am not able to verify if the check box is checked or not for 'ListViewWndClass' the Extended style(Check box) of this class is not supported in TestComplete.



The below code I have used it for checkboxes in "SysListView32" and it works as expected.

But for 'ListViewWndClass' the variable 'nPos' in Object_ShiftRight() method is not populated with the correct value it depends on what "Win32API.SendMessage(guiObject.Handle, LVM_GETITEMSTATE, nItemID, LVIS_STATEIMAGEMASK)"sends and it is '0'.


LVM_GETITEMSTATE = 4140

LVIS_STATEIMAGEMASK = &HF000

nShiftVal = Object_ShiftRight(Win32API.SendMessage(guiObject.Handle, LVM_GETITEMSTATE, nItemID, LVIS_STATEIMAGEMASK), 12)


 

Public Function Object_ShiftRight(nPos, nShift)

    Dim nPostShift

    nPostShift = nPos \ (2 ^ nShift)

    If (nPos mod (2 ^ nShift) <> 0) And (nPos < 0) Then

     nPostShift = nPostShift - 1

    End If 

    Object_ShiftRight = nPostShift

End Function


 I guess we have different MASK values for "ListViewWndClass" object

.

Please help me to resolve this issue.



Thanks,

Suvidh Shetty


 





  • Hi,



    The code you're trying to use works with SysListView32. If you try to run it with another control, it is not guaranteed that this code will work as you expect. All parameter may be different - from the message you need to send to it to get an item's state to parameters of this message.



    Ask your developers or refer to your control's documentation to find out what message you should send to it and what you should pass as its parameters.
  • suvidhshetty_1's avatar
    suvidhshetty_1
    Occasional Contributor
    Hi,



    Please do share with us if you have any information regarding the Window message and how to get the information if it is checked or not.



    Thanks,

    Suvidh