MsgBox % "此电脑为 " CPUThreads() " 线程 CPU"

CPUThreads() {  ; http://msdn.com/library/ms724509(vs.85,en-us)
  static hModule := DllCall("LoadLibrary", "Str", "ntdll.dll", "Ptr")
  size := VarSetCapacity(buf, 0, 0)
  , DllCall("ntdll\NtQuerySystemInformation", "Int", 0x8, "Ptr", &buf, "UInt", 0, "UInt*", size)
  , size := VarSetCapacity(buf, size, 0)
  if (DllCall("ntdll\NtQuerySystemInformation", "Int", 0x8, "Ptr", &buf, "UInt", size, "UInt*", 0) != 0)
    return "*" ErrorLevel
  CPU_COUNT := size // 48
  return CPU_COUNT
}

 

声明:站内资源为整理优化好的代码上传分享与学习研究,如果是开源代码基本都会标明出处,方便大家扩展学习路径。请不要恶意搬运,破坏站长辛苦整理维护的劳动成果。本站为爱好者分享站点,所有内容不作为商业行为。如若本站上传内容侵犯了原著者的合法权益,请联系我们进行删除下架。