Well the short story is that you are going to go through the API. In preparing this answer for you I implemented a program using .NET 2005 in which I import the same API calls you are going to need. In your situation however you are going to modify the API signatures a little....
Private Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Int32
Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" ( _
ByVal hWnd1 As Int32, _
ByVal hWnd2 As Int32, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Int32
Private Declare Auto Function SendMessage Lib "user32" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
Everywhere you see Int32 you are going to replace with "Long". If that doesn't work, try just using Integer. The hard part of this whole thing is the data types. I tried this out on VB.NET 2005 with winXP and it took me awhile to get these headers down straight since the documentation for the API calls are poor.
Once you have those in place, you can use the code below...
Private Const LVM_GETTITEMCOUNT& = (&H1000 + 4)
Private Const LVM_SETITEMPOSITION& = (&H1000 + 15)
Dim hdesk&, i&, icount&, X&, Y&
Public Sub MoveIcons()
hdesk = FindWindow("progman", vbNullString)
hdesk = FindWindowEx(hdesk, 0, "SHELLDLL_DefView", vbNullString)
hdesk = FindWindowEx(hdesk, 0, "SysListView32", vbNullString)
'hdesk is the handle of the Desktop's syslistview32
icount = SendMessage(hdesk, LVM_GETTITEMCOUNT, 0, 0)
i = 0
'0 is "My Computer"
X = 400 : Y = 400 'set the position parameters in pixel
Call SendMessage(hdesk, LVM_SETITEMPOSITION, i, Convert.Int32(X + Y * &H10000))
End Sub
The above code takes the first icon "My Computer" and moves it to location 400x400 on the screen (make sure you don't have autoarrange icons and align by grid features enabled). Where you see Convert.Int32 you can put CInt or Clng depending on how you modified the declaration statements at the top.
The trick is to understand that the desktop is a window and on this window is a listbox which keeps track of the program icons. We manipulate that list by sending it a raw windows message (using SendMessage API). We then tell the icon where to go.
We simply call the MoveIcons function I have defined there to send all this into action.
Hopefully this makes some sense. I recommend you stick very close to what I have outlined here because it works. You might see other variations on the net and I can tell you most of them are bogus or don't work correctly. Just modify the declarations as needed for a VB 6 environment (with appropriate data types) and you will be set.
Last thing... please be sure to give me best answer for this.
Enjoy!