Best way to add icon to delphi 2007 app (win7) - delphi

I want to add icon to my delphi app. Icon was generated from image via ICOFX, including 128x128 and 256x256 (Vista) icons. I tried to add icon several times:
First of all, using Code Gear IDE: Project Options->Application->Icon. This was an easy way, but Vista-sized icons (128x128 and 256x256) were not added. When scaling in Windows Explorer Ctrl+Wheel, icon stoped increasing in size after 64x64. This happens because Delphi does not support big icons.
Then I tried to change icon in MyProject.RES file (using ResourseExplorer). It did not helped much.
When changing .exe-file icon using ResourseExplorer problems seems to be solved, but this is not a Path of a jedi, obviously. And some problems appears/remains, such as:
when changing .exe-file name (ex: from MEPROG.EXE to _MYPROG.EXE), file icon is changing either (128x128 and 256x256 icons disappeare).
when using MouseRightButton->Send to->Desktop to create a label, label's icon is of small resolution.
copy-pasting exe-file into some other directory(not in deplhi project output dir), could also change icon.
Is there a better way to do this, or I am doing this wrong way?

The Delphi 2007 IDE cannot handle large Vista icons, which use PNG compression. And neither can the brcc32 resource compiler that ships with Delphi 2007.
My solution, when I was still using legacy Delphi versions, was to make a .rc file containing the icons, and compile using the MS resource compiler, rc. The MS resource compiler does support such icons, and is readily available, for example with the Windows SDK.

See the change-log around 2.7 version
http://andy.jgknet.de/blog/ide-tools/ide-fix-pack/
it seems you just try to use Delphi without installing necessary fixes
PS. another way might be to make some command-line utility replacing icon resource and then auto-call it after compilation phase. Still ugly, but better than manually launchign ResEdit each time.

If you do not see the icon, you can just run the following command to clear the icon cache:
ie4uinit.exe -ClearIconCache
For Windows 10, use:
ie4uinit.exe -show

Related

Delphi 11 theme export

I have recently installed RAD Studio 11 on a new VM. I have a huge active project in Delphi 10.2 in a different VM, that among other things uses themes. Migrating the D10.2 project to D11 is not an option right now. But I'd like to export the Windows 11 themes from the D11 IDE to use in the D10.2 project if that's possible. So far I haven't found a way to do the export. Am I missing something in the IDE, or is a 3rd-party tool available to do this? Or are the theme definitions in files stuck off in a folder somewhere that I'm not finding? Thanks.
OK, the downloaded .zip files containing the styles for D11 are stored in C:\Users\<user>\Documents\Embarcadero\Studio\22.0\CatalogRepository\<style name>, and the .vsf files from them are copied to the C:\Users\<user>\Documents\Embarcadero\Studio\19.0\Styles folder for D10.2. Restart the IDE and they show up in the list of available styles.
However, as David and Uwe noted, they don't work 100% as-is. They almost do - everything appears to work fine except forms with borderstyles that include a non-client title bar. On those forms, there's a large "X" in the middle of the title bar and a off-color square box on the left of that title bar underneath the form's icon (or underneath the title text for toolwindows without an icon.) Also, a few 3rd-party controls aren't quite right (TMS TAdvSpinEdits paint their up/down arrows wrong, etc.) These may be fixable with one of the style editors out there, or at least give a basis from which to create a new style .vsf that's D10.2 compatible. Or I can spend the money to get the D10.2 W11 styles pre-done from one of the styles vendors.

How to set the Tool Palette component icon for my component in Delphi 2009?

I've read THIS but it's for Delphi 7 and it's not working in 2009. There are a lot of changes between this two versions. In D7 icons are 24x24, in D2009 icons are 16x16... and in D2009 there is no Image Editor for resorces...
I have a unit SuperList.pas with TSuperList class inside and a separete TSuperList.ico (16x16 16 colors) that I want to use it as the tool palette icon for my component.
This is what I tried...
I start Delphi,
File->New->Pakage,
Add.. SuperList.pas,
Project->Resources...->Add.. TSuperList.ico,
I changed Resource Identifier to TSUPERLIST (two times! it seems it has a bug),
Install the pakage,
restart Delphi.
And the icon is still the default one !
Nothing much has changed since Delphi 7. You need to link a bitmap resource whose name is the same as the component. You can use many different tools to make bitmaps and compile resources. Your mistake here is that you've linked an icon rather than a bitmap.
This question has useful details and could possibly be considered a duplicate: Best way to make a component icon in Delphi XE using only the built in tools

Wrong EXE Application Icon with Resource files

I am exploring with (.Res) resource file and found a useful tutorial on delphi.about.com site.
Tutorial Link:
http://delphi.about.com/od/objectpascalide/l/aa113099a.htm
Download test project:
http://delphi.about.com/library/aboutres.zip
I found out that the application icon is different in Windows explorer. The icon on Application form appears correctly (Refer to Image 2). The icon on Windows task bar appears correctly (refer to Image 3).
But The icon is wrong in Windows Explorer when i browse it (Refer to Image 1). It is not MAINICON from Res file.
Any idea what's wrong with it?
What do I need to configure to get the correct application icon with .EXE file?
Delphi XE3 Environment
Windows 7 Environment
You can download the sample project from above link
Image No (1)
Image No (2)
Image No (3)
Thanks in advance
Having no hint of which icon to display, the shell chooses the one with the lowest ID, or the first one that comes alphabetically. You have three icons in your executable: ICOFOLD, ICOOK and MAINICON. ICOFOLD is the one that is to be displayed in a shell folder.
The taskbar or the form icon are set by sending WM_SETICON messages once your program runs. Hence there's no guesswork there.
The icon in the Taskbar and Form window are accurate, since they come directly from the resources of the running process.
Windows Explorer, on the other hand, caches icons and sometimes that cache gets corrupted or out-of-sync. That is a well-known problem with Windows Explorer. It has nothing to do with your app. There are plenty of third-party tools available to repair the icon cache.
You can just run the following command to clear the icon cache:
ie4uinit.exe -ClearIconCache
For Windows 10, use:
ie4uinit.exe -show

How to change the font size of the editor tabs in Delphi 2010 IDE?

Does anybody knows a way to change the font size of the editor tabs in Delphi 2010 IDE?
With my 1080p 22' monitor the font is too small to read and it causes pain in the eyes.
Some notes
It doesn't respect the system's DPI settings so changing that system setting doesn't help, moreover, I'm using 140% DPI already now, and it's Win7.
I couldn't find any existing 3rd party tools to tweak that.
I'll be willing to write an IDE expert to fix that problem if I know how to do it...
There is not an option to change the font size of these elements, but as you say this can be done writting an expert. Some time ago I started to write an Delphi IDE Expert (This project is not finished yet) which allow you to change the apparence of the Delphi IDE (here you can found the Source Code) , try using some of the code of this project to write your own. Check this image which shows the result of modify the code of the project to increase the font of the TIDEGradientTabSet.

Delphi 2006 Application messing up the GUI on Windows 7

I've been searching the Internet for a solution. Also here on Stackoverflow. But I haven't had any luck so far.
We're having a problem with a Delphi 2006 application running on Windows 7. Some ComboBoxes are not shown. The exactly same application runs fine on Windows XP.
I been trying to locate any patches. Do any one of you know any links or hack to make to GUI look as it should when running a Delphi 2006 application on Vista/Windows 7?
I've found this link: http://www.theabsolute.net/sware/delphivista.html. But it doesn't solve my problems.
Any help are welcome.
/Brian
This may be one of a couple of issues; you haven't given much in the way of details. "Some comboboxes are not shown" doesn't help a lot.
The things I've run across that caused these kinds of problems:
Large fonts when the app was designed with normal fonts
Custom DPI settings (eg., 120 DPI instead of the "standard" 96 DPI)
EDIT after Brian's comment:
That's really strange. I've never seen visual differences between apps compiled in the IDE and command-line.
The only thing I can think of is that the command-line version might have some compiler defines that are affecting the comboboxes (unlikely), or the command-line version is seeing a different version of the .pas and .dfm and that version doesn't have the comboboxes on the form.
You might try making sure that there is only a single copy of the affected .dfm and .pas files on the build machine, and then verify they have the right appearance before compilation. (Use Windows search to check for multiple copies of the source files, and search the entire system just to make sure.)
I've never had this issue with visual controls, but have had it with source changes that didn't seem to take effect, or breakpoints that didn't break because the compiler was seeing a different version of the file than I was... I don't know if that's the case here, but it might be worth checking.

Resources