473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

refershing the desktop

Is there any way of refreshing the desktop using C#?
Nov 15 '05 #1
3 3302
Duncan,

You will have to make calls to the Win32 API to do this. However, it
should be simple. Basically, you will get the handle to the desktop window
with GetDesktopWindow. Once you have that, you pass that to the
InvalidateRgn API function, to tell the desktop to repaint itself, or a
section of itself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Duncan Winn" <te**@test1.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Is there any way of refreshing the desktop using C#?

Nov 15 '05 #2
Thanks....
You will have to make calls to the Win32 API to do this.
..... but I have no idea how to do this or where to start, any pointers????
Basically, you will get the handle to the desktop window
with GetDesktopWindow. Once you have that, you pass that to the
InvalidateRgn API function, to tell the desktop to repaint itself, or a
section of itself.

Nov 15 '05 #3
Declare this class somewhere

public class Win32API
{
[System.Runtime.InteropServices.DllImport("user32.d ll")]
public extern static IntPtr GetDesktopWindow();

[System.Runtime.InteropServices.DllImport("user32.d ll")]
public extern static bool UpdateWindow(IntPtr wnd);

public static void UpdateDesktop()
{
UpdateWindow(GetDesktopWindow());
}
}

and call Win32API.UpdateDesktop( )

-vJ
"Duncan Winn" <te**@test1.co.uk> wrote in message
news:O0**************@TK2MSFTNGP09.phx.gbl...
Thanks....
You will have to make calls to the Win32 API to do this.
.... but I have no idea how to do this or where to start, any

pointers????
Basically, you will get the handle to the desktop window
with GetDesktopWindow. Once you have that, you pass that to the
InvalidateRgn API function, to tell the desktop to repaint itself, or a
section of itself.


Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
3
by: Elp | last post by:
Hi, I have developped a Windows applcation (in C#) that allows, among other things, users to view and control the desktop of a remote Windows XP Pro machine. I have actually simply embedded the...
5
by: TerryWilson | last post by:
I am developing a web based service tool using asp.net that we will distribute with our product. This service tool will be used for remotely configuring the product, problem determination, etc. ...
1
by: suneet.taparia | last post by:
Hi, Can anyone help me in finding a method or some url by which I can transfer the data from one page to another page using javascript method without refershing the page. If anyone can help...
2
by: John Brock | last post by:
At work we are using a virtual desktop manager called AltDesk (http://www.astonshell.com/), and it is causing a weird and extremely annoying problem with the VB.NET application I am developing. ...
15
by: Mephisto187 | last post by:
How can I find the currently visible desktop? By calling EnumWindowStations and EnumDesktops I get a list of all available desktops. But is there a way to figure out which one of them is currently...
0
by: Mark Henry | last post by:
I wrote a Desktop class for manipulating desktops and window stations. The class is being used by a service for starting applications on the interactive desktop (the service cannot run as Local...
5
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...
1
by: Damjan Malis | last post by:
Hi guys... could anyone please help me with my problem getting mouse cursor position while desktop being locked (WIN + L). MSDN says: "The input desktop must be the current desktop when you...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.