我使用此代碼來檢查,如果前景是默認郵件客戶端:如何檢查前景是默認郵件客戶端
Function IsOutlookIsDefaultEmailPrg:Boolean;
var
reg: TRegistry;
key : string;
begin
Result := False;
with TRegistry.Create do
TRY
RootKey := HKEY_LOCAL_MACHINE;
if OpenKeyReadOnly('Software\Clients\Mail') then
begin
key := Uppercase(ReadString('')); //default value
end;
result := (Pos('MICROSOFT OUTLOOK',Key) > 0);
FINALLY
Free;
END;
end;
它的作品一般,但在某些PC的已報道不工作,我檢查並註冊表鍵在那裏。
是否Pos
區分大小寫?任何想法爲什麼這有時無法工作?有什麼更好的建議?
您的程序是32位還是64位?在代碼失敗的機器上運行什麼操作系統?有沒有可能是Vista? –
32位,否Vista – LaBracca
選中此[MSDN鏈接](http://msdn.microsoft.com/en-us/library/dd203067%28VS.85%29.aspx)。它適用於從Windows XP到Windows 7.不知道Windows 8 –