by F2 (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating:
(3 Votes)
Refresh / Redraw / Repaint the users desktop. Used when you have changed something on the desktop and you want the user to see it :) - Comments and Rates will be appreciated.
Inputs
Nothing.
Code Returns
Nothing.
Side Effects
Nothing.
API DeclarationsPrivate Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" (ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Const WM_KEYDOWN = &H100
Public Sub RefreshDesktop()
Dim DeskWin As Long
DeskWin = FindWindowEx(0&, 0&, "Progman", vbNullString)
DeskWin = FindWindowEx(DeskWin, 0&, "SHELLDLL_DefView", vbNullString)
DeskWin = FindWindowEx(DeskWin, 0&, "SysListView32", vbNullString)
PostMessage DeskWin, WM_KEYDOWN, &H74, &H3F0001
End Sub