stop background erase

Dear friends,
    Iam working with VC++ 5.0/win95.Iam putting pixels in  client area of SDI
which cover whole of client area, continuosly in a THREAD.When a message box appears and I OK it, the area covered by the box is becoming white.
    i.e., background is erased.How can I stop this.Please help me and prove ur expertise once again.
ba-bye,
Prav    
LVL 3
a_pravarakhyaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
xLsConnect With a Mentor Commented:
You can override the OnEraseBkgnd to control the background yourself, if you dont want the base class to erase it, dont let it be called by comment out the // CWnd::OnEraseBkgnd(pDC);


/Thomas

0
 
ghimirenirajCommented:
Every time your a message Box appears
the application call the ON Draw function of the Framework.

So Make sure you draw that in the
On draw function function so that that
wevery time it erases something the background is not erased.
You may want to use the DOC?VIEW arch

You can solve this kinda prob in many ways

Niraj
0
 
barbixCommented:
Hi.

Well you can create a memory dc (class CDC).

From the thread paint directly to the memory dc.

In the OnPaint or OnDraw function you can draw the memory dc (bitblt function).

here is a little example :

The thread object :

CDC pDC; // a global object
pDC.CreateCompatiableDC(YourObject->GetDC()).

The Thread painting func :

pDC.SetPixel(...) , or any other painting function supported by the CDC class.

Your Object OnPaint or OnDraw Function :

CPaintDC dc(this)

dc.Bitblt(x,y,cx,cy,&pDC,x,y,SRCCOPY)


that would do the work.

Hope i've Helped.

     Eran.

0
All Courses

From novice to tech pro — start learning today.