Windows Menus & OpenGL Window
-
Hello All I am using MFC with OpenGL to code multimedia application, I am using SDI architecture, and I found that when I open any menu item and select it, windows sometimes don’t erase the menu area immediately, and it appears like a shadow over the OpenGL window, until I do any repaint action it disappears It seems to me that it is windows issue, but I am not sure!
-
Hello All I am using MFC with OpenGL to code multimedia application, I am using SDI architecture, and I found that when I open any menu item and select it, windows sometimes don’t erase the menu area immediately, and it appears like a shadow over the OpenGL window, until I do any repaint action it disappears It seems to me that it is windows issue, but I am not sure!
A-M-S-S wrote:
It seems to me that it is windows issue
I would say the opposite ;P . Whenever windows need to refresh a window (like for example in your case because something went in front of it), it will send a WM_PAINT message to it. So it is up to you to repaint the window whenever you receive that message.
Cédric Moonen Software developer
Charting control [v1.2] -
A-M-S-S wrote:
It seems to me that it is windows issue
I would say the opposite ;P . Whenever windows need to refresh a window (like for example in your case because something went in front of it), it will send a WM_PAINT message to it. So it is up to you to repaint the window whenever you receive that message.
Cédric Moonen Software developer
Charting control [v1.2]The action that done with my menu item is to set some flags and variables then call InvalidateRect(NULL,FALSE); To repaint the entire client area, so the menu drawing area should disappear, and this the normal situation that happen in any windows application -the menu disappear, if you just click outside it-
-
The action that done with my menu item is to set some flags and variables then call InvalidateRect(NULL,FALSE); To repaint the entire client area, so the menu drawing area should disappear, and this the normal situation that happen in any windows application -the menu disappear, if you just click outside it-
A-M-S-S wrote:
The action that done with my menu item is to set some flags and variables then call InvalidateRect(NULL,FALSE);
InvalidateRect will simply have as an result to send a WM_PAINT message to your window. If you don't handle that message or you don't repaint your window correctly, then it's logical that the menu doesn't disappear.
A-M-S-S wrote:
To repaint the entire client area, so the menu drawing area should disappear, and this the normal situation that happen in any windows application -the menu disappear, if you just click outside it-
Sorry, I don't understand what you are trying to say :confused:. What you call a normal situation (the menu "just"disappear when you click outside it) is simply because that window reacts on the WM_PAINT message and repaints itself. What you have to understand is that Windows doesn't keep the 'image' of your window. So it means that if something is drawn over it (like with the menu), there is no way to recreate the image unless it asks the window to repaint itself.
Cédric Moonen Software developer
Charting control [v1.2] -
A-M-S-S wrote:
The action that done with my menu item is to set some flags and variables then call InvalidateRect(NULL,FALSE);
InvalidateRect will simply have as an result to send a WM_PAINT message to your window. If you don't handle that message or you don't repaint your window correctly, then it's logical that the menu doesn't disappear.
A-M-S-S wrote:
To repaint the entire client area, so the menu drawing area should disappear, and this the normal situation that happen in any windows application -the menu disappear, if you just click outside it-
Sorry, I don't understand what you are trying to say :confused:. What you call a normal situation (the menu "just"disappear when you click outside it) is simply because that window reacts on the WM_PAINT message and repaints itself. What you have to understand is that Windows doesn't keep the 'image' of your window. So it means that if something is drawn over it (like with the menu), there is no way to recreate the image unless it asks the window to repaint itself.
Cédric Moonen Software developer
Charting control [v1.2]For sure I am doing handling for my paint message, this is where I am call my OpenGL render function and I didn't do any thing else, So every thing should be ok And as I told before, this phenomena doesn’t appear every time I open the menu I was trying to send a screen shot of what I got If you are interested write your mail in a private message and I will send you the screenshot
-
For sure I am doing handling for my paint message, this is where I am call my OpenGL render function and I didn't do any thing else, So every thing should be ok And as I told before, this phenomena doesn’t appear every time I open the menu I was trying to send a screen shot of what I got If you are interested write your mail in a private message and I will send you the screenshot
A snippet of code would be more usefull I think. Could you post what you do on the WM_PAINT message ?
Cédric Moonen Software developer
Charting control [v1.2] -
A snippet of code would be more usefull I think. Could you post what you do on the WM_PAINT message ?
Cédric Moonen Software developer
Charting control [v1.2]