Crazy
Member
- Joined
- Oct 3, 2008
- Messages
- 5
- Programming Experience
- 1-3
I need to refresh windows explorer from within a form.
I've been searching on the internet without much luck.
So far I think I found that I need to broadcast a WM_WININICHANGE(&H1A).
This is the code I have so far, when I run RefreshExplorer it should refresh it:
I'd really appreciate any help, i'm getting desperate
I've been searching on the internet without much luck.
So far I think I found that I need to broadcast a WM_WININICHANGE(&H1A).
This is the code I have so far, when I run RefreshExplorer it should refresh it:
VB.NET:
Private Const WM_WININICHANGE = &H1A
Private Const HWND_BROADCAST = &HFFFF
Private Const SMTO_ABORTIFHUNG = &H2
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Object) As Long
Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" (ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As String, ByVal fuFlags As Long, ByVal uTimeout As Long, ByVal lpdwResult As Long) As Long
Private Sub RefreshExplorer()
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0)
SendMessageTimeout(HWND_BROADCAST, WM_WININICHANGE, 0, "Environment", SMTO_ABORTIFHUNG, 5000, New Long())
End Sub
I'd really appreciate any help, i'm getting desperate
Last edited: