In theory it is possible, yes. You will need to use FindWindow and FindWindowEx (see pinvoke.com) to find your way to the desktop window which is a listview. You will then need to manipulate the listview using SendMessage. The appropriate messages are listed on MSDN (but without values so you'll be spending many a long hour trying to work that out!) You will also need to determine how effectively to marshal the listview structures required for many of the messages and having no little experience of attempting that I was merely warning you that that is where all the frustration which will almost certainly lead to you abandoning this (hopefully with your computer undamaged by multiple crashes) will be. But if you want to go ahead and ignore the 'Here be dragons!' signs and the parched skulls of those who have gone before you and failed then by all means be my guest. I'll even give you the first steps for free ....
vb.net Code:
Dim Hdesk As IntPtr = FindWindow("Progman", "Program Manager") Dim hdesk1 = FindWindowEx(Hdesk, IntPtr.Zero, "SHELLDLL_DefView", vbNullString) Dim hdesk2 = FindWindowEx(hdesk1, IntPtr.Zero, "SysListView32", "FolderView") ' hdesk2 is the handle for the listview where desktop icons are stored which you need for SendMessage




Reply With Quote
