views:

743

answers:

3

In any language really, im looking for a simple (very simple) way to control the position of a shortcut on the users desktop. I already make the assumption that Auto Arrange and Align to Grid are unchecked.

Ex: The program creates the shortcut to the desktop than places it at position (450,302) on the desktop.

I know how to create shortcuts, but i dont know how to control their placement on the desktop.

A: 

As far as I know, this is controlled by the user and cannot be done programmatically.

Ben Hoffstein
A: 

One can use an automation program such as AutoIt or AutoHotkey to simulate the user clicking and moving the shortcut to another location. These programs can also create the shortcut and place it on the desktop.

A: 

If you are looking for a simple solution, there is none, except perhaps faking user input.

But there is another way, but it is really hard:

Use the DoDragDrop function to programmatically carry out a drag and drop operation.

The hard parts are to implement the IDataSource interface and to create a IDataObject which the explorer can understand.

DR