Hi,
This is my first message on this forum. so greetings to all of you.
Below the function i am facing problems with. i call this function with a checkbox. when the window is created the information displayed on it appears fine but another window is overlapped on it the contents of the overlapped part of the window disappears. i know i should put this in onpaint() method but is there any other smarter way to keep the contents of the window as they are. i am sure there must be, because if you can create a window like this (shown below) there must be a way to keep its contents too. even when i minimize the new window created and then reopen it the contents of the window disappear. i know what the problem is - i.e. i need to repaint it. i am looking for a smart way to tell the windows to retain the contents of the newely created window inside the function specified below (a self contained function). plz help!!! thank you
void showMatchedFingers(tPointXY *showFing, int num_point){ //for display of query
int size=5,p;
CFrameWnd *pCreateWind = new CFrameWnd;
pCreateWind->Create(NULL, "Template", WS_OVERLAPPEDWINDOW,CRect(5,170,540,540) );
pCreateWind->ShowWindow(1);
CPaintDC dc(pCreateWind);
for(p=0;p<num_point;p++){
CPoint point;
point.x = (showFing+p)->x; point.y=(showFing+p)->y;
CBrush brush(RGB(0,255,255));
CBrush *pOldBrush = dc.SelectObject(&brush);
dc.Ellipse(point.x-size/2,point.y-size/2,point.x+size/2,point.y+size/2);
dc.SelectObject(pOldBrush);
}//number of query points
}
This is my first message on this forum. so greetings to all of you.
Below the function i am facing problems with. i call this function with a checkbox. when the window is created the information displayed on it appears fine but another window is overlapped on it the contents of the overlapped part of the window disappears. i know i should put this in onpaint() method but is there any other smarter way to keep the contents of the window as they are. i am sure there must be, because if you can create a window like this (shown below) there must be a way to keep its contents too. even when i minimize the new window created and then reopen it the contents of the window disappear. i know what the problem is - i.e. i need to repaint it. i am looking for a smart way to tell the windows to retain the contents of the newely created window inside the function specified below (a self contained function). plz help!!! thank you
void showMatchedFingers(tPointXY *showFing, int num_point){ //for display of query
int size=5,p;
CFrameWnd *pCreateWind = new CFrameWnd;
pCreateWind->Create(NULL, "Template", WS_OVERLAPPEDWINDOW,CRect(5,170,540,540) );
pCreateWind->ShowWindow(1);
CPaintDC dc(pCreateWind);
for(p=0;p<num_point;p++){
CPoint point;
point.x = (showFing+p)->x; point.y=(showFing+p)->y;
CBrush brush(RGB(0,255,255));
CBrush *pOldBrush = dc.SelectObject(&brush);
dc.Ellipse(point.x-size/2,point.y-size/2,point.x+size/2,point.y+size/2);
dc.SelectObject(pOldBrush);
}//number of query points
}