Link to home
Start Free TrialLog in
Avatar of a_pravarakhya
a_pravarakhya

asked on

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    
ASKER CERTIFIED SOLUTION
Avatar of xLs
xLs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ghimireniraj
ghimireniraj

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
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.