Important alert: (current site time 7/15/2013 8:48:26 AM EDT)
 

VB icon

_VB-WindowsFilePropertiesDialog_

Email
Submitted on: 10/1/2004 7:50:11 PM
By: adgfdghftetrthrthr 
Level: Intermediate
User Rating: By 4 Users
Compatibility: VB.NET
Views: 9413
 
     Shows the windows file properties dialog for a given file (or drive or directory).
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: _VB-WindowsFilePropertiesDialog_
// Description:Shows the windows file properties dialog for a given file (or drive or directory).
// By: adgfdghftetrthrthr
//
// Side Effects:hmm, it can only do single files/folders/drives?
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=2804&lngWId=10//for details.//**************************************

<System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)> Private Class SHELLEXECUTEINFO
Public cbSize As Integer
Public fMask As Integer
Public hwnd As Integer
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr), Microsoft.VisualBasic.VBFixedString(255)> Public lpVerb As String = ""
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr), Microsoft.VisualBasic.VBFixedString(255)> Public lpFile As String = ""
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr), Microsoft.VisualBasic.VBFixedString(255)> Public lpParameters As String = ""
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr), Microsoft.VisualBasic.VBFixedString(255)> Public lpDirectory As String = ""
Public nShow As Integer
Public hInstApp As Integer
Public lpIDList As Integer
Public lpClass As String
Public hkeyClass As Integer
Public dwHotKey As Integer
Public hIcon As Integer
Public hProcess As Integer
End Class
Private Const SW_SHOW As Integer = 5
Private Const SEE_MASK_INVOKEIDLIST As Integer = &HC
Private Declare Auto Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" (ByVal SEI As SHELLEXECUTEINFO) As Integer
Public Shared Sub ShowPropertiesDialog(ByVal Path As String)
If System.IO.File.Exists(Path) Or System.IO.Directory.Exists(Path) Then
Dim shInfo As New SHELLEXECUTEINFO
shInfo.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(GetType(SHELLEXECUTEINFO))
shInfo.lpFile = Path
shInfo.nShow = SW_SHOW
shInfo.fMask = SEE_MASK_INVOKEIDLIST
shInfo.lpVerb = "properties"
ShellExecuteEX(shInfo)
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ShowPropertiesDialog("C:\")
ShowPropertiesDialog("C:\autoexec.bat")
End Sub


Other 13 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
10/2/2004 4:57:27 AMAndrew Vos

Umm, one other thing, this ACTUALLY works, no jokes. Couldn't find this on the net in vb.net form, so i had to convert from C#. (PS Uses API, be warned)
(If this comment was disrespectful, please report it.)

 
8/23/2005 5:00:20 AMDondata

Works very well.
Thanks.
(If this comment was disrespectful, please report it.)

 
8/23/2005 6:29:57 AMAndrew Vos

thanks!
(If this comment was disrespectful, please report it.)

 
11/19/2005 12:58:52 AMEdwin

Thanks, Worked Great!!!
(If this comment was disrespectful, please report it.)

 
5/9/2007 4:09:50 AMLIM

this is a good work that help u to show the file/drive/folder properties...


(If this comment was disrespectful, please report it.)

 
1/29/2009 12:01:43 PMAshi

Thank you so much for this! i was searching for it on the internet but did not find it anywhere.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.