'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)
'Add 2 Command Buttons To Your Form.
'When you press the first button, the desktop icons will disappeared.
'When you press the second button, the desktop icons will appear again.
'Insert the following code to the module :
Declare Function ShowWindow& Lib "user32" (ByVal hwnd&, ByVal nCmdShow&
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As String, ByVal lpWindowName As String) As Long
Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
'Insert the following code to your form:
Private Sub Command1_Click()
Dim hHandle As Long
hHandle = FindWindow("progman", vbNullString)
Call ShowWindow(hHandle, SW_HIDE)
End Sub
Private Sub Command2_Click()
Dim hHandle As Long
hHandle = FindWindow("progman", vbNullString)
Call ShowWindow(hHandle, SW_NORMAL)
End Sub
You can also look at the registry entry at:
HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper
and alter it to point at a different image. I think you're limited to bitmaps, and can't use JPEGs, but I'm not 100% sure on that -- Windows2000 may allow it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.