[Delphi] Detect plug-in...

0

Jak wykryć czy ma się zainstalowanego plug-in'a flasha i jaką wersję??

Flash clsid:D27CDB6E-AE6D-11cf-96B8-444553540000

0

To powinno pomóc:

program SeekFlash;

uses
Forms, Windows, INIFiles, SysUtils, Dialogs, ShellApi;

{$R *.RES}

type
TVersionInfo = record
dwSignature,
dwStrucVersion,
dwFileVersionMS,
dwFileVersionLS,
dwProductVersionMS,
dwProductVersionLS,
dwFileFlagsMask,
dwFileFlags,
dwFileOS,
dwFileType,
dwFileSubtype,
dwFileDateMS,
dwFileDateLS: DWORD;
end;

var
//Reg:TRegistry;
Ini: TIniFile;
Text: array[1..4] of string;

AppPath, IniFile, MySec: string;
SetupFile, RunFile, SetupClass: string;

VersionStr, BrowserStr: string;

{RegSubKey,} OpenBrowser, PlugInName, UseExt: string;
MainVersion: Word;
// FoundOne :Boolean;

PVer, DPchar, POpenBrowser: PChar;
MyPoint: Pointer;
PLen: Cardinal;
version: ^TVersionInfo;
DumD: DWORD;
LWord, HWord: Word;

CheckHandle: Hwnd;

//---------------------------
//Pobieranie wersji
//---------------------------
procedure GetVersion(pluginName: string);
begin
DPChar := StrAlloc(255);
DPchar := PChar(PluginName);

PVer := StrAlloc(getFileVersionInfoSize(DPchar, Plen));
getFileVersionInfo(DPChar, 0, 255, PVer);
VerQueryValue(Pver, '', MyPoint, Plen);

Version := myPoint;

dumD := Version.dwFileVersionMS;
hword := dumD shr 16;
lword := dumD and 255;

MainVersion := hword;
VersionStr := IntToStr(Hword) + '.' + IntToStr(LWord);

dumD := Version.dwFileVersionLs;
hword := dumD shr 16;
lword := dumD and 255;

versionStr := versionStr + '.' + IntToStr(Hword) + '.' + IntToStr(lWord);
end;

begin
appPath := extractFileDir(Application.exeName);

// runFile:= 'test.htm';
//runFile musi być w HTML żeby rozpoznać przegladarkę uzywaną POpenBrowser := StrAlloc(255);
FindExecutable(PChar(extractFileName(runFile)),
PChar(extractFileDir(runFile)), POpenBrowser);
OpenBrowser := POpenBrowser;

if not Fileexists(openBrowser) then
begin
MessageDlg(Text[4], mtInformation, [mbOK], 0);
halt;
end;

//Netscape or IE
if Pos('NETSCAPE.EXE', uppercase(trim(OpenBrowser))) 0 then
begin //found Netscape
BrowserStr := 'Netscape Comunicator';
PlugInName := Copy(OpenBrowser, 1, Pos('NETSCAPE.EXE',
uppercase(trim(OpenBrowser))) - 1);
PluginName := PlugInName + 'PluginsNPSWF32.dll';
end
else
//znaleziono IEExplorer
begin
BrowserStr := 'Internet Explorer';

DPChar := StrAlloc(255); 
GetSystemDirectory(DPChar, 255); 
PluginName := DPChar + 'MacromedFlashswflash.ocx'; 
DPChar     := nil; 

end;

GetVersion(pluginName);

//sprawdzanie numeru wersji
while mainVersion

1 użytkowników online, w tym zalogowanych: 0, gości: 1