ken82m Posted August 31, 2010 Posted August 31, 2010 I've found plenty of methods to toggle desktop icon visibility do this on the au3 forum and loads of them on google. But nothing I've tried has worked except right clicking on the desktop>view>show desktop icons. I'd like to list what i've tried for you but the list is endless, however I tried every script that came. But here are the last three autoit solutions I've found. Thanks, Kenny WinSetState("Program Manager", "", @SW_HIDE) #include <GUIListView.au3> $h = WinGetHandle("[CLASS:Progman]") $hwnd = ControlGetHandle($h,"","SysListView321") _GUICtrlListView_SetView($hwnd,3) MsgBox(0, "Warning", "Now we hide desktop icons") _ShowHideIcons(@SW_HIDE) MsgBox(0, "Warning", "Now we show desktop icons") _ShowHideIcons(@SW_SHOW) Func _ShowHideIcons($sState) Local $hParent = WinGetHandle("Program Manager") Local $hListView = ControlGetHandle($hParent, "", "SysListView321") WinSetState($hListView, "", $sState) EndFunc "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."
Yashied Posted August 31, 2010 Posted August 31, 2010 (edited) DllCall('user32.dll', 'lresult', 'SendMessage', 'hwnd', ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SHELLDLL_DefView]'), 'uint', 0x0111, 'wparam', 29698, 'lparam', 0) Sleep(2000) DllCall('user32.dll', 'lresult', 'SendMessage', 'hwnd', ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SHELLDLL_DefView]'), 'uint', 0x0111, 'wparam', 29698, 'lparam', 0) Edited August 31, 2010 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
wakillon Posted August 31, 2010 Posted August 31, 2010 (edited) Another one...#Include <WinAPI.au3> _ShowDesktopIcons ( 0 ) ; Hide Sleep ( 3000 ) _ShowDesktopIcons ( 1 ) ; Show Func _ShowDesktopIcons ( $_Show ) _WinAPI_PostMessage ( ControlGetHandle ( WinGetHandle ( '[CLASS:Progman]' ), '', '[CLASSNN:SHELLDLL_DefView1]' ), 0x00111, 0x7402, $_Show ) EndFunc Edited August 31, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
ken82m Posted August 31, 2010 Author Posted August 31, 2010 cool, thanks appreciate it. -Kenny "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."
Yashied Posted August 31, 2010 Posted August 31, 2010 Another one... #Include <WinAPI.au3> _ShowDesktopIcons ( 0 ) ; Hide Sleep ( 3000 ) _ShowDesktopIcons ( 1 ) ; Show Func _ShowDesktopIcons ( $_Show ) _WinAPI_PostMessage ( ControlGetHandle ( WinGetHandle ( '[CLASS:Progman]' ), '', '[CLASSNN:SHELLDLL_DefView1]' ), 0x00111, 0x7402, $_Show ) EndFunc This is wrong. What is $ _Show? This parameter is not used by WM_COMMAND (0x0111) and must be set to 0. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Yashied Posted August 31, 2010 Posted August 31, 2010 (edited) In addition. _ToggleDesktopIcon() ConsoleWrite('Show desktop icons: ' & _IsDesktopIconShow() & @CR) Sleep(2000) _ToggleDesktopIcon() ConsoleWrite('Show desktop icons: ' & _IsDesktopIconShow() & @CR) Func _IsDesktopIconShow() Return (BitAND(WinGetState(ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SysListView32]')), 2) = 2) EndFunc ;==>_IsDesktopIconShow Func _ToggleDesktopIcon() DllCall('user32.dll', 'lresult', 'SendMessage', 'hwnd', ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SHELLDLL_DefView]'), 'uint', 0x0111, 'wparam', 29698, 'lparam', 0) EndFunc ;==>_IsDesktopIconShow Edited August 31, 2010 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Cyri Posted April 18, 2011 Posted April 18, 2011 In addition. _ToggleDesktopIcon() ConsoleWrite('Show desktop icons: ' & _IsDesktopIconShow() & @CR) Sleep(2000) _ToggleDesktopIcon() ConsoleWrite('Show desktop icons: ' & _IsDesktopIconShow() & @CR) Func _IsDesktopIconShow() Return (BitAND(WinGetState(ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SysListView32]')), 2) = 2) EndFunc ;==>_IsDesktopIconShow Func _ToggleDesktopIcon() DllCall('user32.dll', 'lresult', 'SendMessage', 'hwnd', ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SHELLDLL_DefView]'), 'uint', 0x0111, 'wparam', 29698, 'lparam', 0) EndFunc ;==>_IsDesktopIconShow The above method plus a new others I've found on the forums work great in Windows XP but I can't get any of them to work on Windows 7. Whether with run as admin or not they don't work. Any ideas?
Hansio Posted August 28, 2011 Posted August 28, 2011 DllCall('user32.dll', 'lresult', 'SendMessage', 'hwnd', ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SHELLDLL_DefView]'), 'uint', 0x0111, 'wparam', 29698, 'lparam', 0)Sleep(2000)DllCall('user32.dll', 'lresult', 'SendMessage', 'hwnd', ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SHELLDLL_DefView]'), 'uint', 0x0111, 'wparam', 29698, 'lparam', 0) In addition._ToggleDesktopIcon()ConsoleWrite('Show desktop icons: ' & _IsDesktopIconShow() & @CR)Sleep(2000)_ToggleDesktopIcon()ConsoleWrite('Show desktop icons: ' & _IsDesktopIconShow() & @CR)Func _IsDesktopIconShow() Return (BitAND(WinGetState(ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SysListView32]')), 2) = 2)EndFunc ;==>_IsDesktopIconShowFunc _ToggleDesktopIcon() DllCall('user32.dll', 'lresult', 'SendMessage', 'hwnd', ControlGetHandle('[CLASS:Progman]', '', '[CLASS:SHELLDLL_DefView]'), 'uint', 0x0111, 'wparam', 29698, 'lparam', 0)EndFunc ;==>_IsDesktopIconShow This works fine under W7 x64 but I have noticed that the script must run once after Windows has been restarted. So the script works only the second time. Does anyone have a solution to it?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now