|
-
May 12th, 2001, 08:41 AM
#1
Thread Starter
Fanatic Member
Making the WebBrowser control show the desktop
How could i make the WebBrowser control show the desktop, including the background and My Computer, the Recycle Bin and Network Neighbourhood???
-
May 12th, 2001, 01:36 PM
#2
Just to let you know, the desktop is just a folder.
This will work:
Code:
WebBrowser1.Navigate "C:\Windows\Desktop"
-
May 13th, 2001, 03:18 PM
#3
PowerPoster
Matthew, wouldn't this code be better
Code:
Const CSIDL_DESKTOP = &H0
Const CSIDL_TEMPLATES = &H15
Const MAX_PATH = 260
Private Type EMID
cb As Long
abID As Byte
End Type
Private Type ITEMIDLIST
mkid As EMID
End Type
Private Declare Function ShellAbout Lib "shell32.dll" _
Alias "ShellAboutA" (ByVal hWnd As Long, ByVal szApp As String, _
ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
Private Declare Function SHGetSpecialFolderLocation Lib _
"shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl _
As ITEMIDLIST) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" _
Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As _
String) As Long
Dim strDesktopPath as string
Private Sub Form_Load()
strDesktopPath = GetSpecialfolder(CSIDL_DESKTOP)
WebBrowser1.Navigate2 strDesktopPath
End Sub
Private Function GetSpecialfolder(CSIDL As Long) As String
Dim r As Long
Dim IDL As ITEMIDLIST
'Get the special folder
r = SHGetSpecialFolderLocation(100, CSIDL, IDL)
If r = 0 Then
'Create a buffer
Path$ = Space$(512)
'Get the path from the IDList
r = SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal Path$)
'Remove the unnecessary chr$(0)'s
GetSpecialfolder = Left$(Path, InStr(Path, Chr$(0)) - 1)
Exit Function
End If
GetSpecialfolder = ""
End Function
Anyway, this will show you only the folders content. To show all the background picutre, you will have to take a snapshot of the desktop.
-
May 13th, 2001, 03:21 PM
#4
PowerPoster
-
May 13th, 2001, 05:03 PM
#5
-
May 13th, 2001, 09:54 PM
#6
PowerPoster
I don't think windows wuld allow this. Desktop is said to the parent window of all window in the system. So I don't think it will allow you to set itself as a child window
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
|