Solved

File Properties Window

Posted on 1998-06-03
3
139 Views
Last Modified: 2010-05-03
Does anyone know how to call a file properties window?  I realize that I could easily create a facsimile but if there is an API I would greatly appreciate any and all information on it.
Thanks, hozempa
0
Comment
Question by:hozempa
3 Comments
 
LVL 1

Expert Comment

by:Sekans
ID: 1462419
There are API's to retrieve specific information about the file (GetFileSize, GetFileType, GetFileAttributes).  However, I don't know if there is one to open a file attributes window.

Regards,
Sekans
0
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 50 total points
ID: 1462420
hozempa,

1- Add form1 to project1.
2- Add command1 to form1.
3- Paste the the following code:

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
 lpIDList      As Long
 lpClass       As String
 hkeyClass     As Long
 dwHotKey      As Long
 hIcon         As Long
 hProcess      As Long
End Type

Private Const SEE_MASK_INVOKEIDLIST = &HC
Private Const SEE_MASK_NOCLOSEPROCESS = &H40
Private Const SEE_MASK_FLAG_NO_UI = &H400

Private Declare Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long

Private Function ShowProperties(FilePath As String, OwnerhWnd As Long) As Long
 Dim SEI As SHELLEXECUTEINFO
 Dim Ret As Long

 With SEI
  .cbSize = Len(SEI)
  .fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI
  .hwnd = OwnerhWnd
  .lpVerb = "properties"
  .lpFile = FilePath
  .lpParameters = vbNullChar
  .lpDirectory = vbNullChar
  .nShow = 0
  .hInstApp = 0
  .lpIDList = 0
 End With

 Ret = ShellExecuteEX(SEI)

 ShowProperties = SEI.hInstApp
End Function

Private Sub Command1_Click()
 ShowProperties "d:\winnt", Me.hwnd
End Sub


Best regards
Bin Huwairib
0
 
LVL 1

Author Comment

by:hozempa
ID: 1462421
Thanks, Bin Huwairib.  Sorry for the delay in awarding the points but I just got around to checking out the code.  

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now