2012-02-05 39 views
3

我正在開發一個組件包,並希望在Delphi XE的啓動中顯示一個圖標和一些關於它的許可證信息,比如好的組件包(TMS,CnPack等)。爲什麼我的Delphi Splash Screen上的圖標和信息只顯示第一次?

事實上,我正在通過OTA做到這一點,但奇怪的是,只有在第一次編譯和安裝後,這些東西纔會出現在啓動畫面上。關閉Delphi並重新打開後,什麼都不顯示。

這是從我的代碼摘錄這樣做。

unit Wizards.Information; 

interface 

implementation 

{$R *.res} 

uses 
    ToolsAPI, Windows, Graphics, SysUtils; 

const 
    ICON_SPLASH = 'SPLASHICON'; 
    ICON_ABOUT = 'ABOUTICON'; 

var 
    AboutBoxServices: IOTAAboutBoxServices = nil; 
    AboutBoxIndex: Integer = 0; 

resourcestring 
    resPackageName = 'Delphi Framework v1.0'; 
    resLicense = 'Mozilla Public License 1.1'; 
    resAboutCopyright = 'Copyright My Company Ltd.'; 
    resAboutTitle = 'Delphi Framework'; 
    resAboutDescription = 'Good description here ;)'; 

procedure RegisterSplashScreen; 
var 
    bmp: TBitmap; 
begin 
    bmp := TBitmap.Create; 
    try 
    bmp.LoadFromResourceName(HInstance, ICON_SPLASH); 
    SplashScreenServices.AddPluginBitmap(resPackageName, bmp.Handle, False, resLicense); 
    finally 
    bmp.Free; 
    end; 
end; 

procedure RegisterAboutBox; 
var 
    ProductImage: HBITMAP; 
begin 
    Supports(BorlandIDEServices,IOTAAboutBoxServices, AboutBoxServices); 
    ProductImage := LoadBitmap(FindResourceHInstance(HInstance), ICON_ABOUT); 
    AboutBoxIndex := AboutBoxServices.AddPluginInfo(resPackageName, resAboutCopyright + #13#10#13#10 + resAboutDescription, ProductImage, False, resLicense); 
end; 

procedure UnregisterAboutBox; 
begin 
    if (AboutBoxIndex <> 0) and Assigned(AboutBoxServices) then 
    begin 
    AboutBoxServices.RemovePluginInfo(AboutBoxIndex); 
    AboutBoxIndex := 0; 
    AboutBoxServices := nil; 
    end; 
end; 

initialization 
    RegisterSplashScreen; 
    RegisterAboutBox; 

finalization 
    UnRegisterAboutBox; 
end. 

正如你可以看到,我想顯示在Delphi XE的關於框也有一些信息,而我起牀,但這些信息遭受同樣的問題發生與閃屏不幸。

怎麼了?

歡迎任何提示!

由於提前

的問題的答案,一切似乎是現在的工作,但任何其他考慮是值得歡迎的,我的意思是,因使用ForceDemandLoadState(dlDisable)任何其他答案diferent歡迎!

回答

1

我想你可以在註冊程序開始時嘗試撥打ForceDemandLoadState(dlDisable)

+0

您好!這需要在註冊程序中完成,對嗎?我會盡力。謝謝! – 2012-02-06 21:38:36

+0

該解決方案有效,但似乎這是某種形式的「解決方法」。這是解決我的問題的更好方式嗎?你能多解釋一下嗎? – 2012-02-07 01:04:43

+0

我正在製作一個具有3個特殊形式的嚮導,並顯示在存儲庫嚮導中。即使啓動畫面上的圖標未顯示,我的嚮導仍在工作,這使我認爲當然存在一個問題,但這是一個可解決的問題。有必要使用此解決方法? – 2012-02-07 01:10:40