I have created an MFC application which has the icon for it as part of its resources. Now, when I place the shortcut to the application on Desktop the icon for the application appears as expected. But now when I create a folder and move this shortcut inside that folder; it becomes blank.
I am facing another situation as well; where the exe kept inside the output folder doesn't show the icon and is blank. But as soon as I change the name of the exe both the icon in the output folder aswell the desktop icon for it appears.
I am using Windows 10 and application is built using VS2008. Could you please help?
Related
I have a shortcut with a custom icon on it, the icon shows fine until I try copy the shortcut to another machine.
I have the icon saved in the same folder as the shortcut yet it still does not show when copied to another machine.
I was wondering if there was a way to have this icon stored inside the shortcut or some way to have it get the icon from the current folder with a relative path?
Icons cannot be stored inside a .lnk file and you cannot use a relative path to the icon.
The only thing you can use are environment variables (the .lnk will have a EXP_SZ_ICON_SIG data block).
How to change the default icon of my Processing appIconTest.exe exported
application in windows ?
The default one :
After some research, the easiest solution i could find is :
Go into ...\processing-3.0.1-windows64\processing-3.0.1\modes\java\application
Save sketch.ico somewhere you can find (renaming it will help).
Place the icon you want to use in the same folder with the same name sketch.ico (which you might create using GIMP).
Now you can export your application from Processing.
Important : Be sure to save the default icon, because every application you export (after changing the icon) using Processing, will have this new icon.
You can change the icon of your running application (the icon that shows up in the title bar of the window and the task bar), but I don't think that's what you're asking about. You can't easily change the icon of the file itself.
That icon seems to be coming from the core.jar Processing library file, so if you want to hack at it, you could try replacing that file in the jar. I really don't recommend that though.
Because the .exe file that Processing exports isn't really an executable anyway- it's really just a shell that calls the code in the lib directory. (source)
If you want to create a real .exe file and have control over its icon, you should look into using a .exe generator like JSmooth or launch4j or JWrapper.
I would recommend Resource Hacker to change the icon of your programs.
Install Resource Hacker (latest build).
Go to your executable file.
Open it with Resource Hacker (right mouseclick, and there should be an option to do that or else you could just click open with).
It will open and show some directories, also one called "Icon", open that one, and right click one one of the icon files (stars with some numbers after that), there will be an option: "replace icon ... Ctrl + R", click that one and replace your icon.
I'm having trouble with my application icon looking bad after adding it into my project, building it, and creating a shortcut to it.
Here's what I've done:
1) I started with a 256x256 PNG file that looks great.
2) I used IcoFX to generate a .ICO file with all the recommended sizes.
3) I add the icon to my project as follows:
A) Open project properties -> Resources -> Add Resource -> Add Existing File
B) Choose the .ICO file that I created in step 2.
4) Go to "Application" section of project properties.
5) In "Icon and Manifest", drop down "Icon" and choose the icon that I added in step 3.
6) Save my project and build it.
7) Go to Windows Explorer and find the newly built EXE.
8) Create a shortcut to the EXE on the desktop.
The icon looks like this:
As you can see, it doesn't look very good. The edges are jagged, etc.
At first, I thought it was an issue with my .ICO file, but here's the kicker... I then did the following:
9) Right-click on the desktop icon, and go to Properties.
10) Go to the Shortcut tab and click "Change Icon".
11) Click "Browse", and select the EXACT SAME ICON FILE that I added to my project in step 3.
Now, my desktop icon looks like this:
Now, the icon looks pretty and smooth!
Again, both icons used the exact same source .ICO file. The only difference is that the first one was imported into Visual Studio and embedded in my .EXE, and the other one was directly used via the OS.
What is Visual Studio doing to my icon to make it look so crummy, and how can I prevent it?
This could be a problem with the windows icon cache. I had the same problem that I fixed by clearing the cache.
The first version of your code that you copied to the desktop - did this have a low res icon ?
Windows will cache the icon when it first sees the EXE, and then does not refresh even when you rebuild your executable if it has the same filename. You will also see the same behavior in windows explorer.
I think by changing the icon through the OS, you've just manually refreshed the icon cache.
You can quickly test this by renaming the EXE before copying it to the desktop. This will bypass the cache and show the actual icon in your EXE.
To get rid of any old icons in the icon cache, you can clear it as described in this link
http://www.winability.com/how-to-erase-icon-thumbnail-cache-windows-8/
I show a bunch of exe files in a listview, and I want to show their default icon, but if the exe file has no icon resource, I would like to show the Windows default application icon regardless of the OS version. If I check the registries at:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\DefaultIcon]
the default value is "%1", which is the first icon in the exe file itself. But where is the default .exe icon for exe files with no icon?
This is what XP does (this is actually a shortcut, but you get the point)
It's been awhile; but doesn't shell32 handle this?
Here's an older article from stackoverflow
I'm having an issue with an creating application shortcut on the desktop from a Visual Studio 2010 deployment project. The shortcut is created just fine, but when I go to drag and drop an application-specific file onto the shortcut, it doesn't work (the cursor turns into the red circle with a slash through it). On the other hand, if I go to the application directory and do this on the executable itself it works fine (it opens the file properly). The interesting part is if I manually create a shortcut to the executable after install, it also works to drag and drop files onto that.
Something that might be useful that I discovered when I was trying to fix this is that if I open up the properties dialog of both the shortcuts (the deployment project created one and the one I made manually), the manually created one has as its target the full path of the executable, whereas the other one just has the name of the executable (although its start in directory is correct). They both run the application when I double-click on them and they both have the correct icon displayed.
How do I get the deployment project created shortcut to allow drag and drop of executable files onto it to open them?
I had the same issue.
First i went here, which answers your question:
http://social.msdn.microsoft.com/Forums/en/vssetup/thread/b57f1d84-9b0c-4c29-b140-0555f92ffed8
But apparently support for orca.exe and WiRunSQL.vbs seems to have disappeared because I couldn't find it on msdn anywhere.
Then i found http://www.instedit.com which seems to have done the trick. I liked the automated answer of the vbs script, but oh well.