Jump to content

Hide 1 Desktop Icon


oMBRa
 Share

Recommended Posts

Just want hide it... though I did this:

#include <GuiListView.au3>

$HwNd = ControlGetHandle("Program Manager", "FolderView", "[ClassNN:SysListView321]")
$iNdex = _GUICtrlListView_FindInText($HwNd, "MyIcon")
;_GUICtrlListView_ClickItem($HwNd, $iNdex, "Left", False, 2, 1)
$ID = _GUICtrlListView_MapIndexToID($HwNd, $iNdex)

ControlHide("Program Manager", "FolderView", $ID)
Sleep(3000)
ControlShow("Program Manager", "FolderView", $ID)

I get the Index, the ID, but I cant come out Hiding the icon... what's wrong?

Link to comment
Share on other sites

lol then how I show again the icon?

This will work provided you don't have the show hidden files option enabled in Explorer for the Desktop folder.

Hide

FileSetAttrib ( @DesktopDir & "\Your desktop Shortcut.lnk ", "+H" )oÝ÷ Ù(hÁ«­¢+Ù¥±MÑÑÑÉ¥ ͭѽÁ¥ÈµÀìÅÕ½ÐìÀäÈíe½ÕÈͭѽÀM¡½ÉÑÕй±¹¬ÅÕ½Ðì°ÅÕ½Ðìµ ÅÕ½Ðì

Edit:Added missing &

Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

I found another way ( I dunno how it is possibile )... if I do:

$HwNd = ControlGetHandle("Program Manager", "FolderView", "[ClassNN:SysListView321]")
$iNdex = _GUICtrlListView_FindInText($HwNd, "MyIcon")
_GUICtrlListView_DeleteItem($HwNd, $iNdex)

then My icon will be deleted... but then if I do

$HwNd = ControlGetHandle("Program Manager", "FolderView", "[ClassNN:SysListView321]")
$iNdex = _GUICtrlListView_FindInText($HwNd, "MyIcon")

it will reappear!!

Edited by oMBra
Link to comment
Share on other sites

that way dsnt work so good, I have to run again the script... so Zedna can u post a example of how to use _GUICtrlListView_DeleteItem() to hide an icon on the dekstop and to show it again with _GUICtrlListView_InsertItem() ?

Link to comment
Share on other sites

that way dsnt work so good, I have to run again the script... so Zedna can u post a example of how to use _GUICtrlListView_DeleteItem() to hide an icon on the dekstop and to show it again with _GUICtrlListView_InsertItem() ?

Your previous code:

$HwNd = ControlGetHandle("Program Manager", "FolderView", "[ClassNN:SysListView321]")
$iNdex = _GUICtrlListView_FindInText($HwNd, "MyIcon")
_GUICtrlListView_DeleteItem($HwNd, $iNdex)

is right.

And about _GUICtrlListView_InsertItem() - just look into AutoIt helpfile how to call this function. I can't help you more.

Edited by Zedna
Link to comment
Share on other sites

Then I did _GUICtrlListView_InsertItem($HwNd, "MyIcon", -1, -1)... But it displays a strange icon and if a double click on it opens a folder called "desktop" that countains all my desktop's icons... but I dunno hot to show MyIcon again... any suggest?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...