[Webinar] Streamline your web hosting managementRegister Today


Any API or other method set Desktop's AutoArrange = False

Posted on 2000-01-12
Medium Priority
Last Modified: 2010-08-05

Is there any API or other method set Desktop's AutoArrange = False?
if has, could you give a few line of code please?
Question by:y9y
  • 2
LVL 20

Accepted Solution

Madshi earned 200 total points
ID: 2348306
You have to find the desktop listview's handle like this:

var lv : dword;

lv := FindWindowEx(FindWindowEx(FindWindow('Progman', 'Program Manager'), 0, 'SHELLDLL_DefView', ''), 0, 'SysListView32', '');

Now you have to do

  SetWindowLong(lv, GWL_STYLE, GetWindowLong(lv, GWL_STYLE) and (not LVS_AUTOARRANGE));

The big problem is that SetWindowLong works only for windows that own to your own process. So this all doesn't work from your application. You have to put this in a dll, then you must manage to load your dll into the explorer's process somehow, then execute this code there. *QUITE* difficult...

Another possibility would be to use some APIs to open the context menu of the desktop and execute the appropriate menu item (difficult, too, but not THAT difficult). The main problem here is that you have to find the correct menu item. You can only look for a specific text which would be language dependent. VERY ugly... So the first suggestion would be much better - though more difficult, too.

Regards, Madshi.

Author Comment

ID: 2349439
Hi, Madshi:

Thanks for your help.

It seems I ask 2 question for same problem. Try to deal with another process with just a handle of it.

If you do not mind, could you please check the other question?


Best Regards.

Author Comment

ID: 2350200

Thanks for your help.

Best Regards;


Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question