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

resize graphic windows

andriasoa
Beginner
415 Views
I would like to draw a curve and text in the MDI window. Its ok, but I have a problem during repetitive and continuous resizings of the MDI window by using edges or the corner. The drawing comes out of the client window.
I have the same problem during continuous moving of the MDI window.
I use the following instruction to redraw the MDI window :
case (WM_SIZE)
ret = InvalidateRect (hWnd, NULL_RECT, .TRUE.)
Please would you mind indicating me the instruction which enables to redraw only, when the left mouse button is up, after having exit the moving or sizing loop?
Moreover, please what is the instruction which disables the resize of MDI window, when the user drags the edge or corner window.
I use Compaq Visual FORTRAN 6.6.
Thank you for your help.
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
415 Views
It's difficult to tell offhand what went wrong. Actually, I think it's pretty tricky to get (re)painting right in a Win32 application -- not terribly difficult, but there is a lot of places where a wrong set of styles or wrong approach could make difference. I can offer just a general advice, in order of tries:
1) always use WS_CLIPCHILDREN style for everything -- doesn't hurt, and makes repainting work more logical
2) use WS_CLIPSIBLINGS for child windows -- same as 1)
3) Use double-buffering. Specify NULL for hbrBackground in window class.
4) Don't use both CS_VREDRAW.OR.CS_HREDRAW and WM_SIZE handling. Use one or another.
You can disable resize of MDI window by removing styles like WS_BORDER or WS_THICKFRAME from the window styles (you can use WS_EX_DLGFRAME instead if you dislike the crippled look). Also, handling WM_GETMINMAXINFO is another way to go.
Jugoslav
0 Kudos
Reply