You are able to hide the desktop icons on xp by right clicking on the desktop and choosing to hide them, but how would you do it through c++? I was messing around with DestroyWindow and ShowWindow, but I cant figure it out. Any help?

WinSpector is telling me that the class is #32768 and the window is 001802cc, but I dont really know how to make use of that.

What exactly do you mean by hide, as in minimize? if so then look at CloseWindow().

Otherwise you will need to explain more.


I apologize if i didnt explain well enough. If you right click on the desktop when using windows XP, you can choose an option to hide the desktop icons. I was wondering how i would do that through c++ instead of having to use the mouse and manually do it. I am using the term "hide" as a general term, nothing code related.

What you may consider instead, is killing the process "explorer.exe". Then do a findwindow and look for taskmanager... if you see task manager, send a wm_close message (so they can't just open task manager, and run explorer.exe again). With explorer.exe gone... they have access to nothing but taskman... just a thought.

That was my original idea comatose, but i couldnt figure out how to work the ExitProcess() function. I am still pretty new to programming, so i dont really understand yet how to properly handle the parameters. I would rather end explorer but dont know how. Could you elaborate for me, if you dont mind?

I've Attached Two Projects (I use Code::Blocks In Windows, gvim In *nix to write code). The projects are in code::blocks format, but you only need the .cpp files. Both of these are commented basically line for line (if not, at least each code block is). I think it will be a great way to learn... by taking snippets from projects and putting them in your project. If you run across issues with making the code work in your project, let me know, and we can work on making it work tailored to your need.

Wow, thank you very much. You are very helpful and i think i got this figured out thanks to your attached file. Respect =D

I've Attached Two Projects.

What are these irrelevant BS (killing the processes ??!!)
Just use standard win32 api to hide Desktop icons (1 line of code) !

lol... he wanted to kill explorer.exe... it shows him how to enumerate processes to filter out which ones are which.

Also, this is hardly irrelevant BS. I was asked by someone (a computer tech, who fixes computers for people with messed up windows machines [instead of reinstalling all the time]) to build this program, since it closes everything except what windows needs to operate (it closes all programs that windows doesn't require, leaving a clean system).

Anyway, the OP found it useful... so your opinion is moot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.