Announcement

Collapse
No announcement yet.

Anwendungssymbol bei zweitem Aufruf ändern

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Anwendungssymbol bei zweitem Aufruf ändern

    Anfänger!
    Wie kann ich beim zweiten Aufruf meines Programms (zweite Instanz) der Anwendung ein anderes Icon zuweisen?

  • #2
    Application.Icon.LoadFromFile(OpenPictureDialog1.F ileName);

    so kannst du das icon während der laufzeit verändern

    genaue Hilfetext:

    <pre>
    Determines which icon represents the application on the Windows task bar.

    property Icon: TIcon;

    Description

    Use Icon to assign a specific icon to represent the application. Set the Icon property by either:

    Assigning it a TIcon at runtime.
    Loading an icon on the Application pages of the Project|Options dialog box at design time.

    Icon represents the application when it is minimized and appears either on the Windows desktop or task bar.
    </pre>

    Codebesipiel:
    <pre>

    procedure TForm1.Button1Click(Sender: TObject);

    var
    Done: Boolean;
    begin
    OpenPictureDialog1.DefaultExt := GraphicExtension(TIcon);
    OpenPictureDialog1.FileName := GraphicFileMask(TIcon);
    OpenPictureDialog1.Filter := GraphicFilter(TIcon);
    OpenPictureDialog1.Options := [ofFileMustExist, ofHideReadOnly, ofNoChangeDir ];
    while not Done do
    begin
    if OpenPictureDialog1.Execute then
    begin
    if not (ofExtensionDifferent in OpenPictureDialog1.Options) then

    begin
    Application.Icon.LoadFromFile(OpenPictureDialog1.F ileName);
    Done := True;
    end
    else
    OpenPictureDialog1.Options := OpenPictureDialog1.Options - ofExtensionDifferent;
    end
    else { User cancelled }
    Done := True;
    end;
    end;
    </pre>

    du mußt das ganze jetzt so umschreiben das er das icon (z.B) in eine ini schreibt.

    Für weitere Hilfe habe ich dir meine icq nummer geschickt.

    BINE :O

    Comment

    Working...
    X