Jump to content
Tuts 4 You
Sign in to follow this  
LCF-AT

Icon problem with shortcut

Recommended Posts

LCF-AT

Hi guys,

today I have seen something strange using shortcuts icon on desktop to start my app from there without to go manually in the main folder to start my app.So I see there is any kind of icon issue I get later in my main app if it wants to change the icon for the GUI.Problem is that it only keeps the same icon in task for my app what also used the shortcut (my main app) but my app also does change the dialog icon what also works but not in the task of my app.All this is not happend if I start my app manually itself without to use a shortcut etc.

Question: Is there any way to change the shortcut icon settings anyhow so that it works same as my original app if I start it without a shortcut icon on desk etc?

I also tried to start the app via batch command file to start it but my app name has also spaces what not works in that case.

@echo off
cd "C:\app test\"
start app name like this.exe
exit

Does anyone how to start it if the name has spaces?Quotes arent working.

Thank you

Share this post


Link to post
NOP
1 hour ago, LCF-AT said:

I also tried to start the app via batch command file to start it but my app name has also spaces what not works in that case.


@echo off
cd "C:\app test\"
start app name like this.exe
exit

Does anyone how to start it if the name has spaces?Quotes arent working.

Try this...
@echo off
set MyPath=C:\app test\
"%MyPath%\app name.exe"
exit

Any arguments can be included after the quotes...

"%MyPath%\app name.exe" /arg1 /arg2

As for your icon problem, I don't think there is any way to change the desktop icon dynamically in the way you want. The icon location is embedded  in the shortcut when it is created

When you change your programs icon, you are changing it dynamically, you aren't changing the icon in the file resources which is read by the shortcut

Another option is to have the .ico in the same folder as the program and used by the program, when you change the icon, overwrite the .ico with the new one and shortcut points to same location but new .ico is shown

:)

Edited by NOP (see edit history)
  • Like 2

Share this post


Link to post
LCF-AT

Hi NOP,

so  I tried your batch code and my app starts but its empty.So the setting files etc wasnt read in this case. :( App looks so as would you start it the first time.Always this stupid spaces problem!If I dont use spaces in app name then it starts fine as I did post before.

Hhmmm,yes my app does change the icons to show diffrent status what happens actually but only the icon in TASK bar below dosent change if I start the app with shortcut icon.Anyway,so if it dosent work then it would be nice to have any batch command line to start the app also with spaces in the app name.

Thanks again so far NOP

 

Share this post


Link to post
kao

1) If you'd read a documentation for start (you can do that by running "start /?"), you'd learn that start takes first parameter enclosed in quotes and uses it for window title.

So, this will work nicely:

start "My uber cool title" "app name like this.exe" param1 param2

2) NOP's example doesn't set the working directory (no "cd "C:\app test\""). If your app doesn't work in such case, it's a bug in your app.

 

  • Like 2

Share this post


Link to post
LCF-AT

Hi,

ah ok so I tried a little and got it working now like  this below...

@echo off
cd "C:\app name\"
start "" "app name like this.exe"
exit

...now it starts correctly and reading all setting files etc. :)

Thanks again guys.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×
×
  • Create New...