G
G
German2018-07-06 20:27:24
C++ / C#
German, 2018-07-06 20:27:24

How to get Windows version?

Interested in getting a version of Windows, such as Windows 7 or Windows 8, or Windows 8.1.
How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Demidko, 2018-07-07
@Daniro_San

#include <windows.h>

int main()
{
    auto dwVersion = GetVersion();
    // Версия, например 8
    auto dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
    // Вторая цифра версии, например 1
    auto dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question