Archives For windows api

I have nearly finished the first release of my Windows API pack, which is a class library (DLL) that makes using certain Windows APIs from .NET code easier and simpler. You just add a reference to this class library and then you can call managed .NET methods from the library rather than having to figure out how to use the Windows APIs yourself. So far I have got just over 25 managed methods in this library, which makes use of roughly 45 Windows APIs. You can see a list of my managed methods and a description for each one below:

Continue Reading…

Well I’ve just spent ages trying to figure out how to get the window icon (the icon displayed in the title bar at the far left) for an external program window from a VB.NET  app – tried using GetClassInfo, GetClassInfoEx, GetClassLong, GetWindowLong and a few other APIs… only to find that you can simply use SendMessage to send the WM_GETICON message and it returns a handle to the icon – and this works perfectly *for most windows* (I’ll explain in a moment). So for anyone else wanting to do the same thing in the future, here’s a basic vb.net example of how to get the window icon from a window.

Continue Reading…

Perhaps this is common knowledge for a lot of people but even though I have been working with Windows APIs from VB.NET quite a lot recently, I did not know about this little ‘trick’ until today.

Continue Reading…