[DllImport("shell32.dll")]
static extern IntPtr ShellExecute(
IntPtr hwnd,
string lpOperation,
string lpFile,
string lpParameters,
string lpDirectory,
int nShowCmd);
None.
None.
Possible values for lpOperation
edit
explore
find
open
NULL - Performs the default action (prior to Win2k) normally open
// Asks default mail client to send an email to the specified address.
ShellExecute( IntPtr.Zero, "open", "mailto:support@microsoft.com", "", "", 4 );
// Asks default browser to visit the specified site.
ShellExecute( IntPtr.Zero, "open", "http://channel9.msdn.com", "", "", 4 );
// Opens default HTML editing app to allow for edit of specified file
ShellExecute( IntPtr.Zero, "edit", @"c:\file.html", "", "", 4 );
//Modified by Aljaz: Replaced the last zero in these calls with say otherwise it won't show anything
// 0 stands for SW_HIDE contant, which means execute but don't show the window which is probably not
// what we want.
Do you know one? Please contribute it!