VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Refresh Desktop

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 Declarations
Private 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

Rate Refresh Desktop

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

Download this snippet    Add to My Saved Code

Refresh Desktop Comments

No comments have been posted about Refresh Desktop. Why not be the first to post a comment about Refresh Desktop.

Post your comment

Subject:
Message:
0/1000 characters