|
-
May 10th, 2005, 10:37 AM
#1
Thread Starter
Addicted Member
Redrawing Desktop & All(Child) Windows
I'm trying to draw some graphics on the desktop, but have found that the title bar\non-client area of most windows remains "stamped" with the graphics when the window is moved. In addition, I just realized that I don't know how to clear the destop of the picture.
Thanx in advance.
Please, put a checkmark (  ) or the word [RESOLVED] in your topic title if it was resolved, and rate the person who resolved it.
-
May 10th, 2005, 03:08 PM
#2
Hyperactive Member
Re: Redrawing Desktop & All(Child) Windows
This is because the standard user interface libraries don't expect anything other than the client-area of a window to be changed, making it slightly more efficient to only redraw what is expected to change. Try using the RedrawWindow function, but for the hWnd value, use 0 (or GetDesktop).
RedrawWindow 0, ByVal 0, ByVal 0, RDW_INVALIDATE
I don't think it will work, but it's worth a shot.
-
May 10th, 2005, 03:17 PM
#3
Re: Redrawing Desktop & All(Child) Windows
Heres the full code: *Should work fine)
VB Code:
Private Const RDW_INVALIDATE = &H1 ' Invalidate and activate a paint event.
Private Const RDW_ALLCHILDREN = &H80 ' Send to all children.
' Above will only work if the form is the main one.
Private Declare Function RedrawWindow Lib "user32.dll" Alias "RedrawWindow" ( _
ByVal hWnd As Long, _
lprcUpdate As RECT, _
ByVal hrgnUpdate As Long, _
ByVal fuRedraw As Long) As Long
Dim lngFlags As Long
Dim lngReturn As Long
lngFlags = RDW_INVALIDATE + RDW_ALLCHILDREN ' The flags...
lngReturn = RedrawWindow(Me.hwnd, ByVal 0&, ByVal 0&, lngFlags)
If lngReturn <> 0 Then
' Function worked!
End If
Cheers,
RyanJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|