设置桌面图标的 AutoArrange 属性:<br>function SetAutoArrange(Value: Boolean): boolean;<br>const<br> LVS_AUTOARRANGE = $0100;<br>var<br> Handle: THandle;<br> Style: DWORD;<br>begin<br> Result := False;<br> Handle := FindWindow('progman', nil);<br> Handle := GetWindow(Handle, GW_CHILD);<br> Handle := GetWindow(Handle, GW_CHILD); //获取桌面 SysListView32 的句柄<br> if Handle <> 0 then<br> begin<br> Style := GetWindowLong(Handle, GWL_STYLE);<br> if Value then<br> Style := Style or LVS_AUTOARRANGE<br> else<br> Style := Style and (not LVS_AUTOARRANGE); //设置该 SysListView32 的属性<br> if SetWindowLong(Handle, GWL_STYLE, Style) <> 0 then<br> Result := True;<br> end;<br>end; <br>