473,511 Members | 16,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ShellExecute won't show properties

I'm trying to display the shell's property page for various files and I'm
using this code:

class Win32Shell {
// ... other stuff here
[DllImport("shell32.dll")]
public static extern Int32 ShellExecute(
Int32 hwnd,
string lpOperation,
string lpFile,
string lpParameters,
string lpDirectory,
Int32 nShowCmd);

// ... other stuff here
}

I use this to open files listed in a listView where the first column is
the filename and the second is the path like so:

ListViewItem lVItem = fileListView.SelectedItems[0];
Win32Shell.ShellExecute(0, "open", fileName,
lVItem.SubItems[1].Text,null, 1);

and it works fine, but when I try to show the properties of said file like
so:
Win32Shell.ShellExecute(0, "properties", fileName,
lVItem.SubItems[1].Text,null, 1);

it returns 31, which means that the action (properties) isn't associated
with said file. This is how it works on all files. I've tried a few
different things to no avail (including two other definitions of
ShellExecute), but none has worked, any ideas?
Nov 16 '05 #1
0 1587

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

Similar topics

0
2550
by: Marcel Sammut | last post by:
Greetings, I am converting a VB6 application to .net and am having troubles trying to print a document directley to the printer. My VB6 app used the API ShellExecute method to accomplish this,...
3
5451
by: Wiktor Zychla | last post by:
I have a problem I cannot solve. My application hosts IE activex control. I follow the standard procedure: I just aximp shdocvw.dll. Note that this gives you two files: axshdocvw.dll and...
0
1807
by: the_openFace | last post by:
I'm trying to display the shell's property page for various files and I'm using this code: class Win32Shell { // ... other stuff here public static extern Int32 ShellExecute( Int32 hwnd,...
0
2106
by: Marcel Sammut | last post by:
Greetings, I am converting a VB6 application to .net and am having troubles trying to print a document directley to the printer. My VB6 app used the API ShellExecute method to accomplish this,...
0
7245
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
7144
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
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7427
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...
1
7085
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
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.