Erasing The Background

Posted on 2006-04-18
Last Modified: 2010-05-18
Hi EveryBody.

I'm writing a code to capture the stylus motion on the screen of the PDA, I'm drawing a window using a null brush because I want this window transparent window, this window has a rounded rectangle, the problem appears when I move the window the boundaries in the old position still appear, I want to erase these boundaries in the old position.

Can you help me in this problem?

Thank you.
Question by:MAnkeer
    LVL 9

    Expert Comment

    i think you will have to send redraw message to all visible windows other than yours.

    Author Comment

    How can I do that?
    LVL 9

    Accepted Solution

    here is how you get window handles:
    then you send a WM_PAINT message to all those windows using either SendMessage or PostMessage. note that SendMessage and PostMessage are part of unmanaged API and can't be called as easily from managed code. read on how to call funcs in unmanaged DLLs from managed code.
    LVL 9

    Expert Comment

    btw you only need to send messages to visible windows but it would take a lot of effort to detemine which windows need to be redrawn. just redraw all of them and if you don't have a picture that took forever to render the difference would be pretty much unnoticeable.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
    In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now