I am writing some code to acquire data through a port and plot it on screen in real time, more or less. I am trying to keep the amount of code to a minimum for performance. In my OnDraw function I separate the axes, gridlines, and labels from the code that plots the data so that the more permanent features are not regenerated every time. I use a boolean flag to indicate when these features are to be redrawn.
A problem arises when I move a window over another view. The background is redrawn when I reveal the window again, but none of my graphics, because the flag has not been set high to indicate that they should be redrawn. So I am trying to set the flag in the handlers for the various windows events such as OnSize, OnMove, and OnShowwindow. The only one of these that works is the OnSize handler. So my graphics are regenerated when I resize a window, but not when I move it or when i minimize then restore it. Are there no WM_MOVE messages sent when I move a window?
More importantly, is my method appropriate, or should I be calculating a rectangle to invalidate for every data point that comes in. Or should I do both things?
I am giving away most of my points for some seemingly easy questions because I expect I will be following up a bit. I want an understanding of what is happening, for instance, when I slide a dialog box across my view and everything under the box is erased.