The following collection of C# code snippets assumes .NET Framework 4.0 is installed.
Check the code comments if later versions of the .NET Framework are required.
string programpath = new System.Uri( System.Reflection.Assembly.GetExecutingAssembly( ).CodeBase ).LocalPath;
// Or for Windows Forms:
// string programpath = System.Windows.Forms.Application.ExecutablePath;
string progver = System.Reflection.Assembly.GetExecutingAssembly( ).GetName( ).Version.ToString( );
Console.WriteLine( "Class : {0}", System.Reflection.Assembly.GetEntryAssembly( ).EntryPoint.DeclaringType.Name );
Console.WriteLine( "Namespace : {0}", System.Reflection.Assembly.GetEntryAssembly( ).EntryPoint.DeclaringType.Namespace );
// Skip( 1 ) removes the first argument, i.e. the program name; Skip( ) requires Linq
string[] arguments = System.Environment.GetCommandLineArgs( ).Skip( 1 ).ToArray( ); // arguments in array
string allarguments = string.Join( " ", arguments ); // arguments in single line
string commandline = System.Environment.CommandLine; // entire command line
// Get the required .NET Framework version
// By Fernando Gonzalez Sanchez on StackOverflow.com
// https://stackoverflow.com/a/18623516
object[] list = System.Reflection.Assembly.GetExecutingAssembly( ).GetCustomAttributes( true );
var attribute = list.OfType<System.Runtime.Versioning.TargetFrameworkAttribute>( ).First( ); // requires Linq
string frameworkname = attribute.FrameworkName;
string frameworkdisplayname = attribute.FrameworkDisplayName;
// Source of this code snippet:
// https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
// Opens the registry key for the .NET Framework entry.
using ( Microsoft.Win32.RegistryKey ndpKey =
Microsoft.Win32.RegistryKey.OpenRemoteBaseKey( Microsoft.Win32.RegistryHive.LocalMachine, "" )
.OpenSubKey( @"SOFTWARE\Microsoft\NET Framework Setup\NDP\" ) )
{
// As an alternative, if you know the computers you will query are running .NET Framework 4.5 or later, you can use:
// using ( Microsoft.Win32.RegistryKey ndpKey =
// Microsoft.Win32.RegistryKey.OpenBaseKey( Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry32 )
// .OpenSubKey( @"SOFTWARE\Microsoft\NET Framework Setup\NDP\" ) )
foreach ( string versionKeyName in ndpKey.GetSubKeyNames( ) )
{
if ( versionKeyName.StartsWith( "v" ) )
{
Microsoft.Win32.RegistryKey versionKey = ndpKey.OpenSubKey( versionKeyName );
string name = (string) versionKey.GetValue( "Version", "" );
string sp = versionKey.GetValue( "SP", "" ).ToString( );
string install = versionKey.GetValue( "Install", "" ).ToString( );
if ( install == "" ) //no install info, must be later.
{
System.Console.WriteLine( versionKeyName + " " + name );
}
else
{
if ( sp != "" && install == "1" )
{
System.Console.WriteLine( versionKeyName + " " + name + " SP" + sp );
}
}
if ( name != "" )
{
continue;
}
foreach ( string subKeyName in versionKey.GetSubKeyNames( ) )
{
Microsoft.Win32.RegistryKey subKey = versionKey.OpenSubKey( subKeyName );
name = (string) subKey.GetValue( "Version", "" );
if ( name != "" )
{
sp = subKey.GetValue( "SP", "" ).ToString( );
}
install = subKey.GetValue( "Install", "" ).ToString( );
if ( install == "" ) //no install info, must be later.
{
System.Console.WriteLine( versionKeyName + " " + name );
}
else
{
if ( sp != "" && install == "1" )
{
System.Console.WriteLine( " " + subKeyName + " " + name + " SP" + sp );
}
else if ( install == "1" )
{
System.Console.WriteLine( " " + subKeyName + " " + name );
}
}
}
}
}
}
int rc = 0; // default return code if no .NET Framework is found
System.Collections.Generic.List<string> installedversions = new System.Collections.Generic.List<string>( ); // list of all versions installed
int[] highestversion = new int[] { 0, 0, 0, 0 }; // helper variable to determine which string represents the highest version
// Get the list of installed .NET Framework versions from the registry, by Microsoft:
// https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
using ( Microsoft.Win32.RegistryKey ndpKey =
Microsoft.Win32.RegistryKey.OpenRemoteBaseKey( Microsoft.Win32.RegistryHive.LocalMachine, "" )
.OpenSubKey( @"SOFTWARE\Microsoft\NET Framework Setup\NDP\" ) )
{
foreach ( string versionKeyName in ndpKey.GetSubKeyNames( ) )
{
if ( versionKeyName.StartsWith( "v" ) )
{
Microsoft.Win32.RegistryKey versionKey = ndpKey.OpenSubKey( versionKeyName );
string name = (string) versionKey.GetValue( "Version", "" );
if ( name == "" )
{
foreach ( string subKeyName in versionKey.GetSubKeyNames( ) )
{
Microsoft.Win32.RegistryKey subKey = versionKey.OpenSubKey( subKeyName );
name = (string) subKey.GetValue( "Version", "" );
if ( name != "" )
{
installedversions.Add( name );
}
}
}
else
{
installedversions.Add( name );
}
}
}
}
// Determine the highest version
foreach ( string version in installedversions )
{
int[] version2 = version.Split( ".".ToCharArray( ) ).Select( x => System.Convert.ToInt32( x ) ).ToArray( );
int minlength = System.Math.Min( version.Length, version2.Length );
for ( int i = 0; i < minlength; i++ )
{
if ( highestversion[i] < System.Convert.ToInt32( version2[i] ) )
{
highestversion = version2;
break;
}
}
}
// Write version string to screen
System.Console.WriteLine( string.Join( ".", highestversion.Select( x => x.ToString( ) ).ToArray( ) ) ); // requires System.Linq
// Return code is based on first 2 digits of highest version
rc = 100 * highestversion[0] + highestversion[1];
return rc;
string programpath = new System.Uri( System.Reflection.Assembly.GetExecutingAssembly( ).CodeBase ).LocalPath;
// Or for Windows Forms:
// string programpath = System.Windows.Forms.Application.ExecutablePath;
string[] arguments = System.Environment.GetCommandLineArgs( ).Skip( 1 ).ToArray( ); // requires Linq
System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo( );
startinfo.FileName = programpath;
startinfo.UseShellExecute = true;
startinfo.Arguments = string.Join( " ", arguments );
System.Diagnostics.Process.Start( startinfo );
System.Environment.Exit( 0 ); // return code 0, change if required
// Or for Windows Forms:
// System.Windows.Forms.Application.Exit( );
string programpath = new System.Uri( System.Reflection.Assembly.GetExecutingAssembly( ).CodeBase ).LocalPath;
// Or for Windows Forms:
// string programpath = System.Windows.Forms.Application.ExecutablePath;
string[] arguments = System.Environment.GetCommandLineArgs( ).Skip( 1 ).ToArray( ); // requires Linq
System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo( );
startinfo.FileName = programpath;
startinfo.UseShellExecute = true;
startinfo.Verb = "runas";
startinfo.Arguments = String.Join( " ", arguments );
System.Diagnostics.Process.Start( startinfo );
System.Environment.Exit( 0 ); // return code 0, change if required
// Or for Windows Forms:
// System.Windows.Forms.Application.Exit( );
System.Threading.Thread.Sleep( 5000 ); // wait 5 seconds (5000 milliseconds)
long dec = 9876543210;
string bin = Convert.ToString( dec, 2 );
string oct = Convert.ToString( dec, 8 );
string hex = Convert.ToString( dec, 16 );
Console.WriteLine( "Decimal : {0}", dec );
Console.WriteLine( "Binary : {0}", bin );
Console.WriteLine( "Octal : 0{0}", oct );
Console.WriteLine( "Hexadecimal : 0x{0}", hex.ToUpper( ) );
string input = string.Empty;
if ( System.Console.IsInputRedirected ) // requires .NET Framework 4.5
{
System.Console.OpenStandardInput( );
input = System.Console.In.ReadToEnd( );
}
// Code by Atif Aziz on StackOverflow.com:
// https://stackoverflow.com/a/749653
[DllImport( "shell32.dll", SetLastError = true )]
static extern IntPtr CommandLineToArgvW( [MarshalAs( UnmanagedType.LPWStr )] string lpCmdLine, out int pNumArgs );
public static string[] CommandLineToArgs( string commandLine )
{
int argc;
var argv = CommandLineToArgvW( commandLine, out argc );
if ( argv == IntPtr.Zero )
{
throw new System.ComponentModel.Win32Exception( );
}
try
{
var args = new string[argc];
for ( var i = 0; i < args.Length; i++ )
{
var p = Marshal.ReadIntPtr( argv, i * IntPtr.Size );
args[i] = Marshal.PtrToStringUni( p );
}
return args;
}
finally
{
Marshal.FreeHGlobal( argv );
}
string cliptext = string.Empty;
if ( System.Windows.Forms.Clipboard.ContainsText( ) )
{
clipText = System.Windows.Forms.Clipboard.GetText( );
}
string unescapedtext = "4 > 3";
string escapedtext = System.Net.WebUtility.HtmlEncode( unescapedtext );
// In DOS this works: DIR *.doc *.xls
// But in C# this does NOT work:
// Directory.GetFiles( folder, "*.doc *.xls" )
// Instead use:
Directory.GetFiles( folder, "*.*" ).Where( f => f.EndsWith( ".doc" ) || f.EndsWith( ".xls" ) )
Single filesize = new System.IO.FileInfo( filepath ).Length; // specify filepath
// This will create a new temporary file and return its path
string newtempfile = System.IO.Path.GetTempFileName( );
// Add a reference to the COM library "Microsoft Windows Image Acquisition" (WIA),
// and set its property "Embed Interop Types" to false
// https://ourcodeworld.com/articles/read/382/creating-a-scanning-application-in-winforms-with-csharp
int columnwidth = 0;
WIA.DeviceManager devicemanager = new WIA.DeviceManager( );
foreach ( WIA.DeviceInfo devinfo in devicemanager.DeviceInfos )
{
if ( devinfo.Type == WIA.WiaDeviceType.ScannerDeviceType ) // scanners only
{
foreach ( WIA.Property prop in devinfo.Properties )
{
columnwidth = System.Math.Max( columnwidth, prop.Name.Length );
}
}
}
foreach ( WIA.DeviceInfo devinfo in devicemanager.DeviceInfos )
{
if ( devinfo.Type == WIA.WiaDeviceType.ScannerDeviceType ) // scanners only
{
foreach ( WIA.Property prop in devinfo.Properties )
{
System.Console.WriteLine( "{0,-" + columnwidth + "} {1}", prop.Name, prop.get_Value( ) );
}
}
System.Console.WriteLine( );
}
// Take a screenshot
// By Ali Hamdar (http://alihamdar.com/)
// http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/79efecc4-fa6d-4078-afe4-bb1379bb968b
// Default values for full screen
int width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
int height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
int top = 0;
int left = 0;
System.Drawing.Bitmap printscreen = new System.Drawing.Bitmap( width, height );
System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage( printscreen as Image );
graphics.CopyFromScreen( top, left, 0, 0, printscreen.Size );
printscreen.Save( outputfile, imagetype );
public static class ExtensionMethods
{
public static bool ContainsCI( this System.Collections.Generic.List<string> value, string key )
{
return value.Any( k => k.Equals( key, System.StringComparison.OrdinalIgnoreCase ) ); // requires Linq
}
}
public static class ExtensionMethods
{
public static System.DateTime LimitToRange( this System.DateTime value, System.DateTime earliest, System.DateTime latest )
{
if ( System.DateTime.Compare( value, earliest ) < 0 )
{
return earliest;
}
if ( System.DateTime.Compare( value, latest ) > 0 )
{
return latest;
}
return value;
}
public static float LimitToRange( this float value, float inclusiveMinimum, float inclusiveMaximum )
{
if ( value < inclusiveMinimum )
{
return inclusiveMinimum;
}
if ( value > inclusiveMaximum )
{
return inclusiveMaximum;
}
return value;
}
// Extension by "dtb" on StackOverflow.com:
// https://stackoverflow.com/a/3176628
public static int LimitToRange( this int value, int inclusiveMinimum, int inclusiveMaximum )
{
if ( value < inclusiveMinimum )
{
return inclusiveMinimum;
}
if ( value > inclusiveMaximum )
{
return inclusiveMaximum;
}
return value;
}
}
public static class ExtensionMethods
{
public static bool IsFixedPitch( this System.Drawing.FontFamily value )
{
System.Drawing.Font font = new System.Drawing.Font( value, 12, System.Drawing.FontStyle.Regular );
return ( System.Windows.Forms.TextRenderer.MeasureText( "WWWWW", font ) == System.Windows.Forms.TextRenderer.MeasureText( "IIIII", font ) );
}
public static bool IsFixedPitch( this System.Drawing.Font value )
{
// Inspired by a tip from Hans passant
// https://stackoverflow.com/q/21965321
return ( System.Windows.Forms.TextRenderer.MeasureText( "WWWWW", value ) == System.Windows.Forms.TextRenderer.MeasureText( "IIIII", value ) );
}
}
// Easter is at first Sunday after the first full moon at or after the Spring equinox (21 March)
// Calculation explained: https://www.timeanddate.com/calendar/determining-easter-date.html
int year = DateTime.Now.Year # or choose any year (100+), it doesn't have to be an int, string is fine too
// For Easter calculations, the Spring equinox is always assumed to be at 21 March
DateTime springequinox = DateTime.Parse( string.Format( "{0}-03-21", year ) );
// Calculate full moon cycles to first full moon after Spring equinox of specified year
int fullcycles = (int)Math.Ceiling( springequinox.Subtract( referencefullmoon ).Days / mooncycleindays );
// Date of first full moon after Spring equinox of specified year
DateTime fullmoonafterequinox = referencefullmoon.AddDays( fullcycles * mooncycleindays );
// First Sunday following first full moon at or after Spring equinox of specified year
DateTime eastersunday = fullmoonafterequinox.AddDays( 7 - (int)fullmoonafterequinox.DayOfWeek ).Date;
// Convert today's date to Julian date by David Yaw: https://stackoverflow.com/a/5254812
double juliandate = System.DateTime.Today.ToOADate( ) + 2415018.5;
// or (see https://en.wikipedia.org/wiki/Julian_day#Variants for details):
double juliandate = System.DateTime.Today.Date.Ticks / 864000000000 + 1721425.5;
//Convert Julian date back to Gregorian date:
System.DateTime gregoriandate = System.DateTime.FromOADate( juliandate - 2415018.5 );
// or:
System.DateTime gregoriandate = System.DateTime.Parse( "0001-01-01" ).AddTicks( (long)( juliandate - 1721425.5 ) * 864000000000 );
string url = "https://www.example.com/example.txt"
// The next couple of ServicePointManager lines are required for secure connections only
System.Net.ServicePointManager.Expect100Continue = true;
System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;
System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Ssl3;
System.Net.WebClient webclient = new System.Net.WebClient( );
string text = webclient.DownloadString( url );
webclient.Dispose( );
// This will work only for true MSI-based Office installations, not for click-to-run installations
(bool) isAccessInstalled = ( Type.GetTypeFromProgID( "Access.Application" ) != null );
(bool) isExcelInstalled = ( Type.GetTypeFromProgID( "Excel.Application" ) != null );
(bool) isMSGraphInstalled = ( Type.GetTypeFromProgID( "MSGraph.Application" ) != null );
(bool) isOutlookInstalled = ( Type.GetTypeFromProgID( "Outlook.Application" ) != null );
(bool) isPowerPointInstalled = ( Type.GetTypeFromProgID( "PowerPoint.Application" ) != null );
(bool) isWordInstalled = ( Type.GetTypeFromProgID( "Word.Application" ) != null );
// Use a hidden RichTextBox to convert RTF to plain text, by Wendy Zang
// https://social.msdn.microsoft.com/Forums/vstudio/en-US/6e56af9b-d7d3-49f3-9ec4-80edde3fe54b/reading-modifying-rtf-files?forum=csharpgeneral#a64345e9-cfcb-43be-ab18-c08fae02cb2a
string rtffile = "D:\\folder\\rtffile.rtf";
System.Windows.Forms.RichTextBox rtbox = new System.Windows.Forms.RichTextBox( );
string rtftext = System.IO.File.ReadAllText( rtffile );
rtbox.Rtf = rtftext;
string plaintext = rtbox.Text;
Console.WriteLine( plaintext );
// This will open search results from Google in your default browser
string query = System.Uri.EscapeDataString( "whatever it is I'm looking for" );
string domain = "microsoft.com"; // search only on this domain
if ( !string.IsNullOrWhiteSpace( domain ) )
{
query += string.Format( "+site:{0}", domain );
}
string url = string.Format( "https://www.google.com/search?q={0}&btnI=745&pws=0", query );
System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo( url );
System.Diagnostics.Process.Start( startinfo );
// Dynamically generate icons; based on code by Joshua Flanagan on CodeProject.com
// https://www.codeproject.com/Articles/7122/Dynamically-Generating-Icons-safely
// This code will create an icon, draw a circle and fill it with backgroundcolor, and place some text (not too long) in the center
public System.Drawing.Icon CreateIcon( string text, System.Drawing.Font font, System.Drawing.Brush foregroundcolor, System.Drawing.Brush backgroundcolor )
{
System.Drawing.Icon icon = null;
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap( 16, 16 );
using ( System.Drawing.Graphics graphic = System.Drawing.Graphics.FromImage( bitmap ) )
{
graphic.FillEllipse( backgroundcolor, 0, 0, 16, 16 ); // Create circle and fill it with background color
System.Drawing.SizeF textsize = graphic.MeasureString( text, font ); // Determine the size and position of the text
System.Single x = System.Convert.ToSingle( System.Math.Floor( ( bitmap.Width - textsize.Width ) / 2 ) );
System.Single y = System.Convert.ToSingle( System.Math.Ceiling( ( bitmap.Height - textsize.Height ) / 2 ) );
graphic.DrawString( text, font, foregroundcolor, x, y, System.Drawing.StringFormat.GenericDefault ); // Generate an image of the text
icon = System.Drawing.Icon.FromHandle( bitmap.GetHicon( ) );
}
return icon;
}
// For more details, including codes for special keys, see:
// https://docs.microsoft.com/dotnet/api/system.windows.forms.sendkeys.send
System.Windows.Forms.SendKeys.SendWait( string keys );
// Open Windows Update settings; more URIs for specific settings can be found at
// https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app#ms-settings-uri-scheme-reference
System.Diagnostics.Process.Start( "ms-settings:windowsupdate" );
// Source: https://stackoverflow.com/a/13547659
public static IntPtr WinGetHandle( string wName )
{
IntPtr hWnd = IntPtr.Zero;
foreach ( Process pList in Process.GetProcesses( ) )
{
if ( pList.MainWindowTitle.Contains( wName ) )
{
hWnd = pList.MainWindowHandle;
}
}
return hWnd; // Should contain the handle but may be zero if the title doesn't match
}
// GetSystemMetrics( 43 ) ALWAYS returns the ACTUAL total number of mouse buttons
bool mousepresent = ( GetSystemMetrics( 43 ) > 0 );
// Add the following DLL Import in your Program class
[System.Runtime.InteropServices.DllImport( "user32.dll" )]
static extern int GetSystemMetrics( int smIndex );
The next 6 code snippets use unmanaged code to manipulate other programs' windows by their window handle (see previous item).
The last snippet uses unmanaged code to play PCM sound files (*.WAV), either synchronously or asynchronously, only once or continuously.
For more details search for these functions on PInvoke.net.
Don't forget to include using System.Runtime.InteropServices;
in your code.
[DllImport( "user32.dll" )]
[return: MarshalAs( UnmanagedType.Bool )]
static extern bool IsIconic( IntPtr hWnd ); // true if window is minimized
[DllImport( "user32.dll", SetLastError = true )]
[return: MarshalAs( UnmanagedType.Bool )]
static extern bool GetWindowRect( IntPtr hWnd, ref RECT lpRect ); // RECT lpRect must be initialized before calling this function
[StructLayout( LayoutKind.Sequential )]
public struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
[DllImport( "user32.dll" )]
public static extern bool MoveWindow( IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint );
private const int SW_HIDE = 0;
private const int SW_SHOWNORMAL = 1;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWMAXIMIZED = 3;
[DllImport( "user32.dll" )]
private static extern bool ShowWindow( IntPtr hWnd, int nCmdShow ); // Use one of the constants for nCmdShow to maximize, minimize or restore the window
[DllImport( "user32.dll" )]
private static extern bool ShowWindowAsync( IntPtr hWnd, int nCmdShow ); // Same function but asynchronous
// Instead of the separate constants for the ShowWindow and ShowWindowAsync functions you can use an enumeration.
// Source: http://pinvoke.net/default.aspx/user32/ShowState.html
public enum ShowState
{
SW_HIDE = 0,
SW_SHOWNORMAL = 1,
SW_NORMAL = 1,
SW_SHOWMINIMIZED = 2,
SW_SHOWMAXIMIZED = 3,
SW_MAXIMIZE = 3,
SW_SHOWNOACTIVATE = 4,
SW_SHOW = 5,
SW_MINIMIZE = 6,
SW_SHOWMINNOACTIVE = 7,
SW_SHOWNA = 8,
SW_RESTORE = 9,
SW_SHOWDEFAULT = 10,
SW_FORCEMINIMIZE = 11,
SW_MAX = 11
}
// Will not immediately change the foreground window while another window receives input
[DllImport( "user32.dll" )]
public static extern bool SetForegroundWindow( IntPtr hWnd );
// Source: http://pinvoke.net/default.aspx/winmm/PlaySound.html
// Play once and wait:
PlaySound( wav_file, UIntPtr.Zero, (uint) SoundFlags.SND_FILENAME );
// Play once, don't wait:
PlaySound( wav_file, UIntPtr.Zero, (uint)( SoundFlags.SND_FILENAME | SoundFlags.SND_ASYNC ) );
// Play continuously until next PlaySound command, don't wait:
PlaySound( wav_file, UIntPtr.Zero, (uint)( SoundFlags.SND_FILENAME | SoundFlags.SND_ASYNC | SoundFlags.SND_LOOP ) );
// Abort continuous playing:
PlaySound( null, UIntPtr.Zero, 0 );
// Required DLL import:
[DllImport( "winmm.dll", SetLastError = true )]
static extern bool PlaySound( string pszSound, UIntPtr hmod, uint fdwSound );
// Required Enum:
public enum SoundFlags
{
/// <summary>play synchronously (default)</summary>
SND_SYNC = 0x0000,
/// <summary>play asynchronously</summary>
SND_ASYNC = 0x0001,
/// <summary>silence (!default) if sound not found</summary>
SND_NODEFAULT = 0x0002,
/// <summary>pszSound points to a memory file</summary>
SND_MEMORY = 0x0004,
/// <summary>loop the sound until next sndPlaySound</summary>
SND_LOOP = 0x0008,
/// <summary>don't stop any currently playing sound</summary>
SND_NOSTOP = 0x0010,
/// <summary>Stop Playing Wave</summary>
SND_PURGE = 0x40,
/// <summary>The pszSound parameter is an application-specific alias in the registry. You can combine this flag with the SND_ALIAS or SND_ALIAS_ID flag to specify an application-defined sound alias.</summary>
SND_APPLICATION = 0x80,
/// <summary>don't wait if the driver is busy</summary>
SND_NOWAIT = 0x00002000,
/// <summary>name is a registry alias</summary>
SND_ALIAS = 0x00010000,
/// <summary>alias is a predefined id</summary>
SND_ALIAS_ID = 0x00110000,
/// <summary>name is file name</summary>
SND_FILENAME = 0x00020000,
/// <summary>name is resource name or atom</summary>
SND_RESOURCE = 0x00040004
}
page last modified: 2024-02-26; loaded in 0.0369 seconds