user328146
user328146

Reputation:

Changing system icon in C#

I'm doing an app for windows written in C#. I want the app to change the icon of the trash icon / recycle bin. How can I accomplish this?

Upvotes: 2

Views: 782

Answers (2)

Achilleterzo
Achilleterzo

Reputation: 742

See there in regedit also:

[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}]

Upvotes: 0

Shadow Wizard
Shadow Wizard

Reputation: 66389

The location of the recycle bin icon is defined in the registry of Windows.

This page show exactly where: http://www.winxptutor.com/rbicon.htm

I'll copy it here as mirror just in case:

The Recycle Bin icon is defined in two places in the registry:

HKEY_CLASSES_ROOT\
CLSID\
{645FF040-5081-101B-9F08-00AA002F954E}\
DefaultIcon

and

HKEY_CURRENT_USER\
Software\
Microsoft\
Windows\
CurrentVersion\
Explorer\
CLSID\
{645FF040-5081-101B-9F08-00AA002F954E}\
DefaultIcon

By default, the values point to system DLL with the default icon. (Different in each Windows version)

So all you need is overwriting the registery values for the names (Default), empty and full in the above two locations to your own DLL with your own icon and the icon should change.

Writing to regisry with C# should be simple, if you need further help let us know.

Upvotes: 3

Related Questions