xircon Posted August 14, 2008 Share Posted August 14, 2008 OK, got this: #NoTrayIcon $sfile="status.txt" $fh=FileExists($sfile) if $fh=1 Then $fo=fileopen($sfile,0) $status=FileReadLine($fo,1) FileClose($fo) EndIf ;MsgBox(1,$status,"") if $status="h" then ControlShow("Program Manager", "", "[CLASSNN:SHELLDLL_DefView1]") $fo=fileopen($sfile,2) FileWrite($fo," ") FileClose($fo) ;MsgBox(1,$status,"is h") Else ControlHide("Program Manager", "", "[CLASSNN:SHELLDLL_DefView1]") $fo=fileopen($sfile,2) FileWriteLine($fo,"h") FileClose($fo) ;MsgBox(1,$status,"is blnk") EndIf FileClose($fo) Which works - but you cannot right-click the desktop. Anyone know of a method where the desktop can be clicked? Cheers Steve Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2008 Moderators Share Posted August 14, 2008 When you hide the control, it's moved off screen. Context menus are triggered when your mouse is over the icon and secondary button clicked. Unless you did a horrendous custom function to get the position of the control, copy it's menus, hide it, then watch to see if the mouse is ever over that area and if the secondary button is pressed or.. you replaced the icon for the app with an invisible one (no idea if that would even work) ... I would have no idea personally how to accomplish your task with just the above 2 obstacles. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
spudw2k Posted August 14, 2008 Share Posted August 14, 2008 (edited) Just threw this together. #Include <GuiListView.au3> HotKeySet("{esc}","captureEsc") $exitvar = 0 $h = WinGetHandle("[CLASS:Progman]") $hwnd = ControlGetHandle($h,"","SysListView321") _GUICtrlListView_DeleteAllItems($hwnd) Do $msg = GUIGetMsg() Until $exitvar <> 0 ProcessClose("explorer.exe") Run("explorer.exe") Func captureEsc() $exitvar = 1 HotKeySet("{esc}") EndFunc edit: not elegant but works....kinda. Icons re-appear when refresh occurs (but out of order). Testing copying icons to another listview control instead of killing explorer.exe process. Edited August 14, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF  Link to comment Share on other sites More sharing options...
xircon Posted August 15, 2008 Author Share Posted August 15, 2008 Been thinking over night about this. Is there anyway to emulate: right click desktop-> arrange desktop icons-> show desktop icons Without right clicking or being on the desktop? Mind you this is very slow in hiding / unhiding, but allows a right click on the desktop. Link to comment Share on other sites More sharing options...
spudw2k Posted August 15, 2008 Share Posted August 15, 2008 Send("#d") MouseMove(@DesktopWidth,0,1) MouseClick("right") Send("ID") Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF  Link to comment Share on other sites More sharing options...
Bert Posted August 15, 2008 Share Posted August 15, 2008 Just had a question for I'm curious. This is a serious question. Why does one need to hide the icons? Would not a simple GUI that covered the desktop without a title bar do the trick? If I'm missing something, please clue me in. Thanks. The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 15, 2008 Moderators Share Posted August 15, 2008 Just had a question for I'm curious. This is a serious question. Why does one need to hide the icons? Would not a simple GUI that covered the desktop without a title bar do the trick? If I'm missing something, please clue me in. Thanks.You missed the secondary button click request I think. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
xircon Posted August 16, 2008 Author Share Posted August 16, 2008 Been supplied with some code that when compiled with dev-c++ works and allows right clicking on desktop: CODE#include "windows.h" int main() { HANDLE hWindow; hWindow = FindWindowEx(0, 0, "Progman", 0); hWindow = FindWindowEx(hWindow, 0, "SHELLDLL_DefView", 0); PostMessage(hWindow, WM_COMMAND, 0x7402, 0); return 0; } Not a c/c++ programmer, could this be converted to autoit??? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 16, 2008 Moderators Share Posted August 16, 2008 Been supplied with some code that when compiled with dev-c++ works and allows right clicking on desktop: CODE#include "windows.h" int main() { HANDLE hWindow; hWindow = FindWindowEx(0, 0, "Progman", 0); hWindow = FindWindowEx(hWindow, 0, "SHELLDLL_DefView", 0); PostMessage(hWindow, WM_COMMAND, 0x7402, 0); return 0; } Not a c/c++ programmer, could this be converted to autoit???#Include <WinAPI.au3> _main(0); Hide Sleep(3000) _main(); Show Func _main($i_show = 1) Local $__WM_COMMAND = 0x00111 Local $h_wnd = WinGetHandle("[CLASS:Progman]") $h_wnd = ControlGetHandle($h_wnd, "", "[CLASSNN:SHELLDLL_DefView1]") _WinAPI_PostMessage($h_wnd, $__WM_COMMAND, 0x7402, $i_show) Return 0 EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
rasim Posted August 17, 2008 Share Posted August 17, 2008 xirconIn pure AutoIt: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 Link to comment Share on other sites More sharing options...
Malkey Posted August 17, 2008 Share Posted August 17, 2008 This is slightly off topic, but a good accompliment to rasim's script displaying desktop effects.This script from ProgAndy's post athttp://www.autoitscript.com/forum/index.ph...st&p=549959makes Windows' desktop icons display in a list view on desktop.Slightly modified version.#include <GUIListView.au3> ; http://www.autoitscript.com/forum/index.php?s=&showtopic=75879&view=findpost&p=549959 $h = WinGetHandle("[CLASS:Progman]") $hwnd = ControlGetHandle($h, "", "SysListView321") _GUICtrlListView_SetView($hwnd, 3) MsgBox(0, "", "Press OK to reset Desktop") ;$h = WinGetHandle("[CLASS:Progman]") ;$hwnd = ControlGetHandle($h, "", "SysListView321") _GUICtrlListView_SetView($hwnd, 1) Link to comment Share on other sites More sharing options...
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