How to insert multi-size icon file using RC.EXE? - delphi

I created a multi-sized icon file for my application. Now i'm using a .rc file to link the icon to my app. Here is the contents of my .rc file :
MAINICON ICON myapp.ico
The file is compiled by RC.EXE, but no icon is added into my application; it keeps using the default Delphi's icon :
What am i missing ?
Thanks

The icon you specify in your *.rc file does indeed get included in the EXE, as you can easily verify using a resource editor. However, if you build using the IDE, so does the icon specified in the Project Options, and that one becomes the main icon of the application.
I almost would expect the Project Options dialog box to have some option not to include an icon, but I cannot find any such option. You can add or change the icon, but you cannot remove it if it is already there.
However, it seems like you can remove it yourself by editing the *.dproj file behind the back of the IDE:
Make sure the project is NOT opened in any instance of the Rad Studio IDE.
Open the *.dproj file in a text editor.
Remove the <Icon_MainIcon> line(s).
Save the file.
Now, if you open the project in the IDE and build it, the IDE will not insert any icon, so your icon specified in the *.rc file becomes the application icon.

Related

Visual Studio Code closes my file when I search for new ones

I'm using Visual Studio Code for working and I use ctrl-P command to search for files in my directory.
The problem appears when I want to search for another file, it opens it in the place of the first searched file, closing it.
Is any setting for avoiding this pain?
By default, VSCode opens files in preview mode. This is indicated by their name being italic in the menu bar. As John noted, you can double click on the file to fully open it.
To disable this behavior, try setting:
"workbench.editor.enablePreview": false
When you select a file from search result -> you will see the file open with file name italicized. This means that the file is open in preview mode. Now any other file you choose to select will replace its content in this tab.
To make this tab stick among the open tabs you can:
double click to select the file
or
double click on already selected file in search pane -> you will see the name of file is not italicized anymore(meaning the file is now pinned as a tab)
Alternatively,
You can use the below setting to have all selected files open as a separate tab:
"workbench.editor.enablePreview": false
This setting is found here : Files -> Preferences-> Settings
But the downside of using this is that all files you click on will remain opened and you would then need to clean tabs after your search.
Ctrl+P -- For targetting a file
Alt+Enter -- For Opening that file into next tab
Double click on the files instead of a single click. That worked for me.

Application icon stuck DELPHI XE5

The first time i update the icon in "project > Options > Application > Load Icon..." the icon as changed as it should, now every time i change the application icon, my app keep compiling with The old icon even if i click in "project > Options > Application > Default" or try to load a new one
The icon get stuck somewhere, but where ?
There's a way to force icon with resource file or unstuck the old icon ?
I download a icon which is a multi size ico file ( one ico file, 8 sizes )
i already try :
Reboot my computer.
Change the .exe name.
Copy the .exe to another computer.
same error.
For Windows platform, the icon (and version info) is stored in resource file (.res). And by default Delphi project includes in exe all the .res files it founds in project directory (see {$R *.res} directive in your .dpr file).
So check all the .res files you have in your project directory to find out which of contains the default icon. You can use any resource editor for that.
Then, just delete that file, but please keep backup, cause .res file may contain other important information.
Had the same experience recently as well.
The "default" button does not seem to work as soon as you have selected an icon.
I got rid of the icon via the following steps:
Close your project.
In your project folder an icon will be created with the name "Projectname"_ICON.ICO.
Rename or remove this Icon.
Reopen your project,
Get to Project->Options,
An error message will be raised at every configuration in which you have used the icon, but by pressing default the message will not reappear,
Now the project is forced to use the default icon again.
Probably there is a more sophisticated manner, but I have not found it elsewhere.
This was what helped me:
You can just run the following command to clear the icon cache:
ie4uinit.exe -ClearIconCache
For Windows 10, use:
ie4uinit.exe -show

Localizable.strings not found at runtime

I develop ios application (iPhone) in MonoTouch(5.2.12)/MonoDevelop(3.0.3.2)
I tried to localize it.
I created localization folders (de.lproj)(Add->New folder) and I placed 'Localizable.strings' file there. This file was added to project (Add->Add files ...).
Localization doesn't work.
I find out that localization files (Localizable.strings) don't locate in runtime place
(/user/jpa/Library/Application Support/iPhone Simulator/5.1/Applications/A99 ...B13/MyApp.app/de.lproj/), even though in MonoDevelop they are.
Why? What is wrong? File is UTF-8 coded. (It doesn't depict with UTF-16)
Thanks.
I believe you'll need to set the build action of your files to "Content" (right click file -> Build Action -> Content).
How do you call your Localized string ? Can you give us a piece of code ?
You don't need to create manually the localization folders, just:
create a Localizable.string file (Right click in project explorer then "New File")
select it
open the Xcode right panel (if not already open)
click on + in the Localization part, and select the language
This method will prevent from manipulation errors because Xcode create the localization folders itself.

Delphi7 Remove/Restore MAINICON from Project

In Delphi7 you can assign/load an icon to a project. After every compilation your application has the assigned icon. I would like to delete/restore the icon back to the original Delphi7 Icon. I can't find a button/option for this. I also tried deleting the .res file but no luck.
Any Ideas?
The icon is stored in the .res file.
If you delete/rename your .res file with the project open in the IDE, maybe the .res data is already loaded and then will be saved again to the new .res.
Anyway, if excluding the .res file is not solving your problem, you can open the .res file with a resource editor tool (XN Resource Editor for example) and export/change/delete the MAINICON resource as you want.

Setting EXE icon in Delphi 7

I'm trying to customize the icon that shows in Windows Explorer and in Desktop shortcuts for my Delphi application.
In the Delphi 7 IDE, I have loaded the desired icon in the Application tab of the Project Options dialog. It shows my desired icon as a graphic.
I didn't think it was necessary, but I also set my icon as the TMainForm Icon property.
However, the resulting EXE still shows the default D7 icon. What am I missing?
I found it after more hunting. I created a new project by copying an existing project from another folder. I forgot to change the program name at the top of the DPR file to match the name of the new project. Somehow, if a wrong name is used there, it prevents the icon from being changed in the generated EXE file...
When you assign an icon to an application, the icon will be embedded in a .res file named identical to the program name (the name mentioned in the first line of the .dpr file). When you change the program name in the .dpr file, delphi creates a new .res file with the new program name and looks for the icon resource in the new res file and finds none, and hence uses the default icon (or a rectangular white box). The old res file which carries the icon resource will no longer be used.
In summary, if you change the program name, you will have to re-assign the icon.
Maybe the icon cache needs to be deleted. There are many pages about this problem, this link might be useful: http://smallvoid.com/article/windows-icon-cache.html

Resources