Results 1 to 7 of 7

Thread: Repaint screen?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    Repaint screen?

    After painting to the screen's dc, how do I tell the screen dc to repaint itself so that what ever I drew will disappear?

    I tried the following, but it doesn't work:

    SendMessage HWND_BROADCAST, WM_PAINT, 0, 0

    Any help would be appreciated..

    Dan

    Visual Studio 2010

  2. #2
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148
    InvalidateRect will do it. You will need the hwnd of the desktop though.
    Dazzer

  3. #3
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148
    Try this code, I got it from ALLAPI.net, a very usefull website!
    Code:
    Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, lpRect As Long, ByVal bErase As Long) As Long
    
    ' This will repaint all windows and the desktop
    InvalidateRect 0&, 0&, False
    Dazzer

  4. #4
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314
    Thanks for the refresh code. Worked like a charm!
    Steve Stunning

  5. #5
    Member
    Join Date
    Oct 2003
    Posts
    45

    HI

    i think u can use the RedrawWindow API
    or UpdateWindow

  6. #6
    Frenzied Member ice_531's Avatar
    Join Date
    Aug 2002
    Location
    Sitting w/ Bob Status: -Next -To- Null- Friend: Philip
    Posts
    1,152
    YAY another response to a 2 year old post
    :::`DISCLAIMER`:::
    Do NOT take anything i have posted to be truthful in any way, shape or form.
    Thank You!

    --------------------------------
    "Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe
    "Finaly I can look as gay as I want..." - NoteMe
    Languages: VB6, BASIC, Java, C#. C++

  7. #7
    Member
    Join Date
    Oct 2003
    Posts
    45

    Loooooooooooooooool

    i did't saw the date of submition

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width