-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
62 lines (55 loc) · 2.14 KB
/
Program.cs
File metadata and controls
62 lines (55 loc) · 2.14 KB
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
53
54
55
56
57
58
59
60
61
62
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace DevinDow.VisionBoard
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Properties.Settings.Default.Upgrade();
if (args.Length == 0) // run full VisionBoard editing app
Application.Run(new MainForm());
else
{
char argParam = args[0].Trim().ToLower()[1]; // "/s" or "/w" or "/p" "HWND" or "/c:HWND"
switch (argParam)
{
case 's': // Execute Screensaver
Cursor.Hide();
Application.Run(new ScreensaverForm());
break;
case 'w': // Wake = execute Screensaver while preventing Sleep
ScreensaverForm.PreventSleep = true;
Cursor.Hide();
Application.Run(new ScreensaverForm());
break;
case 'p': // Execute Preview in Preview Window - involves creating and joining threads
IntPtr previewHandle = new IntPtr(long.Parse(args[1]));
new ScreensaverForm(previewHandle).ShowDialog();
break;
case 'c': // Options Dialog
Application.Run(new MainForm(ScreensaverForm.ScreensaverVisionBoardPath));
break;
default:
Application.Run(new MainForm(args[0]));
break;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}