Solved

File Properties Window

Posted on 1998-06-03
3
138 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks, Bin Huwairib.  Sorry for the delay in awarding the points but I just got around to checking out the code.  

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

13 Experts available now in Live!

Get 1:1 Help Now