Start New Discussion within our Software Development Community

I've decide to create a dock like application kind of like Macintosh's dock. I need some assistance finding information on how to get application icons, and how to allow users to drag and drop application shortcuts into the dock, as well as how to stop the applications from opening a second time unless the user right clicks an icon and clicks the option open new instance. Any links or information given will be useful, and your usernames will be noted in the credit for information section.

Here's a link to code to extract icon: Getting Associated Icons Using C#. I still use that code.

To drag and drop files: Drag And Drop Files to a C# Application. I found that with some googling and it seemed a very simple and easy to understand example.

Since the application is started from the dock, you have total control of it. Create a class with application's info and a counter, for example RunningInstances. Every time the application instance is successfully started from the dock, increment RunningInstances. To prevent second instance starting, just check if the associated RunningInstances is bigger than zero. Of course, you do need a way to decrement RunningInstances when a user quits an application. If you start applications as a process, you'll get process.exited event and do the decrement in the event handler. Otherwise you have to loop running apps and count instances. The former approach sounds better to me.

Remember to google things, there are plenty of sample code in the net. I hope this gets you started.

HTH

Comments
Nice post
This article has been dead for over six months. Start a new discussion instead.