Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

Screen redraw

diskmon
Beginner
754 Views
I'm using a Win32 Visual Fortran program and drawing graphs to the window. However everytime I move the window or minize/maximize the inside of the window does not get redrawn. How can I handle this? Thanks.
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
754 Views
It's hard to tell without seeing the code.

Windows whose window class has CS_VREDRAW.OR.CS_HREDRAW styles automatically receive a WM_PAINT when the window is resized. However, even without these styles, WM_PAINT should be generated when the window is enlarged (because enlarging creates an invalid region).

InvalidateRect API invalidates a rectangle in window's client area and generates a WM_PAINT message, but I suspect you have a problem elsewhere -- could you post some code?

Jugoslav
0 Kudos
larkov
Beginner
754 Views
Diskmon,

I suppose You should process the WM_PAINT message for the window that needs to be redrawn. Inside this message handler, perform all your drawing work into device context supplied by Windows (integer hDC=wParam). Every time the window is being redrawn by system, your program will redraw the window contents.

If You want to redraw your graphics without moving/resizing/e.t.c. (for example, if your graph data has changed), use InvalidateRect() API function (it incapsulates the WM_PAINT message, so you don't need to send it).

Do not use WM_PAINT message to redraw window contents. The system will not draw something on your window until there are no any invalidated rectangles.

Good luck!
0 Kudos
Reply