Saiyine
Punto Com

Obtener la version del windows que se esta usando

0000-00-00 00:00:00

function GetWindowsVersion : string;
var
OsVinfo   : TOSVERSIONINFO;
HelpStr   : array[0..50] of char;
begin
        ZeroMemory(@OsVinfo,sizeOf(OsVinfo));
        OsVinfo.dwOSVersionInfoSize := sizeof(TOSVERSIONINFO);
        if GetVersionEx(OsVinfo) then
        begin
                if OsVinfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS then
                begin
                        if (OsVinfo.dwMajorVersion = 4) and (OsVinfo.dwMinorVersion > 0) then
                        StrFmt(HelpStr, 'Windows 98 - Version %d.%.2d.%d',
                        [OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
                        OsVinfo.dwBuildNumber and $FFFF])
                        else
                        StrFmt(HelpStr, 'Windows 95 - Version %d.%d Build %d',
                        [OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
                        OsVinfo.dwBuildNumber and $FFFF]);
                end;
                if OsVinfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
                StrFmt(HelpStr, 'Microsoft Windows NT Version %d.%.2d.%d',
                [OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
                OsVinfo.dwBuildNumber and $FFFF]);
        end
        else
        StrCopy(HelpStr, 'GetversionEx() Error');
        Result := string(HelpStr);
end;

function GetWindowsVersionShort : string;
var
OsVinfo   : TOSVERSIONINFO;
begin
        ZeroMemory(@OsVinfo,sizeOf(OsVinfo));
        OsVinfo.dwOSVersionInfoSize := sizeof(TOSVERSIONINFO);
        if GetVersionEx(OsVinfo) then
        begin
                if OsVinfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS then Result:='9X';
                if OsVinfo.dwPlatformId = VER_PLATFORM_WIN32_NT then Result:='NT';
        end
        else
        Result := 'Er';
end;

Yo personalmente uso mucho la segunda version, la mas corta, en mis programas.

Rollos antiguos

0000-00-00 00:00:00 - Obtener en una cadena la fecha actual con el formato dia,dd/mm/aaaa y formatear numeros..

0000-00-00 00:00:00 - Obtener el tamaño de un fichero.

0000-00-00 00:00:00 - Obtener el nombre del directorio de instalacion de windows.

0000-00-00 00:00:00 - Mandar texto al portapapeles (y recibirlo).

0000-00-00 00:00:00 - Leer y escribir JPGs y convertirlos a bitmaps.

Saiyine

Selfie of meHi! Welcome to Saiyine Punto Com where I talk about anything that goes through my mind!

Puedo prometer y prometo que a la mayor brevedad aquí irá un menú o algo asín.