473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

The code below will not work on Vista 64bit?

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
0 1265

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

88
by: Peter Olcott | last post by:
Cab you write code directly in the Common Intermediate language? I need to optimize a critical real-time function.
6
by: yxq | last post by:
Hello, The File.Delete(VS2005) function can not delete file on Vista-64bit, why? And, what changes of API between 32-bit and 64-bit? Thank you
3
by: slogging_away | last post by:
I know, I know - flame away but its not clear to me if Python will run on a system running Microsoft Vista. Is anyone successfully running Python on Vista? If so, is it what version of Python are...
5
by: | last post by:
Hello, I am wrtting a program that does some sound effects... the files are stored in a subfolder in the application folder... and I check the existence of the files before calling the method to...
7
by: Nicolas Hinze | last post by:
Dear all, I installed Vista SP1 on my Vista x64 Enterprise machine. Now my Visual Basic 2005 (.Net 2) does not behave correctly. It appears that 'for loops' have a problem of some sort. For...
8
by: perry.yuan | last post by:
Hi Gurus, I am looking for C code for multiplying 32bit by 32bit operands and getting a 64bit product. i.e. U32 m1, m2; U64 p = m1 * m2; Of course I can use
2
by: =?Utf-8?B?TWlrZSBNaWtl?= | last post by:
Multiple problems I believe are related. First SqlDatasource in designer "Object reference not set to an instance of an object." I believe problems is caused by unable to read and bind the...
4
by: =?Utf-8?B?dmlwZXJ4MTk2Nw==?= | last post by:
We are having an issue with an application we are developing. We have a Legacy COM DLL in C++ that we have converted to Visual Studio 2008. This COM DLL has methods that are calling Managed C#...
1
by: =?Utf-8?B?TWljaw==?= | last post by:
Hello. I have a table PC, running Vista Home Premium (64bit) and when I try to write with the stylus, it is VERY slow to repsond to the touch, and it often does'nt record a key stroke, or at least...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.