By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,916 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,916 IT Pros & Developers. It's quick & easy.

The code below will not work on Vista 64bit?

P: n/a
yxq
Hello,
The code below can popup the property dialog of a file, it works well on XP,
Vista 32bit, but it will not work on Vista 64bit, how to correct it? i have
tried to change integer to intptr, but not work yet, thank you.

//////////////////////////////////////////////////////
<System.Runtime.InteropServices.StructLayout(Syste m.Runtime.InteropServices.LayoutKind.Sequential)>
Public Class SHELLEXECUTEINFO
Public cbSize As Integer
Public fMask As Integer
Public hwnd As Integer
<System.Runtime.InteropServices.MarshalAs(System.R untime.InteropServices.UnmanagedType.LPWStr),
Microsoft.VisualBasic.VBFixedString(255)Public lpVerb As String = ""
<System.Runtime.InteropServices.MarshalAs(System.R untime.InteropServices.UnmanagedType.LPWStr),
Microsoft.VisualBasic.VBFixedString(255)Public lpFile As String = ""
<System.Runtime.InteropServices.MarshalAs(System.R untime.InteropServices.UnmanagedType.LPWStr),
Microsoft.VisualBasic.VBFixedString(255)Public lpParameters As String = ""
<System.Runtime.InteropServices.MarshalAs(System.R untime.InteropServices.UnmanagedType.LPWStr),
Microsoft.VisualBasic.VBFixedString(255)Public lpDirectory As String = ""
Public nShow As Integer
Public hInstApp As Integer
Public lpIDList As Integer
Public lpClass As String
Public hkeyClass As Integer
Public dwHotKey As Integer
Public hIcon As Integer
Public hProcess As Integer

Private Const SW_SHOW As Integer = 5
Private Const SEE_MASK_INVOKEIDLIST As Integer = &HC
Private Declare Auto Function ShellExecuteEX Lib "shell32.dll" Alias
"ShellExecuteEx" (ByVal SEI As SHELLEXECUTEINFO) As Integer

Public Shared Sub ShowPropertiesDialog(ByVal Path As String)
If System.IO.File.Exists(Path) Or System.IO.Directory.Exists(Path)
Then
Dim shInfo As New SHELLEXECUTEINFO
shInfo.cbSize =
System.Runtime.InteropServices.Marshal.SizeOf(GetT ype(SHELLEXECUTEINFO))
shInfo.lpFile = Path
shInfo.nShow = SW_SHOW
shInfo.fMask = SEE_MASK_INVOKEIDLIST
shInfo.lpVerb = "properties"
ShellExecuteEX(shInfo)
End If
End Sub
End Class
Jan 5 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.