[Qt-interest] How can I get the hard disk serial number in Windows ?

Mhayk Whandson eu at mhayk.com.br
Tue Jun 30 06:55:18 CEST 2009


Hi Bill,

I was reading the documentation about the function
GetVolumeInformation and I saw:

lpVolumeSerialNumber [out, optional]

    A pointer to a variable that receives the volume serial number.

    This parameter can be NULL if the serial number is not required.

    "This function returns the volume serial number that the operating
system assigns when a hard disk is formatted". To programmatically
obtain the hard disk's serial number that the manufacturer assigns,
use the Windows Management Instrumentation (WMI) Win32_PhysicalMedia
property SerialNumber.


How you can to see above the function return a volume serial number
but I want a physical hard disk serial number(the hard disk's serial
number that the manufacturer assigns) and if I want to obtain this,
use the Windows Management Instrumentation (WMI) Win32_PhysicalMedia
property SerialNumber. I cannot user WMI :/

best regards,

On Tue, Jun 30, 2009 at 12:36 AM, Bill KING<bill.king at trolltech.com> wrote:
> This is stock windows api functionality. If you #include <windows.h>
> then this should also work under mingw as well.
>
> Mhayk Whandson wrote:
>> Hi Bill, I would like just using g++ compiler, because I am developing
>> my project using Qt Creator.
>>
>> best regards,
>>
>> On Tue, Jun 30, 2009 at 12:13 AM, Bill KING<bill.king at trolltech.com> wrote:
>>
>>> Mhayk Whandson wrote:
>>>
>>>> Hi all,
>>>>
>>>> Qt have a class which get the hard disk serial number ? Anyone have an
>>>> idea how can I get in Microsoft Windows without to use WMI.
>>>>
>>>> regards,
>>>>
>>>>
>>>>
>>> http://msdn.microsoft.com/en-us/aa364993%28VS.85%29.aspx
>>>
>>> GetVolumeInformation function of the winapi.
>>>
>>>
>>> --
>>> Bill King, Software Engineer
>>> Qt Software, Nokia Pty Ltd
>>> Brisbane Office
>>>
>>>
>>>
>>
>>
>>
>>
>
>
> --
> Bill King, Software Engineer
> Qt Software, Nokia Pty Ltd
> Brisbane Office
>
>



-- 
Mhayk Whandson
Linux User #413723
E-mail: eu at mhayk.com.br



More information about the Qt-interest-old mailing list