Skip to content

Category Archives: Win 32 API

Convert Image to Icon using C#

30-Sep-09

Sometimes we will get nice Images from Web as Icons. But we can’t use these Images as application icons in .Net, because the .Net supports *.ico(Icon) format only. This code will convert an Image to Icon using C#. It is written .Net Framework 3.5, but it should work in .Net 2.0. It supports Images upto [...]

Consuming a C++ DLL in C#

10-Jul-09

While working on my current project, I had to use some low level I/O operations, but it was difficult using C#, and I got some C++ implementations. Then I thought of creating a DLL in C++ and use it in C#, but I didn’t get any code for the implementation. So I done some searching [...]

Disable autorun of USB disks

18-Feb-09

In the last post I was implemented the USB detection, but the problem become more complex, because my USB stick contains some Autorun.inf file and when you plug the stick, it start executing some program, otherwise you need to cancel it explicity. The client need to avoid this. So I have to find some solution, [...]

How to detect USB insertion and removal in VB.Net

13-Feb-09

Recently I moved to a Desktop application development team, where I have to look for the insertion of the USB. I need to read the contents of the USB drive and updates the application. I got a lot of solutions from Google to detect the USB insertion and removal. I am posting the easiest one [...]

File Properties Dialog box using VB.Net

03-Jul-08

While working with my WPF project, I come to a requirement, where I need to display the File Properties dialog box, which available on right click on a File > selecting Properties. I got one solution from Google groups, but I forgot the link. I am posting the code.

Imports System
Imports System.Runtime.InteropServices
Namespace Win32
[...]