Archives For get window icon api

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…