Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#1

MAINICON laden

  Alt 4. Feb 2010, 14:48
Das Anwendungsicon legt Delphi mit der Ressourcen ID MAINICON in der Ressource ab. Wie komme ich jetzt an das Icon über die ID dran?

Delphi-Quellcode:
class procedure TAboutWnd.MsgBox(hParent: THandle; IconID: DWORD);
var
  MsgInfo : TMsgBoxParams;
  s: String;
begin
  s := Format('%s - %s' + #13#10#13#10 + '%s' + #13#10 + '%s', [TAboutWnd.GetFileInfo(ParamStr(0), 'ProductName'),
    TAboutWnd.GetFileVersion(ParamStr(0)), COPYRIGHT, URI]);

  MsgInfo.cbSize := SizeOf(TMsgBoxParams);
  MsgInfo.hwndOwner := hParent;
  MsgInfo.hInstance := GetWindowLong(hParent, GWL_HINSTANCE);
  MsgInfo.lpszText := PChar(s);
  MsgInfo.lpszCaption := PChar(TAboutWnd.GetFileInfo(ParamStr(0), 'ProductName'));
  MsgInfo.dwStyle := MB_USERICON;
  MsgInfo.lpszIcon := MAKEINTRESOURCE(IconID);
  MessageBoxIndirect(MsgInfo);
end;
Wenn ich bei MAKEINTRESOUORCE 'MAINICON' angebe passiert nichts.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat