473,404 Members | 2,187 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,404 software developers and data experts.

refresh the screen

Hi,

I want to refresh all the screen (including the desktop) or a part of the
screen.
I can have a reference to the screen with win32 API :

[DllImport("user32")]
public static extern int GetWindowDC(IntPtr hwnd);

private void fct(){
Graphics g = Graphics.FromHdc(new IntPtr(GetWindowDC(IntPtr.Zero)));
}

But I don't know how to refresh the screen or a part of the screen

Thanks to help me

Serge

Nov 15 '05 #1
3 14791

If memory serves you should be able to import
InvalidateRect(HWND, NULL, TRUE). Sending null as the
second parameter invalidates the entire window and true
forces a re-paint. Another possible way might be to
import and use UpdateWindow(HWND) which does the same
thing. I have never tried to use these on the entire
desktop, but it seem that they should work.
Nov 15 '05 #2
I don't have much experience with display manipulation, so bare with me.

I would think that the OS would send the appropriate invalidate commands to
the different applications. Also, you may not get an update immediately
anyway since the message is queued by the application and if it is
performance some intensive processing, the message loop may not be called.

I guess the question is, why would you want to update the entire screen?

"ppyrstr" <po**********@hotmail.com> wrote in message
news:05****************************@phx.gbl...

If memory serves you should be able to import
InvalidateRect(HWND, NULL, TRUE). Sending null as the
second parameter invalidates the entire window and true
forces a re-paint. Another possible way might be to
import and use UpdateWindow(HWND) which does the same
thing. I have never tried to use these on the entire
desktop, but it seem that they should work.

Nov 15 '05 #3

Hi serge,

You can do something like this:
[DllImport("user32.dll")]
public static extern bool InvalidateRect(IntPtr hwnd,IntPtr lpRect,bool
bErase);

private void button1_Click(object sender, System.EventArgs e)
{
InvalidateRect(IntPtr.Zero ,IntPtr.Zero ,true);
}

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "serge anton" <se*********@takoma.fr>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Subject: refresh the screen
| Date: Fri, 12 Sep 2003 23:40:55 +0200
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Lines: 21
| Message-ID: <3f**********************@nan-newsreader-02.noos.net>
| Organization: Noos
| NNTP-Posting-Date: 12 Sep 2003 21:40:57 GMT
| NNTP-Posting-Host: 81.64.121.30
| X-Trace: 1063402857 news.noos.fr 7514 81.64.121.30
| X-Complaints-To: ab***@noos.fr
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!newsfeed.icl.net!newsfeed.fjserv.net!news.tel e.dk!news.tele.dk!small.ne
ws.tele.dk!oleane.net!oleane!teaser.fr!noos.fr!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:184541
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I want to refresh all the screen (including the desktop) or a part of the
| screen.
| I can have a reference to the screen with win32 API :
|
| [DllImport("user32")]
| public static extern int GetWindowDC(IntPtr hwnd);
|
| private void fct(){
| Graphics g = Graphics.FromHdc(new IntPtr(GetWindowDC(IntPtr.Zero)));
| }
|
| But I don't know how to refresh the screen or a part of the screen
|
| Thanks to help me
|
| Serge
|
|
|
|

Nov 15 '05 #4

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

Similar topics

9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
6
by: Logger | last post by:
Help, Want someone's option. I'm calling a popup screen, say form B, to add/edit a record. In, say form A, I call form B using javascript window.open in server side code. I need to know when I...
3
by: John Baker | last post by:
Hi: As in the "Wizard of Oz", I want people to "pay no attention to the man behind the curtain", by freezing the screen while a whole lot of things happen. I know about ECHO OFF, but this...
3
by: Wei | last post by:
Hi, I have a page written in ASP.net c# witch has a datalist with 200 records (in Itemtemplate). Each record includes nine webcontrol radio buttons as a group. The user will need to check...
2
by: J | last post by:
Hi, all I have a simple question but have no clue how to do this: I have a datagrid in a web form which presents each user's info, after admin selected a user, then click 'delete' button, that...
0
by: Casey Bralla | last post by:
For some reason, I can't get curses to refresh the screen. Can someone offer a suggestion to try to debug this? Here is my python code snippet: stdscr=curses.initscr() curses.noecho()...
0
by: Casey Bralla | last post by:
My problem was caused by a getch() function which paused, waiting for the character. Live and learn. <sigh> For some reason, I can't get curses to refresh the screen. Can someone offer a...
2
by: Lonifasiko | last post by:
My ASP.NET application's main page should change values on screen when some extern event occurs (a change in the state of a machine monitored by a .NET Remoting object). That is, this .NET Remoting...
7
by: Kevin Wilcox | last post by:
Hi I'm trying to emulate, within access, the gantt chart timeline / task planner aspects of ms project. Creating the chart on the form has been easy enough; I use a series of unbound text boxes in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.