Jump to content
Sign in to follow this  

Why is this crashing the window?

Recommended Posts

If $aWinList[0][0] > 0 And $aWinList[0][0] < 2 Then
        ;MsgBox($MB_SYSTEMMODAL, "", "Window HWND: " & $aWinList[1][1])
        Local $hControl1 = ControlGetHandle($aWinList[1][1], "", "[CLASS:SysListView32; INSTANCE:1]")
        Local $hControl2 = ControlGetHandle($aWinList[1][1], "", 59664)
        ;MsgBox($MB_SYSTEMMODAL, "", "Door List HWND: " & $hControl1)
        ;MsgBox($MB_SYSTEMMODAL, "", "Status List HWND: " & $hControl2)
        Local $numItems = _GUICtrlListView_GetItemCount($hControl1)
        MsgBox($MB_SYSTEMMODAL, "", $numItems)
        _GUICtrlListView_ClickItem($hControl1, 0, "left", False)
        Local $finOut[$numItems]
        For $i = 0 To $numItems - 1
            $sText =_GUICtrlListView_GetItemText($hControl1, $i) & " || " & _GUICtrlListView_GetItemText($hControl2, 2, 2)
            _ArrayInsert($finOut, $i, $sText)

Seems pretty simple. The bolded part is what crashes the window. I have to get the hControl1's HWND differently because there is a treeview with the same ID for some reason. I'm guessing this is what is causing the issue somehow?


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  

  • Create New...