-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBotProcess.cs
More file actions
32 lines (29 loc) · 900 Bytes
/
Copy pathBotProcess.cs
File metadata and controls
32 lines (29 loc) · 900 Bytes
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
using System;
using System.Diagnostics;
namespace BotLibNet2
{
public class BotProcess
{
public BotKeyboard keyboard;
public BotMouse mouse;
public BotWindow window;
public BotImage image;
public IntPtr process;
public BotProcess(string processName)
{
Process[] processesList = Process.GetProcessesByName(processName);
if (processesList.Length > 0)
{
process = processesList[0].MainWindowHandle;
keyboard = new BotKeyboard(process);
mouse = new BotMouse(process);
window = new BotWindow(process);
image = new BotImage(process);
}
}
public static bool ProcessExist(string processName)
{
return (Process.GetProcessesByName(processName).Length > 0) ? true : false;
}
}
}