-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
46 lines (41 loc) · 1.12 KB
/
Program.cs
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
using System;
namespace MediaButtonsSend
{
class Program
{
static void Main(string[] args)
{
try
{
if (args== null || args.Length == 0 )
{
ShowHelp();
return;
}
var success = Enum.TryParse(args[0],true, out AppCommandValues action);
if (success)
{
TrackKeys(action);
return;
}
ShowHelp();
}
catch
{
ShowHelp();
}
}
private static void ShowHelp()
{
var hlp = new FrmHelp();
hlp.ShowDialog();
}
private static void TrackKeys(AppCommandValues cmd)
{
//this does not work when running as admin
//byte msg = trackMove == TrackMove.Previous ? (byte)0xB1 : (byte)0xB0;
//keybd_event(msg, 0x45, 0, IntPtr.Zero);
AppCommand.Send(cmd);
}
}
}