Dedicated Icon for USB drive ?
Moderators: Hacker, petermad, Stefan2, white
Dedicated Icon for USB drive ?
Hi,
Could you tell me if there is a way to have a distinct Icon for a USB drives (like there is a distinct one for USB keys)?
I have search in this forum, and while people mention that it is possible (Jgn on the 29th dec 06):
> ... TC shows distinct icons for diskette, hardisk, networkdrives, cd-dvd, usb and other external disks...
I haven't found out how to do it.
Thanks in advance for your support.
Bernard
Could you tell me if there is a way to have a distinct Icon for a USB drives (like there is a distinct one for USB keys)?
I have search in this forum, and while people mention that it is possible (Jgn on the 29th dec 06):
> ... TC shows distinct icons for diskette, hardisk, networkdrives, cd-dvd, usb and other external disks...
I haven't found out how to do it.
Thanks in advance for your support.
Bernard
"Insanity: doing the same thing over and over again and expecting different results". - Albert Einstein
- ghisler(Author)
- Site Admin
- Posts: 50843
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
No, unfortunately this isn't possible. Without admin rights, there is no way to find out whether a drive is connected via USB or internally. This is only possible for USB sticks, but only when they are formatted as a super floppy, not as a harddisk (with partition table).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
2ghisler(Author)
Did you try or are you already using SetupDiGetDeviceRegistryProperty with SPDRP_REMOVAL_POLICY? Microsoft recommends this functions to find out if a drive is a usb drive.
Documentation
http://msdn2.microsoft.com/en-us/library/ms792967.aspx
Did you try or are you already using SetupDiGetDeviceRegistryProperty with SPDRP_REMOVAL_POLICY? Microsoft recommends this functions to find out if a drive is a usb drive.
Documentation
http://msdn2.microsoft.com/en-us/library/ms792967.aspx
- ghisler(Author)
- Site Admin
- Posts: 50843
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Well, yes, but it requires admin rights to call the functions to get the structures needed:
SetupDiCreateDeviceInfo
http://msdn2.microsoft.com/en-us/library/ms792966.aspx
>>The caller of this function must be a member of the Administrators group.<<
SetupDiCreateDeviceInfo
http://msdn2.microsoft.com/en-us/library/ms792966.aspx
>>The caller of this function must be a member of the Administrators group.<<
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Hi,
There is an possibility to define your own icon file per drive.
Windows Explorer and SpeedCommander are using it.
When you create a "autorun.inf" file in the root of your removable drive and define the ICON variable.
Example:
[autorun]
ICON=AUTORUN\NAME.ICO
You can define your own icon.
This looks like this:
(Look for the Western Digital icon from my Passport I: drive)
Windows Explorer:
http://img103.imageshack.us/my.php?image=windowsexplorerrm0.jpg
SpeedCommander:
http://img103.imageshack.us/my.php?image=speedcommanderyj0.jpg
It would be even more great if this applies for non removable drives also.
DR...
There is an possibility to define your own icon file per drive.
Windows Explorer and SpeedCommander are using it.
When you create a "autorun.inf" file in the root of your removable drive and define the ICON variable.
Example:
[autorun]
ICON=AUTORUN\NAME.ICO
You can define your own icon.
This looks like this:
(Look for the Western Digital icon from my Passport I: drive)
Windows Explorer:
http://img103.imageshack.us/my.php?image=windowsexplorerrm0.jpg
SpeedCommander:
http://img103.imageshack.us/my.php?image=speedcommanderyj0.jpg
It would be even more great if this applies for non removable drives also.
DR...
#106383 Windows 10 Pro 64-bit
- ghisler(Author)
- Site Admin
- Posts: 50843
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The problem is that the button control which I'm currently using is only accepting bitmaps as the images, not icons.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Fast icon to bitmap converting can be implemented very easy, or i miss something?The problem is that the button control which I'm currently using is only accepting bitmaps as the images, not icons.
Code: Select all
Var
Icon : TIcon;
Bitmap : TBitmap;
begin
Icon := TIcon.Create;
Bitmap := TBitmap.Create;
Icon.LoadFromFile('c:\picture.ico');
Bitmap.Width := Icon.Width;
Bitmap.Height := Icon.Height;
Bitmap.Canvas.Draw(0, 0, Icon);
Icon.Free;
{use bitmap code}
Bitmap.Free;
end;
2ghisler(Author)ghisler(Author) wrote:The problem is that the button control which I'm currently using is only accepting bitmaps as the images, not icons.
What do you think about the solution D1P suggested?
Or maybe using a proprietary solution.
For example:
TC scans for the file tcdriveicon.bmp in the root of every drive and if the file exists use it as drive icon.
DR...
#106383 Windows 10 Pro 64-bit
Hi Lefteous,Lefteous wrote:This is embarrassing. Do you think the author doesn't know how to convert an icon into a bitmap?What do you think about the solution D1P suggested?
The best solution would be to reuse the button bar control for the drive bars.
Don't feel embarrased.
I'm certainly not feeling embarresed.
The way the author replies leaves space for discussion.
I personally still have questions like.
"is this suggestion still in the process of looking into?".
"or is it to much work to program?".
etc. etc.
To make a thing clear I don't think the author needs program lessens.
I made the remark as an request for more information.
Greetz,
DR...
#106383 Windows 10 Pro 64-bit
- ghisler(Author)
- Site Admin
- Posts: 50843
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The problem is with the new half-transparent icons. They can't be converted to a bitmap. The delphi buttons use a bitmap where the top-left pixel gives the transparency color, so there is just either transparent or color, no half-transparence. That's one of the reasons why I had to completely rewrite the button bar code to support XP themes. I'm now using icons instead of bitmaps for the icons. But that's a self-written control, not like the drive buttons...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com