473,504 Members | 13,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[C#] Hide desktop icons?

5 New Member
How can I hide the icons on my desktop? I've used the code below, but the problem is that it totally disables the desktop (no rightclick-menu, etc).
Expand|Select|Wrap|Line Numbers
  1. [DllImport("user32.dll")]
  2. static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
  3. [DllImport("user32.dll", SetLastError = true)]
  4. static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
  5. void ShowDesktopIcons(bool show)
  6. {
  7.     IntPtr hWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null);
  8.     if (show)
  9.        ShowWindow(hWnd, 5);
  10.     else
  11.        ShowWindow(hWnd, 0);
  12. }
  13.  
Thanks in advance :)
Aug 8 '08 #1
1 7558
joedeene
583 Contributor
how about taking a look at this tutorial

http://www.devx.com/vb2themax/Tip/18313
Aug 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3647
by: Tinus | last post by:
Hello all, I was wondering.... Is there a way to hide/unhide the Desktop Icons in C#? I've googled the net for it but couldn't find anything usefull :-( ANd if it is possiple, could someone...
4
4370
by: Blaine | last post by:
Does anyone know how I can hide a form from the TaskManager? I've set the ShowInTaskbar to False, but when using Alt-TAB to switch between applications, it appears as a blank icon. I can set it...
1
4467
by: Henrik | last post by:
I'm sorry to trouble you once again but somebody must know how to get a list of the desktop icons and their respective positions. I know that I have to look into shell but I have no idea how to...
0
4200
by: AvecFromage | last post by:
Hi, I'd like to be able to read the positions of all the Icons on my WinXP desktop. I've had a look around to see how to do it and I've come up with the code below...but it doesn't work. :o( ...
1
2276
by: mimenko | last post by:
Hello, I'd want to show and hide the same icons (pictures) on a web page that contains several icons. Some are identical, some are different (for ex : 3 items "A", 4 items "B", 2 items "C"). Is...
5
1864
by: GH | last post by:
Is it possible to display images on the desktop itself, like the bacground but not as a background? And not as icons either. Anything you put in the \Desktop folder shows up as an icon on the...
4
1422
by: O | last post by:
My files I have on my desktop have disappeared from the desktop. The strange thing is that when I go on my computer they appear to be under desktop, and i Can access from there. but there not in...
0
885
by: suvarnask1 | last post by:
WIndows 2000-Desktop icons not Displaying After Booting process One msg "Userenv.dll is missing" after click on that not display the desktop icons and cant do anything on the system.
0
987
by: =?Utf-8?B?QW5kcmV3?= | last post by:
I have a form in vs 2005 that does not move. Is there a way to have the form under the icons above the desktop? If so would it be possible to have that form at time that I want to move it, pop...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.