Autor Beitrag
Tendl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117



BeitragVerfasst: Mi 03.12.03 13:17 
Wer hat so etwas schon mal gemacht?
Ich habe eine Imagelist mit verschiedenen Icons, die ich abhängig vom Programmzustand in die Titelleiste bringen will. Dort habe ich aber immer nur das unter Projektoptionen angegebene Icon.
Einen Wechsel durch Nachladen aus einem *.ico File möchte ich nicht, weil ich dann immer die Icon-Files mit verteilen müßte.
Kann mir jemand helfen?

Danke
Thomas
Tana´Ri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 230



BeitragVerfasst: Mi 03.12.03 15:46 
Hi, du möchtest dein Icon zur LZ ändern, ich sowas mal ausprobiert,
meine Lösung war es die Exe mit neuem Icon und anderem Namen zu Kopieren zur laufzeit, den eigentlichen Namen per Paramstr(1) mitgeben und die erzeugende exe schließen und die neue starten, beim start der datei Paramstr(1) immer überprüfen ist der <> '' so wurde neue erzeugt -> delete oldVersion und dann Rename Kopie to original ...

_________________
mfg
Tana´Ri
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mi 03.12.03 16:12 
ich glaube er will einfach nur das icon aus einem timage laden, die exe selbst muss dabei eigentlich nicht kopiert werden etc...

ich nehme an er will das hier machen:
ausblenden Delphi-Quelltext
1:
form1.icon.LoadFromFile('C:\MeinIcon.ico');					


nur das es halt keine ico-file sein soll sondern das ico aus einer imagelist kommen soll

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
Tendl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117



BeitragVerfasst: Mi 03.12.03 17:45 
Funktionieren tut:

Application.Icon.LoadFromFile('159.ico');

Ziel wäre etwas in der Form
!!! Vorsicht funktioniert nicht !!!!
if imagelist1.Count>1 then
application.icon.Assign(TIcon(form1.ImageList1.Components[1]));

Weiß jemand Rat?

Danke
Thomas
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mi 03.12.03 18:32 
probiers mal mit

ausblenden Delphi-Quelltext
1:
2:
if imagelist1.count > 0 then
 ImageList1.GetIcon(0, application.icon);


(Bild nr 1 hat index 0)
Tendl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117



BeitragVerfasst: Do 04.12.03 10:10 
Vielen Dank, das war's.
Thomas