Jump to content
Sign in to follow this  
oMBRa

Hide 1 Desktop Icon

Recommended Posts

rasim

oMBra

Why not just move icon from desktop folder to a temp folder, then if need move back?

Edited by rasim

Share this post


Link to post
Share on other sites
oMBRa

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?

Share this post


Link to post
Share on other sites
oMBRa

so how to hide desktop icon ( without moving it in another folder )

Share this post


Link to post
Share on other sites
Bowmore

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

Share this post


Link to post
Share on other sites
oMBRa

U missed "&" between @DesktopDir and "\Your desktop Shortcut.lnk "... Though how to change temporaney the option "show hidden files "... editing the registry?

Share this post


Link to post
Share on other sites
oMBRa

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

Share this post


Link to post
Share on other sites
oMBRa

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() ?

Share this post


Link to post
Share on other sites
Zedna

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

Share this post


Link to post
Share on other sites
oMBRa

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?

Share this post


Link to post
Share on other sites
Zedna

I think you must:

on hide:

- remember position of your icon on desktop

- delete shortcut in desktop directory

- refresh desktop

on show:

- create shortcut in desktop directory

- refresh desktop

- recover icon position on desktop

Edited by Zedna

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.