#region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=C:\WINDOWS\system32\SHELL32.dll|-166
#endregion ;**** 参数创建于 ACNWrapper_GUI ****
#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 $exStyles = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES) + $LVS_EX_CHECKBOXES
$CHECKS = GUICreate("软件检测", 661, 434, 209, 178)
GUISetIcon("C:\Windows\System32\user32.dll", -6)
$Find = GUICtrlCreateButton("搜索", 40, 24, 99, 25)
;$Uninstall = GUICtrlCreateButton("卸载", 227, 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, "名称", 220)
_GUICtrlListView_AddColumn($ListView1, "安装时间", 200)
_GUICtrlListView_AddColumn($ListView1, "版本信息", 200)
_GUICtrlListView_SetExtendedListViewStyle($ListView1, $exStyles)
$progressCheck = GUICtrlCreateProgress(16, 392, 633, 25)
$ExitCheck = GUICtrlCreateButton("退出", 408, 24, 99, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Find
_SHOW()
Case $ExitCheck
ExitLoop
EndSwitch
WEnd
Func _SHOW()
Local $wbemFlagReturnImmediately = 0x10
Local $wbemFlagForwardOnly = 0x20
Local $strcomputer = "localhost"
Local $colItems = ""
Local $objWMIService = ObjGet("winmgmts:\" & $strcomputer & "\root\CIMV2")
Local $Output, $date, $version
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Product", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) Then
For $objItem In $colItems
$Output = $objItem.Caption
$date = WMIDateStringToDate($objItem.InstallDate2)
$version = $objItem.Version
_table($Output, $date, $version)
$Output = ""
Next
Else
MsgBox(0, "WMI 输出", "没有在类 " & "Win32_Product" & "中找到WMI对象")
EndIf
EndFunc ;==>_SHOW
Func _table($NAME, $uname, $version)
GUICtrlCreateListViewItem($NAME & "|" & $uname & "|" & $version, 4)
EndFunc ;==>_table
Func WMIDateStringToDate($dtmDate)
Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate, 13, 2))
EndFunc ;==>WMIDateStringToDate
我已经知道使用