...
#ifdef Q_WS_WIN
#define Q_WS_WIN
DWORD dwVolSerial;
BOOL bIsRetrieved;
bIsRetrieved = GetVolumeInformation(TEXT("C:\\"), NULL, NULL, &dwVolSerial, NULL, NULL, NULL, NULL);
if (bIsRetrieved) {
} else {
}
#endif
...
...
#ifdef Q_WS_WIN
#define Q_WS_WIN
DWORD dwVolSerial;
BOOL bIsRetrieved;
bIsRetrieved = GetVolumeInformation(TEXT("C:\\"), NULL, NULL, &dwVolSerial, NULL, NULL, NULL, NULL);
if (bIsRetrieved) {
QMessageBox::information(0, QString::fromUtf8("Good"), "Serial number of drive C is\n" + QString::number(dwVolSerial,16));
} else {
QMessageBox::warning(0, QString::fromUtf8("Bad"), "Serial number of drive C is nothing");
}
#endif
...
To copy to clipboard, switch view to plain text mode
I read HardDisc VolumeSerial but after formating the system it changes. That because it is not perfect but it's OK
Bookmarks