Click here to Skip to main content
15,885,025 members
Articles / Web Development / ASP.NET
Tip/Trick

Easy USB Remover (F10 to remove)

Rate me:
Please Sign up or sign in to vote.
4.89/5 (7 votes)
23 Nov 2013CPOL 25.7K   8   5   9
If you often use removable USB devices like a flash drive, you are probably already familiar with the “Safely Remove Hardware” icon that sits in the system tray. The problem for many people is that the icon is tiny, and clicking it just right to bring up the menu is a pain.

Introduction 

If you often use removable USB devices like a flash drive, you are probably already familiar with the “Safely Remove Hardware” icon that sits in the system tray.  

The problem for many people is that the icon is tiny, and clicking it just right to bring up the menu is a pain. 

So that only I create a application for windows to safely remove the USB from Computer by simply pressing "F10" key.

Its requires background run. 

Image 1

Using the code

The code that runs the application until the user terminated manually.

No sleep() or other timer function has been used:

C#
/// Processes a menu item.
/// The sender
/// instance containing the event data.</param>
void Exit_Click(object sender, EventArgs e)
{
    // Quit without further ado.
    Application.Exit();  
}

///start the system function  
System.Diagnostics.Process.Start(""); 
        public void Display()
{
    // Put the icon in the system tray and allow it react to mouse clicks.            
    ni.MouseClick += new MouseEventHandler(ni_MouseClick);
    ni.Icon = Resources.SystemTrayApp;
    ni.Text = "Easy USB Remover";
    ni.Visible = true;

    // Attach a context menu.
    ni.ContextMenuStrip = new ContextMenus().Create();
}

Points of Interest

I would like to thank codeproject.com . Because i just embed my idea into C# code which i got in there only. and also I thank U. Manikandan who is the initiator of this project!

Here is the project running snaps.

Image 2

Image 3

History

  • 23/11/2013: Easy USB Remover v1.0 created.   

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Junior)
India India
Workaholic!
Sr Software Developer.
Web Developer and Desktop Application Development.

Comments and Discussions

 
QuestionCan you send the project code to me? Pin
Volcanoscar27-Nov-13 13:56
professionalVolcanoscar27-Nov-13 13:56 
Questionwhat if there are any file is used? Pin
Cosmic_Spy24-Nov-13 0:49
Cosmic_Spy24-Nov-13 0:49 
AnswerRe: what if there are any file is used? Pin
Prabakaran T24-Nov-13 1:39
professionalPrabakaran T24-Nov-13 1:39 
GeneralRe: what if there are any file is used? Pin
Cosmic_Spy24-Nov-13 12:36
Cosmic_Spy24-Nov-13 12:36 
QuestionLink to program is available? Pin
Sampath Sridhar23-Nov-13 18:55
Sampath Sridhar23-Nov-13 18:55 
AnswerRe: Link to program is available? Pin
Prabakaran T23-Nov-13 22:28
professionalPrabakaran T23-Nov-13 22:28 
GeneralRe: Link to program is available? Pin
Sampath Sridhar24-Nov-13 20:12
Sampath Sridhar24-Nov-13 20:12 
QuestionShould have more details Pin
Philippe Mori23-Nov-13 12:05
Philippe Mori23-Nov-13 12:05 
It would be nice if you would explain how you find removable devices and how you remove them.
Philippe Mori

AnswerRe: Should have more details Pin
Prabakaran T23-Nov-13 22:38
professionalPrabakaran T23-Nov-13 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.