Jump to content

Search the Community

Showing results for tags 'listview crash'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I am getting my script crashed if I use functions like WM_NOTIFY for listview + cmd function + reading it when resizing the listview column. While this example script is running, try to resize listview's column, hold on the column size-bar for some time, resize both, forward and backward, you'll see that the script will crash. Why is that? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <Constants.au3> $Form1 = GUICreate("Form1", 500, 400) $List1 = GUICtrlCreateListView("col 1|col 2|col 3|col 4|col 5", 0, 0, 500, 400) For $i = 0 to 4 _GUICtrlListView_SetColumnWidth($List1, $i, 95) Next GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") AdlibRegister("updatelist", 2000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func updatelist() if _GUICtrlListView_GetItemCount($List1) >= 10 Then For $i = 0 to Random(2, 4, 1) _GUICtrlListView_DeleteItem($List1, $i) Next Else For $i = 1 to Random(1, 3, 1) GUICtrlCreateListViewItem("data1data1data1|data2data2data2|data3data3data3|data4data4data4|data5data5data5", $List1) Next EndIf Local $iPID = Run(@ComSpec & ' /c netstat -nao', @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD) if @error then Return SetError(3, 0, 0) Local $sOutput While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf Sleep(100) WEnd ConsoleWrite($sOutput & @LF) EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $List1 If Not IsHWnd($List1) Then $hWndListView = GUICtrlGetHandle($List1) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CUSTOMDRAW ; randomly chosen function, the more functions there are = the more chance you get crash Local $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $ilParam) Local $iDrawStage = DllStructGetData($tCustDraw, "dwDrawStage") Switch $iDrawStage Case $CDDS_PREPAINT Return $CDRF_NOTIFYITEMDRAW Case $CDDS_ITEMPREPAINT Return $CDRF_NOTIFYSUBITEMDRAW EndSwitch Local $iSubItem = DllStructGetData($tCustDraw, "iSubItem") If $iSubItem = 4 Then DllStructSetData($tCustDraw, "clrText", 0x038507) Return $CDRF_NEWFONT EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
×
×
  • Create New...