1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
namespace Microsoft.Win32.Shell32
{
using System;
using System.Text;
using System.Collections.Generic;
using System.Runtime.InteropServices;
public class ShellAboutDialog
{
[DllImport("Shell32.dll", CharSet = CharSet.Auto)]
public static extern int ShellAbout(
IntPtr hWnd,
[MarshalAs(UnmanagedType.LPTStr)] string szApp,
[MarshalAs(UnmanagedType.LPTStr)] string szOtherStuff,
IntPtr hIcon);
}
}
/// Beispiel: Bitte eine neue Konsolenanwendung erstellen!
namespace TestShellAbout
{
using System;
using System.Text;
using System.Drawing;
using Microsoft.Win32.Shell32;
class Program
{
static void Main(string[] args)
{
try
{
Console.WriteLine("Microsoft Windows Shell - Test Utility v1.0");
Console.WriteLine("");
// TODO: Change the path to a valid ico file
Icon icon = Icon.ExtractAssociatedIcon(@"D:\Visual Studio 2005\Resources\App.ico");
ShellAboutDialog.ShellAbout(IntPtr.Zero, "Microsoft Windows Shell - Test Utility v1.0", Environment.NewLine + "Specialwork Software", icon.Handle);
}
catch (Exception exception)
{
Console.WriteLine(exception.Message);
}
finally
{
Console.WriteLine("Press a key to exit");
Console.WriteLine("");
}
}
}
}
|