Disable full screen refresh

Edit 1: Actually, I only needed to avoid the flicker caused by closing a Word document and opening another. But now this approach does not seem possible.

Welcome, is it possible to prevent updating the entire screen (and not just the desktop)? The question is derived from this . I want my Word add-in to be blocked from updating the entire screen when I close a Word document and open another, and turn on the update again when I am done.

Idea:

  • Get an image of the entire screen (how?);
  • Show the topmost window to display the image on the screen taken in step 1 to cover the entire screen;
  • Do my work and close the topmost window when done.

Is it possible? Or do you have other ideas? Thanks!

+4
source share
2 answers

To prevent screen refresh:

SendMessage(GetDesktopWindow, WM_SETREDRAW, 0, 0); 

To re-enable screen updates:

 SendMessage(GetDesktopWindow, WM_SETREDRAW, 1, 0); 
0
source

not to do.

No application, plug-in, or other very nice piece of code can ever be so special as to invade - even for a short time - what the user has: his user interface.

The old new thing ( Raymond Chen ) has some very good posts in this, from LockWindowUpdate , to locking gadgets in place and other custom features .

Living in a multi-threaded world means that you should expect your user to do several things at once.

Blocking anything for purposes like โ€œto make it look beautifulโ€ - even for a very short period of time - is a complete no-no.

Your request is just the first step towards the dreaded system-modal dialog box "Are you sure you want to do this badly on your computer?" with Yes and No buttons, where Yes is the default button in which the user enters a long history by pressing the space bar.

- Jeroen

+7
source

Source: https://habr.com/ru/post/1337002/


All Articles