2008-08-07 77 views

回答

2

這裏的一些老德爾福代碼我們用它來獲取Web應用程序中的快捷方式爲用戶本地啓動一個Windows程序。

procedure InstallIntoRegistry; 
var 
    Reg: TRegistry; 
begin 
    Reg := TRegistry.Create; 
    try 
    Reg.RootKey := HKEY_CLASSES_ROOT; 
    if Reg.OpenKey('moniker', True) then 
    begin 
     Reg.WriteString('', 'URL:Name of moniker'); 
     Reg.WriteString('URL Protocol', ''); 
     Reg.WriteString('Source Filter', '{E436EBB6-524F-11CE-9F53-0020AF0BA770}'); 
     Reg.WriteInteger('EditFlags', 2); 

     if Reg.OpenKey('shell\open\command', True) then 
     begin 
     Reg.WriteString('', '"' + ParamStr(0) + '" "%1"'); 
     end; 
    end else begin 
     MessageBox(0, 'You do not have the necessary access rights to complete this installation!' + Chr(13) + 
     'Please make sure you are logged in with a user account with administrative rights!', 'Access denied', 0); 
     Exit; 
    end; 
    finally 
    FreeAndNil(Reg); 
    end; 

    MessageBox(0, 'Application WebStart has been installed successfully!', 'Installed', 0); 
end; 
0

內部OLE從克雷格Brockschmidt可能有綽號最佳的覆蓋範圍。如果你想深入探討這個話題,我建議你買這本書。它也包含在隨VS 6.0一起提供的MSDN磁盤上,以防萬一您仍然擁有它。

相關問題