showing property page

Salat

Regular
Joined
Mar 5, 2002
Messages
81
Location
Poland, Silesia
Is it possible to show system's "file property page", I saw something like this in other applications. I was wondering If i can use it too in my programs.

thank You for help...
 
As far as I know there isn't a .NET way to do this. I've done it in vb6 before using ShellExecuteEx, you will probably be able to find an example online but you'll have to port it to .NET.
 
Here it is in VB6, perhaps it'll get you started.

Visual Basic:
Public 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     'Optional parameter
    lpClass       As String   'Optional parameter
    hkeyClass     As Long     'Optional parameter
    dwHotKey      As Long     'Optional parameter
    hIcon         As Long     'Optional parameter
    hProcess      As Long     'Optional parameter
End Type

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

Public Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long

Public Sub ShowFileProperties(strFilename As String)
  'open a file properties property page for
  'specified file if return value

   Dim SEI As SHELLEXECUTEINFO
 
  'Fill in the SHELLEXECUTEINFO structure
   With SEI
      .cbSize = Len(SEI)
      .fMask = SEE_MASK_NOCLOSEPROCESS Or _
               SEE_MASK_INVOKEIDLIST Or _
               SEE_MASK_FLAG_NO_UI
      .hWnd = 0
      .lpVerb = "properties"
      .lpFile = strFilename
      .lpParameters = vbNullChar
      .lpDirectory = vbNullChar
      .nShow = 0
      .hInstApp = 0
      .lpIDList = 0
   End With
 
  'call the API to display the property sheet
   Call ShellExecuteEx(SEI)
End Sub
 
I'm new to VB.NET, sometimes it's realy hard for me to handle this exception.

An unhandled exception of type 'System.NullReferenceException' occurred in multiKlient FTP.exe

Additional information: Object reference not set to an instance of an object.

at line:
Visual Basic:
Call ShellExecuteEx(SEI)
I wrote
Visual Basic:
Dim SEI As SHELLEXECUTEINFO = New SHELLEXECUTEINFO
but it's still nothing, the 'System.NullReferenceException' occurs

Thanks for help anyway, You are doing a great job...
 
Back
Top