Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Erased window contents

Harry_A_
Beginner
560 Views
In ordinary operation. if you drag one window across another, the moving window should not erase the contents of the stationary window's client area. However, when I create a window with Intel Fortran (in a Fortran Windows Application, with a WinMain, an event loop, a command processor, etc.), any external window that I drag across itreminds me of the eraser in MS Paint --it erases everything it touchesin the client are of my window. (My app contains code that restores the client area's contentsas soon asthe userleft-clicks on it, but ideally a window should not behave this way.)If necessary, I can submit some code, but for now I am asking whether anyone else has had this problem and can give a hint at what is wrong. Is it likely to be something in the parameters that created the window, or is it more likely to be something in, or missing from,the window's command processor?
0 Kudos
1 Solution
Paul_Curtis
Valued Contributor I
560 Views
The proc function for your window needs to process WM_PAINT messages, whether generated within your own program or by the opsys, and to completely repaint your window via code linked to WM_PAINT. The opsys automatically keeps track of screen window overlaps, and sends WM_PAINT messages to all windows as needed whenever the visual overlap changes, but it is the responsibility of each window to repaint itself on demand. The eraserlike behavior simply indicates that your window is not processing WM_PAINT.

View solution in original post

0 Kudos
2 Replies
Paul_Curtis
Valued Contributor I
561 Views
The proc function for your window needs to process WM_PAINT messages, whether generated within your own program or by the opsys, and to completely repaint your window via code linked to WM_PAINT. The opsys automatically keeps track of screen window overlaps, and sends WM_PAINT messages to all windows as needed whenever the visual overlap changes, but it is the responsibility of each window to repaint itself on demand. The eraserlike behavior simply indicates that your window is not processing WM_PAINT.

0 Kudos
Harry_A_
Beginner
560 Views
WM_PAINT is the answer, along with the proper use of BitBlt to update the window's client area quickly and with a minimum of flicker. Thanks for the tip!
0 Kudos
Reply