用regsvr32.exe运行?是不是注册啊?
判断机器上的操作系统,试试下面的代码:
function GetOS :TOSVersion;//判断系统的函数
var
OS :TOSVersionInfo;
begin
ZeroMemory(@OS,SizeOf(OS));
OS.dwOSVersionInfoSize:=SizeOf(OS);
GetVersionEx(OS);
Result:=osUnknown;
if OS.dwPlatformId=VER_PLATFORM_WIN32_NT then begin
case OS.dwMajorVersion of
3: Result:=osNT3;
4: Result:=osNT4;
5: Result:=os2K;
end;
if (OS.dwMajorVersion=5) and (OS.dwMinorVersion=1) then
Result:=osXP;
end else begin
if (OS.dwMajorVersion=4) and (OS.dwMinorVersion=0) then begin
Result:=os95;
if (Trim(OS.szCSDVersion)='B') then
Result:=os95OSR2;
end else
if (OS.dwMajorVersion=4) and (OS.dwMinorVersion=10) then begin
Result:=os98;
if (Trim(OS.szCSDVersion)='A') then
Result:=os98SE;
end else
if (OS.dwMajorVersion=4) and (OS.dwMinorVersion=90) then
Result:=osME;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);//判断过程
var
os:TosVersion;
osVersion:string;
begin
os:=Getos;//调用函数
case OS of
os95, os95OSR2: OSVersion:='Windows 95';
os98: OSVersion:='Windows 98';
os98SE: OSVersion:='Windows 98 第二版';
osME: OSVersion:='Windows Millenium Edition';
osNT3, osNT4: OSVersion:='Windows NT';
os2K: OSVersion:='Windows 2000';
osXP: OSVersion:='Windows XP';
end;
showmessage(osversion); //显示版本
end;