lxShaDoWxl
Новичок
- Сообщения
- 5
- Репутация
- 0
помогите реализовать обновление ListView, вроде бы написал правильно, но скрипт зависает когда нажимаю "обновить"
Код:
#include <GuiListView.au3>
#include <EditConstants.au3>
#include 'LV_Format_include.au3'
$PriceMon = GUICreate("Form1", 670, 539, -1, -1)
$lv = GUICtrlCreateListView('1|1', 0, 25, 669, 513)
$hLV = GUICtrlGetHandle($lv)
_GUICtrlListView_SetColumnWidth($hLV, 0, 49)
_GUICtrlListView_SetColumnWidth($hLV, 1, 49)
_GUICtrlListView_Formatting_Startup($PriceMon, $hLV)
_GUICtrlListView_AddOrIns_Item($hLV, '1|1')
_GUICtrlListView_FormattingCell($hLV, 0, 0, 0xffff00, -1, -1, -1, -1)
$ButtonRef = GUICtrlCreateButton("Обновить", 264, 0, 145, 25)
GUISetState(@SW_SHOW, $PriceMon)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
While 1
$msg = GUIGetMsg(1)
Switch $msg[1]
Case $PriceMon
If $msg[0] = -3 Then ExitLoop
If $msg[0] = $ButtonRef then _btMonRef()
EndSwitch
WEnd
Func _btMonRef()
_GUICtrlListView_FormattedDeleteAllItems($hLV)
_GUICtrlListView_SetColumnWidth($hLV, 0, 49)
_GUICtrlListView_SetColumnWidth($hLV, 1, 49)
_GUICtrlListView_Formatting_Startup($PriceMon, $hLV)
_GUICtrlListView_AddOrIns_Item($hLV, '2|2')
_GUICtrlListView_FormattingCell($hLV, 0, 1, 0xffff00, -1, -1, -1, -1)
EndFunc
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iCode, $tNMHDR
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iCode = DllStructGetData($tNMHDR, "Code")
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY