- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page