CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Location
    Trivandrum, Kerala, India
    Posts
    21

    File Properties Dialog Box


    Hai,

    Can I display the properties dialog box of a file?

    Thanks in advance

    Kishore.


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: File Properties Dialog Box

    Private Const SW_SHOW = 5
    Private Const SEE_MASK_INVOKEIDLIST = &HC
    Private Type SHELLEXECUTEINFO
    cbSize As Long
    fMask As Long
    hwnd As Long
    lpVerb As String
    lpFile As String
    lpParameters As String
    lpDirectory As String
    nShow As Long
    hInstApp As Long
    ' optional fields
    lpIDList As Long
    lpClass As String
    hkeyClass As Long
    dwHotKey As Long
    hIcon As Long
    hProcess As Long
    End Type

    Private Declare Function ShellExecuteEx Lib "shell32.dll" (ByRef s As SHELLEXECUTEINFO) As Long

    Public Sub DisplayFileProperties(ByVal sFullFileAndPathName As String)
    Dim shInfo As SHELLEXECUTEINFO

    With shInfo
    .cbSize = LenB(shInfo)
    .lpFile = sFullFileAndPathName
    .nShow = SW_SHOW
    .fMask = SEE_MASK_INVOKEIDLIST
    .lpVerb = "properties"
    End With

    ShellExecuteEx shInfo
    End Sub

    Private Sub Command1_Click()
    Dim sFileName As String

    sFileName = InputBox("Enter Full Path/Name of file to view Properties for :", "Show File Properties", "c:\autoexec.bat")
    If Len(sFileName) = 0 Then
    MsgBox "You must enter a filename"
    Exit Sub
    End If

    If Len(Dir(sFileName)) = 0 Then
    MsgBox "File : " & sFileName & " cannot be found"
    Exit Sub
    End If

    DisplayFileProperties sFileName
    End Sub



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Jul 2001
    Posts
    7

    Re: File Properties Dialog Box


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured