Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Gurus*
Posted

Here it is in VB6, perhaps it'll get you started.

 

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

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

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:

Call ShellExecuteEx(SEI)

I wrote

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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...