• Advertisement
Sign in to follow this  

[.net] How can i inform my application any change in display?

This topic is 4472 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I want to make an application where i can inform my application all of the changes in the current display(whole screen) using C#. Any way to do it?

Share this post


Link to post
Share on other sites
Advertisement
Not easily.

The two approaches which are commonly used, is either polling the screen for changes (very, very expensive), or using Windows system hooks to monitor WM_PAINT messages (cheaper, but less reliable). VNC uses a combination of both.

The only other way would be to have some kind of hook in the display driver, which is nontrivial. This is how some remote control programs such as RAdmin work (I think).

Of course there may be a way to do it on Windows 2003 (Maybe XP) which utilises Terminal Server in some way, but that interface could be undocumented and subject to change.

Mark

Share this post


Link to post
Share on other sites
Polling means to get the current screen image and compare it with the previous stored image or any other way?
How can i capture WM_PAINT event in C# and why it is less reliable?
VNC uses combination of both how?

Share this post


Link to post
Share on other sites
I'm not sure I understand your question 100% but I'll give it a shot. If you've drawn or are drawing to your window and want it to refresh, one of the slower but easier ways of doing this is by:

1) first, adding or overriding the Form's OnPaint event (to add one: Form.Paint += New PaintEventHandler(Form_OnPaint))

2) next, just call the Form.Invalidate() method which will cause the Form to repaint itself (by calling Form_OnPaint). You can call Form.Invalidate() using a Timer's Tick event or you could just call it whenever you want to redraw.

Jason

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement