| View previous topic :: View next topic |
| Author |
Message |
CMark Guest
|
Posted: Thu Jun 19, 2008 10:52 am Post subject: How to set correct icon for MsgBox ? |
|
|
How to set correct icon for MsgBox ?
Let's use simple script AHK01.AHK
Then compile
| Quote: |
"C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "AHK01.AHK" /OUT "AHK01.EXE" /icon "C:\ICONS\msnms.ico"
|
AHK01.EXE has msnms.ico icon.
If you execute AHK01.EXE
MsgBox has msnms.ico icon (on the taskbar button).
It's OK.
Then compile
| Quote: |
"C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "AHK01.AHK" /OUT "AHK01.EXE" /icon "C:\ICONS\COMPUTER.ICO"
|
Now AHK01.EXE has COMPUTER.ICO icon.
But if you execute AHK01.EXE now
MsgBox still has msnms.ico icon (on the taskbar button).
Strange ?
How to overide this ? (to set correct icon for MsgBox) |
|
| Back to top |
|
 |
John W
Joined: 09 Apr 2007 Posts: 169
|
Posted: Thu Jun 19, 2008 11:01 am Post subject: |
|
|
The icon is correct!
May I misunderstood anything - but tray icon is ok _________________ John
Inactive - Until AutoHotkey is available for Linux. |
|
| Back to top |
|
 |
CMark Guest
|
Posted: Thu Jun 19, 2008 11:46 am Post subject: |
|
|
John W wrote
| Quote: |
May I misunderstood anything - but tray icon is ok
|
It's not about tray icon, but about taskbar icon (for MsgBox window). |
|
| Back to top |
|
 |
John W
Joined: 09 Apr 2007 Posts: 169
|
Posted: Thu Jun 19, 2008 11:56 am Post subject: |
|
|
Oh, I see...
Its a mistake by Windows - the icon is not in the file. _________________ John
Inactive - Until AutoHotkey is available for Linux. |
|
| Back to top |
|
 |
AHK=Pathetic Guest
|
Posted: Thu Jun 19, 2008 4:19 pm Post subject: |
|
|
You AHK guys are really great.
First, you don't understand anything.
| Quote: |
CMark
| Quote: |
But if you execute AHK01.EXE now
MsgBox still has msnms.ico icon (on the taskbar button).
Strange ?
|
|
Then you try to deny
| Quote: |
John W
| Quote: |
The icon is correct!
May I misunderstood anything - but tray icon is ok
|
|
Then you try to blame Microsoft/Windows/...
| Quote: |
John W
| Quote: |
Oh, I see...
Its a mistake by Windows
|
|
Really pathetic. |
|
| Back to top |
|
 |
ttrickyy
Joined: 18 Jun 2008 Posts: 20
|
Posted: Thu Jun 19, 2008 5:38 pm Post subject: |
|
|
| AHK=Pathetic wrote: | You AHK guys are really great.
...
Really pathetic. |
One of us does not speak for all of us.
However, if we could get back to the issue at stake. I do not experience the same problem that you are having.
This is the icon that I specified it should be compiled with, and the icon correctly displayed.
Check and make sure that you are not using the "Icon" command to change the icon in the script. This is the only thing that I can think of that would have this problem. _________________ ttrickyy |
|
| Back to top |
|
 |
CMark Guest
|
Posted: Thu Jun 19, 2008 6:05 pm Post subject: |
|
|
AHK=Pathetic wrote
| Quote: |
First, you don't understand anything.
|
I admit I don't understand this.
AHK=Pathetic wrote
| Quote: |
Then you try to blame Microsoft/Windows/...
|
Well, it seems to me it has to do something with Windows.
If I rename AHK01.EXE to any other name (for example to AHK01NEW.EXE)
then it works fine.
(MsgBox has the same icon on the taskbar button as AHK01.EXE.
It seems that Windows somehow remember MsgBox icon from first execution.)
ttrickyy wrote
| Quote: |
Check and make sure that you are not using the "Icon" command to change the icon in the script.
|
AHK01.AHK script (for simplicity) has only one line
ttrickyy wrote
| Quote: |
I do not experience the same problem that you are having.
|
Well I tried this on several XP Pc computers.
It always has this problem.
Are you sure you did second compile with some other icon? |
|
| Back to top |
|
 |
ttrickyy
Joined: 18 Jun 2008 Posts: 20
|
Posted: Thu Jun 19, 2008 6:27 pm Post subject: |
|
|
| CMark wrote: | | I admit I don't understand this. |
Me neither.
| CMark wrote: |
If I rename AHK01.EXE to any other name (for example to AHK01NEW.EXE)
then it works fine.
(MsgBox has the same icon on the taskbar button as AHK01.EXE.
It seems that Windows somehow remember MsgBox icon from first execution.) | I had suspected something like this but wasn't sure. It's a weird error to have... maybe you could try forcing the icon change in the script with the Icon command?
| CMark wrote: |
AHK01.AHK script (for simplicity) has only one line
|
| CMark wrote: | Well I tried this on several XP Pc computers.
It always has this problem.
Are you sure you did second compile with some other icon? |
I didn't understand the issue that was occuring. Yes, I can't fix this issue either, with what I've tried. Sorry for the bad advice about the Icon command earlier, I did not understand how to use it correctly-- it pertains to the tray icon, not to the application's icon.
With some googling, it appears that explorer.exe caches icons. Short of forcing a different icon size or changing the screen's color depth, it seems like the easiest solution is to reboot your computer.  _________________ ttrickyy |
|
| Back to top |
|
 |
Mike" Guest
|
Posted: Fri Jun 20, 2008 6:12 am Post subject: |
|
|
When I read this topic I didn't believe it.
But when John W and ttrickyy confirm there is a problem
I decided to try it.
I couldn't believe it.
It seems to be truth.
After you execute some AHK exe (for example: "C:\IconTest\AHK01.exe"),
you can't change MsgBox icon for it anymore.
You can even copy some quite other AHK exe file
over that first one
MsgBox icon stays same.
You just can't change it anymore
as long as filepathname stays same (for example: "C:\IconTest\AHK01.exe").
For this kind of problem you need some expert.
Where's the enlightened lexikos when you need him?
It might be the only one who can solve this kind of problem. |
|
| Back to top |
|
 |
John W
Joined: 09 Apr 2007 Posts: 169
|
Posted: Fri Jun 20, 2008 6:21 am Post subject: |
|
|
I think the file is stored in RAM, but the icon isnīt updated - may the RAM has to be overwritten. _________________ John
Inactive - Until AutoHotkey is available for Linux. |
|
| Back to top |
|
 |
CMark Guest
|
Posted: Fri Jun 20, 2008 8:52 am Post subject: |
|
|
Mike" wrote
| Quote: |
You just can't change it anymore
as long as filepathname stays same (for example: "C:\IconTest\AHK01.exe").
|
I guess you're right.
It seems that Windows somehow remember MsgBox icon from the first execution.
But I don't understand some things:
=1= Who/where remember MsgBox icon from the first execution ???
=2= Why do it (remember MsgBox icon from the first execution) at all ???
Why don't always use the program icon for MsgBox ?
=3= How to change/override this (MsgBox icon) ??? |
|
| Back to top |
|
 |
John W
Joined: 09 Apr 2007 Posts: 169
|
Posted: Fri Jun 20, 2008 8:57 am Post subject: |
|
|
1) RAM
2) Speed
3) Clean up RAM
You understand? _________________ John
Inactive - Until AutoHotkey is available for Linux. |
|
| Back to top |
|
 |
CMark Guest
|
Posted: Fri Jun 20, 2008 10:32 am Post subject: |
|
|
| John W wrote: |
1) RAM
2) Speed
3) Clean up RAM
You understand?
|
Sorry, I don't understand it. |
|
| Back to top |
|
 |
John W
Joined: 09 Apr 2007 Posts: 169
|
Posted: Fri Jun 20, 2008 10:45 am Post subject: |
|
|
If you run a programme itīs put into RAM. If the programme exits, it is kept in memory until its memory is needed, then the used memory will be overwritten. But if you run a programme you just exited, the old memory can be used - usually. But in this special case there is a very small difference whic isnīt seen by the OS, so our icon is wrong. _________________ John
Inactive - Until AutoHotkey is available for Linux. |
|
| Back to top |
|
 |
CMark Guest
|
Posted: Fri Jun 20, 2008 11:39 am Post subject: |
|
|
John W wrote:
| Quote: |
If you run a programme itīs put into RAM. If the programme exits, it is kept in memory until its memory is needed, then the used memory will be overwritten. But if you run a programme you just exited, the old memory can be used - usually. But in this special case there is a very small difference whic isnīt seen by the OS, so our icon is wrong.
|
It's hard to believe that Microsoft would have make such a big error.
Anyway, if you restart PC
then you have clean RAM
and if you start AHK01.EXE that has a new icon
his MsgBox still has the icon from the first execution.
So, it doesn't seem to be problem with old RAM data. |
|
| Back to top |
|
 |
|