473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to use shell32.dll functions

I've referenced the shell32.dll but can't seen to use it.

Could someone give an example of using any function in it?

Something like:

Dim ShellQAs New Shell32.ShellClass

Dim shellFolder As Shell32.Folder =
ShellQ.NameSpace(Shell32.ShellSpecialFolderConstan ts.ssfDESKTOPDIRECTORY)

Thanks for any help
Nov 20 '05 #1
3 22154
" Just Me" <ne********@a-znet.com> schrieb:
I've referenced the shell32.dll but can't seen to use it.

Could someone give an example of using any function in it?

Something like:

Dim ShellQAs New Shell32.ShellClass

Dim shellFolder As Shell32.Folder =
ShellQ.NameSpace(Shell32.ShellSpecialFolderConstan ts.ssfDESKTOPDIRECTORY)


Do you get an error message? Are you sure the necessary namespaces are
imported? Did you have a look at the object model provided by the
"shell32.dll" component in object browser?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #2
single stepping
After Dim ShellQ As New Shell32.ShellClass (no error there)
If I do a quickwatch it says that ShellQ is not declared
Dim ShellQAs New Shell32.ShellClass
Dim shellFolder As Shell32.Folder =
ShellQ.NameSpace(Shell32.ShellSpecialFolderConstan ts.ssfDESKTOPDIRECTORY)
Do you get an error message?
No I can single step through the code
Are you sure the necessary namespaces are imported? I Imports Shell32 is that enough?

If, in the IDE I type Shell32. intellisense shows the options - including
ShellClass
Did you have a look at the object model provided by the
"shell32.dll" component in object browser?
yes, but what should I look for? ShellClass is there but it's grayed

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3
I don't think I'll need any help.
I copied the code and then stripped almost everything.
Ended with :

Option Strict Off

Option Explicit On

Imports Shell32

Public Class FolderExplorerControl
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''

Inherits System.Windows.Forms.UserControl

#Region "Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)

If Disposing Then

If Not components Is Nothing Then

components.Dispose()

End If

End If

MyBase.Dispose(Disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents tvFolders As System.Windows.Forms.TreeView

Private Sub InitializeComponent()

Me.tvFolders = New System.Windows.Forms.TreeView

Me.SuspendLayout()

'

'tvFolders

'

Me.tvFolders.ImageIndex = -1

Me.tvFolders.Location = New System.Drawing.Point(144, 128)

Me.tvFolders.Name = "tvFolders"

Me.tvFolders.SelectedImageIndex = -1

Me.tvFolders.Size = New System.Drawing.Size(568, 256)

Me.tvFolders.TabIndex = 0

'

'FolderExplorerControl

'

Me.Controls.Add(Me.tvFolders)

Me.Font = New System.Drawing.Font("Arial", 8.0!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
CType(0, Byte))

Me.Name = "FolderExplorerControl"

Me.Size = New System.Drawing.Size(856, 552)

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub FolderExplorerControl_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Added a reference to Shell32 by browsing to shell32.dll

Dim shell32q As Shell32.ShellClass = New Shell32.ShellClass

Dim shell32Folder As Shell32.Folder =
shell32q.NameSpace(Shell32.ShellSpecialFolderConst ants.ssfDESKTOPDIRECTORY)

Dim items As shell32.FolderItems = shell32Folder.Items()

Dim dfolder As Shell32.Folder =
shell32q.NameSpace(Shell32.ShellSpecialFolderConst ants.ssfDESKTOPDIRECTORY)

For Each fi As shell32.FolderItem In dfolder.ParentFolder.Items()

Dim Subnode2 As TreeNode = tvFolders.Nodes.Add(dfolder.Title)

Next

End Sub

End Class

which seems to work as expected.

I should be able to find out why the complete code doesn't work.

Thanks



" Just Me" <ne********@a-znet.com> wrote in message
news:uC**************@TK2MSFTNGP12.phx.gbl...
single stepping
After Dim ShellQ As New Shell32.ShellClass (no error there)
If I do a quickwatch it says that ShellQ is not declared
Dim ShellQAs New Shell32.ShellClass
Dim shellFolder As Shell32.Folder =
ShellQ.NameSpace(Shell32.ShellSpecialFolderConstan ts.ssfDESKTOPDIRECTORY)

Do you get an error message?


No I can single step through the code
Are you sure the necessary namespaces are imported?

I Imports Shell32 is that enough?

If, in the IDE I type Shell32. intellisense shows the options -

including ShellClass
Did you have a look at the object model provided by the
"shell32.dll" component in object browser?


yes, but what should I look for? ShellClass is there but it's grayed

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: emde | last post by:
Any tips on using the icons in shell32.dll as the image on a button in a form? Thanks.
2
by: Craig | last post by:
I've seen many examples of how to call SHGetFileInfo in shell32.dll to get a files associated icon, but I can't find anywhere how to get the file information (size, last date modified, etc, etc)...
0
by: Steve Mauldin | last post by:
I am trying to get from files the keywords saved as part of the properties under the summary tab. I am able to get the Title, and Comments using the following code but I need to get the keywords...
0
by: Steve Mauldin | last post by:
I am trying to get from files the keywords saved as part of the properties under the summary tab. I am able to get the Title, and Comments using the following code but I need to get the keywords...
1
by: Terry Olsen | last post by:
I'm working on a file copy component. I'd like to load the "file copy" animation from the shell32.dll and play it (in a picturebox?) while the file is copying. This guy did it here,...
4
by: Neo | last post by:
I am developing a GUI for a destop application in Visual C++ .Net 2005, I am trying to create toolbar exactlly same as windows explorer which will have default windows icons, which are in windows...
1
by: Zairay | last post by:
Hi All, I'm having a problem with the Shell32.dll when I try to open a program from my Access db. When I try to open a program called FalconViewLite from my access database I get an error in...
0
by: Eran.Yasso | last post by:
Hi all, The following code sets/disables network adpter's status. Since I have no idea where to put this code and I wish to share the community with it. I did rverse engineering from VBS to C#....
5
by: progvar | last post by:
Hi, i want to know how to unzip a zip file and extract the files to a particular location please help me thanks in advance varinder
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.