* * *

Author Topic: [SOLVED] How to find out the hardware parameters of a PC?  (Read 546 times)

Wargan

  • New member
  • *
  • Posts: 28
  • Make Lazarus great again!
[SOLVED] How to find out the hardware parameters of a PC?
« on: May 02, 2017, 06:47:27 am »
Hello!

What code should I use to find out the following PC settings?
  • The amount of RAM
  • Video memory: vendor/size
  • Windows username
  • Size of the hard drive
  • Is the installation disk a hard drive or a USB flash drive? :)

p.s. I'm programming under Windows.
« Last Edit: May 02, 2017, 01:20:13 pm by Wargan »
Used: Lazarus 1.6.4 stable + FPC 3.0.2

GetMem

  • Hero Member
  • *****
  • Posts: 2033

Thaddy

  • Hero Member
  • *****
  • Posts: 3387
Re: How to find out the hardware parameters of a PC?
« Reply #2 on: May 02, 2017, 11:32:41 am »
Hm. Directly through the registry, maybe? HKEY_LOCAL_MACHINE\HARDWARE\  and then DESCRIPTION\ and sub keys etc. Easy.

ahiggins

  • New member
  • *
  • Posts: 45
Re: How to find out the hardware parameters of a PC?
« Reply #3 on: May 02, 2017, 11:56:15 am »
You could try WMI Delphi Code Creator, I've used it in the past to get system serial numbers/asset details.

https://theroadtodelphi.com/wmi-delphi-code-creator/

Thaddy

  • Hero Member
  • *****
  • Posts: 3387
Re: How to find out the hardware parameters of a PC?
« Reply #4 on: May 02, 2017, 12:00:49 pm »
You could try WMI Delphi Code Creator, I've used it in the past to get system serial numbers/asset details.

https://theroadtodelphi.com/wmi-delphi-code-creator/
WMI will work, as i wrote before, but direct registry access is much quicker and generates less code.

Wargan

  • New member
  • *
  • Posts: 28
  • Make Lazarus great again!
Used: Lazarus 1.6.4 stable + FPC 3.0.2

ahiggins

  • New member
  • *
  • Posts: 45
Re: How to find out the hardware parameters of a PC?
« Reply #6 on: May 02, 2017, 12:10:37 pm »
sorry, did not check the download link, you may have to Google WMI Delphi Code Creator download or try CNET etc

Thaddy

  • Hero Member
  • *****
  • Posts: 3387
Re: How to find out the hardware parameters of a PC?
« Reply #7 on: May 02, 2017, 12:13:52 pm »
The site DOES work. Use ABP to skip all the sh*t in between.

taazz

  • Hero Member
  • *****
  • Posts: 3743
Re: How to find out the hardware parameters of a PC?
« Reply #8 on: May 02, 2017, 01:06:41 pm »
projects repo is at https://github.com/RRUZ/wmi-delphi-code-creator
it has download links for the binaries as well.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Wargan

  • New member
  • *
  • Posts: 28
  • Make Lazarus great again!
Re: How to find out the hardware parameters of a PC?
« Reply #9 on: May 02, 2017, 01:19:47 pm »
Many thanks to all!

I downloaded the WMI Delphi Code Generator from here.

After installation in the settings you can specify generation of code for FreePascal.
Used: Lazarus 1.6.4 stable + FPC 3.0.2

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus