topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday March 18, 2024, 10:11 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: "CleanDesktop" - The Sarge's latest challenge to the developers!  (Read 19170 times)

Markham

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 404
    • View Profile
    • Circle Dock
    • Donate to Member
Very late last night (Cebu time), the Sarge was musing about some of the newer additions to Circle Dock and wondered if it would be possible to have a small command-line utility that would hide or show the icons on the Windows Desktop. He, being a marketing type, believes that such a program would be rather popular and basically "threw-down the gauntlet" challenging me to come up with such a program.

Well, Sarge, I have risen to your challenge and released "CleanDesktop" which does precisely what you asked for - and then some! Not only can it hide, show or toggle the visibility of the Windows Desktop Icons but also it can do the same for the Sidebar and its gadgets. Both items can be controlled independently or together using its command-line options.

The download zip file contains both the executable program and a "read-me" file that explains the various options.

The download is here - CleanDesktopV1.1.Zip


Enjoy!


Mark
« Last Edit: May 25, 2010, 05:36 AM by Markham »

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Thank you for making this available!

FWIW, on my XP SP3 32-bit:
 -HideIcons and -ShowIcons work but -ToggleIcons has no effect.
 -HideAll and -ShowAll work but -ToggleAll has no effect.


Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,646
    • View Profile
    • Donate to Member
Thank you for making this available!

FWIW, on my XP SP3 32-bit:
 -HideIcons and -ShowIcons work but -ToggleIcons has no effect.
 -HideAll and -ShowAll work but -ToggleAll has no effect.


-cranioscopical (May 23, 2010, 07:28 AM)
I can confirm said (XP SP3) behavior here also.

Markham

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 404
    • View Profile
    • Circle Dock
    • Donate to Member
Thank you for making this available!

FWIW, on my XP SP3 32-bit:
 -HideIcons and -ShowIcons work but -ToggleIcons has no effect.
 -HideAll and -ShowAll work but -ToggleAll has no effect.


-cranioscopical (May 23, 2010, 07:28 AM)

Unfortunately I don't have access to PC with XP loaded right now - but will have in ten days' time when I'm back in the UK for a few weeks.

The problem with XP is that the Desktop Icons are contained within a child window of a hidden window. This means that IsWindowVisible() will always return false because even if the child window is visible, the function returns false because its parent is hidden. If a parent window is itself hidden, you can not determine whether any of its child windows are visible or hidden.



Mark


Mark
« Last Edit: May 23, 2010, 01:48 PM by Markham »

sgtevmckay

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 838
  • Magis Esse
    • View Profile
    • Rainmeter
    • Read more about this member.
    • Donate to Member
The entire concept that  drove me to request this little addition was developed from a seriously outdated software.
More info here:
http://www.howtogeek.com/howto/windows-vista/create-a-shortcut-or-hotkey-to-turn-the-desktop-icons-on-or-off/

In windows XP, and earlier, it worked like a champ. In Vista was hit and miss, and in Windows 7 would work reliably, IF you did not run any of Windows Desktop changer programs for the background :(
There is also the issue that Windows and the way it handles Hiding desktop Icons changed between XP, Vista and 7

This was the answer to this problem, as Markham's tool in Circle Dock proved not to screw things up in Windows 7, or rather was properly compatible.

I also intend to use this a s Promo tool for Circle Dock in as much:
"You like this try the whole package"

But there has also been a call for a stable, small, and compatible program for some time.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
The problem with XP is that the Desktop Icons are contained within a child window of a hidden window.
Thanks for the reply and explanation.
My comment was not intended as a complaint, merely a report.

sgtevmckay

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 838
  • Magis Esse
    • View Profile
    • Rainmeter
    • Read more about this member.
    • Donate to Member
The problem with XP is that the Desktop Icons are contained within a child window of a hidden window.
Thanks for the reply and explanation.
My comment was not intended as a complaint, merely a report.
-cranioscopical (May 23, 2010, 03:49 PM)

No no; you are fine  :Thmbsup:
We take in everything ;)
It is nice to have such a broad user platform so that things do not get missed.  :P

I was explaining that there was an original tool, and this is what drove me to requests a part-out from Circle Dock, as many folks would appreciate such an item, but has not been made available, reliable and stable for Vista and 7 users.

If you are running XP...I highly recommend the program listed in the tutorial in my previous post. I used it for years, but is getting frustrating in the Windows 7 environment  :Thmbsup:

Markham

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 404
    • View Profile
    • Circle Dock
    • Donate to Member
Thanks for the reply and explanation.
My comment was not intended as a complaint, merely a report.
-cranioscopical (May 23, 2010, 03:49 PM)

Chris,

Thank you for reporting it - which made me go back, look at the problem more carefully and make changes to the program's documentation.

Under XP, Desktop Icons are painted in a (n unnamed) child window whose parent is "Program Manager". For experimental purposes, I've recoded the "-ToggleIcons" code for XP to briefly show the parent window long enough to determine if its child is visible or hidden.

Perhaps you'd care to test it? :)


Mark



« Last Edit: May 24, 2010, 01:24 AM by Markham »

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Chris,

Thank you for reporting it - which made me go back, look at the problem more carefully and make changes to the program's documentation.

Under XP, Desktop Icons are painted in a (n unnamed) child window whose parent is "Program Manager". For experimental purposes, I've recoded the "-ToggleIcons" code for XP to briefly show the parent window long enough to determine if its child is visible or hidden.

Perhaps you'd care to test it? :)
Thanks for taking the trouble, Mark!

The -show / -hide options work fine.
The -toggle options work fine to hide the icons but not to make them visible again.
In order to make the toggled-off icons visible, I have to kill off explorer.exe and launch another instance of it.
With icons toggled off, reissuing "cleandesktop -toggleicons" does make the parent visible for an instant.

Sorry to be an inadvertent troublemaker, usually it's deliberate on my part   ;)

Markham

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 404
    • View Profile
    • Circle Dock
    • Donate to Member
Okay, let's try this approach ...

Oh and I'm used to troublemakers - ask the Sarge!  ;D

« Last Edit: May 25, 2010, 05:35 AM by Markham »

sgtevmckay

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 838
  • Magis Esse
    • View Profile
    • Rainmeter
    • Read more about this member.
    • Donate to Member
Heeeeeeeeeyyyyyyyy  :-[
I resemble that remark  :Thmbsup:

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Okay, let's try this approach ...

Oh and I'm used to troublemakers - ask the Sarge!  ;D
;D
Is that the guy with the really, really small signature line?  :P


Nothing like doing this blind, eh?
-hide / -show working fine
-toggle not working at all

karmat

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
I'm on Windows7/64bit and just downloaded it. In right-click I enabled the 'Show Desktop Icons and Gadgets'.

Extracted the exe file to my Downloads folder. Clicked on it but only get a DOS-like window for a 1/2 second before it disappears and nothing else happens.

What am I doing wrong? I'd love to be able to use this, it sounds perfect!

Markham

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 404
    • View Profile
    • Circle Dock
    • Donate to Member
Did you read the text file that was also in the ZIP you downloaded?



Mark

karmat

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Did you read the text file that was also in the ZIP you downloaded?

Mark

Yeah, I read it, just read it again, but I don't see any instruction that I can use. I'm not usually empty-headed but I can't see what I'm missing?

parkint

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 119
  • It's bad luck to be superstitious
    • View Profile
    • Donate to Member

Unfortunately I don't have access to PC with XP loaded right now - but will have in ten days' time when I'm back in the UK for a few weeks.

Mark

May I suggest using VirtualBox to build an XP machine (image) for testing.  As a matter of fact, you can build multiple versions (SP1, SP2, etc) and use the same license!!

sgtevmckay

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 838
  • Magis Esse
    • View Profile
    • Rainmeter
    • Read more about this member.
    • Donate to Member
Did you read the text file that was also in the ZIP you downloaded?

Mark

Yeah, I read it, just read it again, but I don't see any instruction that I can use. I'm not usually empty-headed but I can't see what I'm missing?

Greeting Karmat
Welcome to DonationCoder.com and Circle Dock's little corner of it all.

You are not missing anything, it is a matter of Command Line entries in Shortcuts.
I must apologize for us old timers as we grew up in a command line world and have a bit of knowledge around it.
Therefore I will have to come up with a tutorial on how to implement this, but not today, as I have 3 doctors appointments later this afternoon.

That being said; I will try and give you the jist of what you will want to know.
The secret is in ADDING the additions in the help file to the shortcut  ;)

You can go ahead and place the exe file and the help file wherever is convenient.
You can do this because, we are going to make a shortcut that directs to this. In my case I created a CleanDesktop Folder and placed it in my Program Files (Alternative) folder (which I also created to install programs and avoid the UAC B.S., among other things, when necessary; which is not necessary here ;).

Noe I am doing this from a Windows 7 perspective, so bare with me  :P

Create your short cut that paths to the ClenDesktop.exe
Name your Shortcut whatever you like (I named mine Clean Desktop )
Now once that shortcut is created, right click on it and open properties.
Then to go the Shortcut tab.

In here we are concerned wit the TARGET path.
May look similar to the following:
"C:\Program Files (Alternative)\Clean Desktop\CleanDesktop.exe"

Now we know what commands are available to us, because they are in the help file ;)
as below"

Usage:-
------

DesktopCleaner -option

Where '-option' is one of the following:-

-HideIcons   )
-ShowIcons   ) To hide, show or toggle Desktop Icons' visibility
-ToggleIcons *   )

-HideSidebar *   )
-ShowSidebar *   ) To hide, show or toggle the Sidebar Gadgets visibility
-ToggleSidebar *)

-HideAll   )
-ShowAll   ) To hide, show or toggle both items' visibility
-ToggleAll *    )

An asterisk following a parameter (eg -ToggleIcons) indicates that this command is
not available under Windows XP.

In the following instance I am going to use a toggle command line

For native windows Command lines in Shortcut instances, we need to add the addtional command to the end of the path that the shortcut has already established  8)

So take take our path:
"C:\Program Files (Alternative)\Clean Desktop\CleanDesktop.exe"

and we will add the following to the path
-ToggleIcons

In order to add the command line properly to the path, there must be a space between the quotation mark (") at the end of the path and where the Command line begins.

Ultimately your Target code in your shortcut will have the path and the Command line all as one long code string which will look like the following:
"C:\Program Files (Alternative)\Clean Desktop\CleanDesktop.exe" -ToggleIcons

In the shortcut properties it will look similar to the following:

Screenshot - 5_24_2010 , 3_00_32 PM.png

To avoid getting teh DOS screen from popping up, in teh properties window you are in, simply change the "Run" from "Normal Window" to "Minimized". This will prevent that annoying DOS window from popping up in teh middle of what ever you are doing and keep the function in teh task bar so you do not see it  ;)

Then click "OK" and you are done.

This shortcut can then be added to a Quick Launch bar or in seven can be "Pinned" to the Task Bar.
Even though Circle Dock has this function built in, it can also be added to Circle Dock, or any other App Launcher.
After all; it is only just a shortcut  ;)

I hope this helps folks, and I will take the time to make a full tutorial in the next few days, when I can get an opportunity between the Doctors appointments and a new contract.

But for now; Have Fun  :Thmbsup:

karmat

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Hey Sarge, thanks for the tutorial! I would not have known how to do that on my own :huh:, but it worked perfectly!!! I placed the shortcut on my taskbar, easily accessed now. Thanks again! :)

And thanks Mark for coming up with this, appreciate it! :Thmbsup:

sgtevmckay

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 838
  • Magis Esse
    • View Profile
    • Rainmeter
    • Read more about this member.
    • Donate to Member
I am so glad that it has worked out for you

I will get something a little better going in teh next few days, in the way of a full tutorial

Markham

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 404
    • View Profile
    • Circle Dock
    • Donate to Member
Is that the guy with the really, really small signature line?  :P
-cranioscopical (May 24, 2010, 08:03 AM)
Yup, that is he. As he's in charge around here, you'd think he'd have a signature that makes a bold and impressive statement, wouldn't you?   :-\

Nothing like doing this blind, eh?
Ah you've noticed I'm using VB, then, Visual Braille!

-toggle not working at all
Now that's very strange because I'm using the same algorithm that someone developed for AutoIt which apparently does work. Oh well, back to the drawing board ...



Mark

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,646
    • View Profile
    • Donate to Member
[/url])[/i]
To avoid getting teh DOS screen from popping up, in teh properties window you are in, simply change the "Run" from "Normal Window" to "Minimized". This will prevent that annoying DOS window from popping up in teh middle of what ever you are doing and keep the function in teh task bar so you do not see it

Just out of curiosity (not trying to be difficult, but...) if the command window is an issue, being that there's no requirement for console output, why compile the app as a CLI? A standard (WinMain) application can still be used from a command prompt, yet doesn't require (or load) one.

Just a thought.

Markham

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 404
    • View Profile
    • Circle Dock
    • Donate to Member
CLI applications are the preserve of C++, I believe, and CleanDesktop is written in C#.

Just to screw the Sarge's Tutorial  :P, I've altered it so that there's no ugly "Dos Box" (which displayed the command-line parameters if there were none) but it will provide help in the absence of any valid command-line parameters.



Mark

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,646
    • View Profile
    • Donate to Member
Cool thanks,

It's tempting to explore adding the same functionality to T-Clock - But I'm afraid I'd end up looking like a schmuck if I did.