Jump to content
Fórum Script Brasil
  • 0

Código Para Sistemaoperacional


Paulo Nobre
 Share

Question

2 answers to this question

Recommended Posts

  • 0

ai uma funcao, coloque na clausula Uses Registry;

function VerSaoWindows: string; stdcall;
var 
  VerInfo: TOsversionInfo; 
  PlatformId, VersionNumber: string; 
  Reg: TRegistry;
begin 
  VerInfo.dwOSVersionInfoSize := SizeOf(VerInfo); 
  GetVersionEx(VerInfo); 
  // Detect platform 
  Reg := TRegistry.Create; 
  Reg.RootKey := HKEY_LOCAL_MACHINE; 
  case VerInfo.dwPlatformId of 
    VER_PLATFORM_WIN32s: 
      begin 
        // Registry (Huh? What registry?) 
        PlatformId := 'Windows 3.1'; 
      end; 
    VER_PLATFORM_WIN32_WINDOWS: 
      begin 
        // Registry 
        Reg.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion', False); 
        PlatformId    := Reg.ReadString('ProductName'); 
        VersionNumber := '( ' + Reg.ReadString('VersionNumber') + ' )';
      end; 
    VER_PLATFORM_WIN32_NT: 
      begin 
        // Registry 
        Reg.OpenKey('\SOFTWARE\Microsoft\Windows NT\CurrentVersion', False);
        if Reg.ReadString('CSDVersion') = '' then
          Reg.WriteString('CSDVersion','Sem Atualização');
        PlatformId    := Reg.ReadString('ProductName') + ' ( ' + Reg.ReadString('CSDVersion') + ' )';          
        VersionNumber := ' 4( 15' + Reg.ReadString('CurrentVersion') + ' - ' +
          Reg.ReadString('CurrentBuildNumber') + ' )';
      end;
  end;
  Reg.Free; 
  Result := PlatformId + ' ' + VersionNumber;
end;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      150.7k
    • Total Posts
      648.4k
×
×
  • Create New...