#include <WinAPIProc.au3>
$iPID = ProcessExists("explorer.exe")
If Not $iPID Then Exit MsgBox(0, "", "Процесс не найден")
$aThreads = _WinAPI_EnumProcessThreads($iPID)
If Not @error Then MsgBox(0, "", $aThreads[0])
Global Const $wbemFlagReturnImmediately = 0x10
Global Const $wbemFlagReturnWhenComplete = 0x0
Global Const $wbemFlagBidirectional = 0x0
Global Const $wbemFlagForwardOnly = 0x20
Global Const $wbemFlagNoErrorObject = 0x40
Global Const $wbemFlagReturnErrorObject = 0x0
Global Const $wbemFlagSendStatus = 0x80
Global Const $wbemFlagDontSendStatus = 0x0
Global Const $wbemFlagUseAmendedQualifiers = 0x20000
_Example()
Func _Example()
#cs
;This property is not supported before Windows Server 2016 Technical Preview and Windows 10
AssetTag
Characteristics
NumberOfEnabledCore
PartNumber
SerialNumber
ThreadCount
;This property is not supported before Windows 8 and Windows Server 2012
SecondLevelAddressTranslationExtensions
VirtualizationFirmwareEnabled
VMMonitorModeExtensions
;Array
PowerManagementCapabilities
#ce
Local $oWMI = ObjGet("winmgmts:\\.\root\CIMV2")
If Not IsObj($oWMI) Then Return ConsoleWrite("--> Error 1" & @LF)
Local $oItems = $oWMI.ExecQuery("SELECT * FROM Win32_Processor", "WQL", BitOR($wbemFlagReturnImmediately, $wbemFlagForwardOnly))
If Not IsObj($oItems) Then Return ConsoleWrite("--> Error 2" & @LF)
For $oIt In $oItems
ConsoleWrite("++> AddressWidth: " & $oIt.AddressWidth & @LF & _
"++> Architecture: " & $oIt.Architecture & @LF & _
"++> Availability: " & $oIt.Availability & @LF & _
"++> Caption: " & $oIt.Caption & @LF & _
"++> ConfigManagerErrorCode: " & $oIt.ConfigManagerErrorCode & @LF & _
"++> ConfigManagerUserConfig: " & $oIt.ConfigManagerUserConfig & @LF & _
"++> CpuStatus: " & $oIt.CpuStatus & @LF & _
"++> CreationClassName: " & $oIt.CreationClassName & @LF & _
"++> CurrentClockSpeed: " & $oIt.CurrentClockSpeed & @LF & _
"++> CurrentVoltage: " & $oIt.CurrentVoltage & @LF & _
"++> DataWidth: " & $oIt.DataWidth & @LF & _
"++> Description: " & $oIt.Description & @LF & _
"++> DeviceID: " & $oIt.DeviceID & @LF & _
"++> ErrorCleared: " & $oIt.ErrorCleared & @LF & _
"++> ErrorDescription: " & $oIt.ErrorDescription & @LF & _
"++> ExtClock: " & $oIt.ExtClock & @LF & _
"++> Family: " & $oIt.Family & @LF & _
"++> InstallDate: " & $oIt.InstallDate & @LF & _
"++> L2CacheSize: " & $oIt.L2CacheSize & @LF & _
"++> L2CacheSpeed: " & $oIt.L2CacheSpeed & @LF & _
"++> L3CacheSize: " & $oIt.L3CacheSize & @LF & _
"++> L3CacheSpeed: " & $oIt.L3CacheSpeed & @LF & _
"++> LastErrorCode: " & $oIt.LastErrorCode & @LF & _
"++> Level: " & $oIt.Level & @LF & _
"++> LoadPercentage: " & $oIt.LoadPercentage & @LF & _
"++> Manufacturer: " & $oIt.Manufacturer & @LF & _
"++> MaxClockSpeed: " & $oIt.MaxClockSpeed & @LF & _
"++> Name: " & $oIt.Name & @LF & _
"++> NumberOfCores: " & $oIt.NumberOfCores & @LF & _
"++> NumberOfLogicalProcessors: " & $oIt.NumberOfLogicalProcessors & @LF & _
"++> OtherFamilyDescription: " & $oIt.OtherFamilyDescription & @LF & _
"++> PNPDeviceID: " & $oIt.PNPDeviceID & @LF & _
"++> PowerManagementSupported: " & $oIt.PowerManagementSupported & @LF & _
"++> ProcessorId: " & $oIt.ProcessorId & @LF & _
"++> ProcessorType: " & $oIt.ProcessorType & @LF & _
"++> Revision: " & $oIt.Revision & @LF & _
"++> Role: " & $oIt.Role & @LF & _
"++> SocketDesignation: " & $oIt.SocketDesignation & @LF & _
"++> Status: " & $oIt.Status & @LF & _
"++> StatusInfo: " & $oIt.StatusInfo & @LF & _
"++> Stepping: " & $oIt.Stepping & @LF & _
"++> SystemCreationClassName: " & $oIt.SystemCreationClassName & @LF & _
"++> SystemName: " & $oIt.SystemName & @LF & _
"++> UniqueId: " & $oIt.UniqueId & @LF & _
"++> UpgradeMethod: " & $oIt.UpgradeMethod & @LF & _
"++> Version: " & $oIt.Version & @LF & _
"++> VoltageCaps: " & $oIt.VoltageCaps & @LF)
Next
EndFunc ;==>_Example
Global Const $wbemFlagReturnImmediately = 0x10
Global Const $wbemFlagReturnWhenComplete = 0x0
Global Const $wbemFlagBidirectional = 0x0
Global Const $wbemFlagForwardOnly = 0x20
Global Const $wbemFlagNoErrorObject = 0x40
Global Const $wbemFlagReturnErrorObject = 0x0
Global Const $wbemFlagSendStatus = 0x80
Global Const $wbemFlagDontSendStatus = 0x0
Global Const $wbemFlagUseAmendedQualifiers = 0x20000
MsgBox(0, "", _Win32_Processor_NumberOfLogicalProcessors())
Func _Win32_Processor_NumberOfLogicalProcessors()
Local $oWMI, $oItems
$oWMI = ObjGet("winmgmts:\\.\root\CIMV2")
If Not IsObj($oWMI) Then Return SetError(1, 0, 0)
$oItems = $oWMI.ExecQuery("SELECT * FROM Win32_Processor", "WQL", BitOR($wbemFlagReturnImmediately, $wbemFlagForwardOnly))
If Not IsObj($oItems) Then Return SetError(2, 0, 0)
For $oIt In $oItems
Return $oIt.NumberOfLogicalProcessors
Next
EndFunc ;==>_Win32_Processor_NumberOfLogicalProcessors