#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <ACN_NET.au3>
#include <GuiIPAddress.au3>
#include <File.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <WinAPIEx.au3>
#include <GuiMonthCal.au3>
#include <Process.au3>
#include <inet.au3>
#include <ListviewConstants.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
Local $valuekey, $valuename, $valuepath, $i, $k, $u, $KEYPATH, $NAMEPATK, $valuekey1, $valuepath1, $softico
Local $exStyles = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)
$CHECKS = GUICreate("软件检测", 661, 434, 209, 178)
GUISetIcon("C:\Windows\System32\user32.dll", -6)
$Find = GUICtrlCreateButton("搜索", 128, 24, 99, 25)
$ListView1 = _GUICtrlListView_Create($Find, "", 16, 72, 625, 297, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT))
;_GUICtrlListView_SetExtendedListViewStyle($ListView1, $exStyles)
$ListView1 = GUICtrlCreateListView("", 16, 72, 625, 297)
_GUICtrlListView_AddColumn($ListView1, "软件", 200)
_GUICtrlListView_AddColumn($ListView1, "软件", 200)
_GUICtrlListView_AddColumn($ListView1, "软件", 200)
$progressCheck = GUICtrlCreateProgress(16, 392, 633, 25)
$ExitCheck = GUICtrlCreateButton("退出", 408, 24, 99, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
$KEYPATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$KEYNAME = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Find
;For $i = 1 To 100
While 1
_SHOW()
If $valuekey == "" Then ExitLoop
WEnd
;Next
Case $ExitCheck
ExitLoop
EndSwitch
WEnd
Func _SHOW()
$i += 1
$valuekey = RegEnumKey($KEYPATH, $i)
$valuekey1 = RegEnumKey($KEYNAME, $i)
$valuepath = RegRead($KEYPATH & $valuekey, "DisplayName")
$valuepath1 = RegRead($KEYNAME & $valuekey1, "DisplayName")
$softico = RegRead($KEYPATH & $valuekey, "DisplayIcon")
If $valuepath == "" Then
_table($valuekey, $valuekey1, $softico)
Else
_table($valuepath, $valuepath1, $softico)
EndIf
Local $hImage = _GUIImageList_Create(32, 32, 5, 2)
_GUIImageList_AddIcon($hImage, $softico, -1, True)
GUICtrlCreateIcon($softico, -1, 1, 1)
_GUICtrlListView_SetImageList($ListView1, $hImage, 1)
EndFunc ;==>_SHOW
Func _table($NAME, $uname, $softico)
_GUICtrlListView_AddItem($ListView1, $NAME, 0)
;_GUICtrlListView_AddItem($ListView1, $uname, 1)
EndFunc ;==>_table
Func AddIcon($hWnd, $sFile, $iIndex = 0)
Local $pIcon, $tIcon, $hIcon
$tIcon = DllStructCreate("int Icon")
$pIcon = DllStructGetPtr($tIcon)
_WinAPI_ExtractIconEx($sFile, $iIndex, 0, $pIcon, 1)
$hIcon = DllStructGetData($tIcon, "Icon")
_GUIImageList_ReplaceIcon($hWnd, -1, $hIcon)
_WinAPI_DestroyIcon($hIcon)
EndFunc ;==>AddIcon