|
|
static short | GetAsyncKeyState (System.Windows.Forms.Keys vKey) |
| |
|
static IntPtr | GetForegroundWindow () |
| |
|
static int | GetWindowText (IntPtr hWnd, StringBuilder text, int count) |
| |
|
static bool | SetForegroundWindow (IntPtr hWnd) |
| |
|
static void | mouse_event (int dwFlags, int dx, int dy, int dwData, int dwExtraInfo) |
| |
|
static bool | GetWindowRect (IntPtr hwnd, ref Rect rectangle) |
| |
Definition at line 11 of file Win32.cs.
◆ GetActiveWindowTitle()
| static string BioImager.Win32.GetActiveWindowTitle |
( |
| ) |
|
|
static |
It gets the title of the active window
- Returns
- The title of the active window.
Definition at line 90 of file Win32.cs.
91 {
92 const int nChars = 256;
93 StringBuilder Buff = new StringBuilder(nChars);
94 IntPtr handle = GetForegroundWindow();
95
96 if (GetWindowText(handle, Buff, nChars) > 0)
97 {
98 return Buff.ToString();
99 }
100 return null;
101 }
◆ GetKeyState()
| static bool BioImager.Win32.GetKeyState |
( |
System.Windows.Forms.Keys |
vKey | ) |
|
|
static |
It returns true if the key is pressed, and false if it isn't
- Parameters
-
| vKey | The key you want to check. |
- Returns
- The return value is a short integer with the high order bit set if the key is down and the low order bit set if the key was pressed after the previous call to GetAsyncKeyState.
Definition at line 24 of file Win32.cs.
25 {
26 int si = (int)GetAsyncKeyState(vKey);
27 if (si == 0)
28 return false;
29 else
30 return true;
31 }
◆ MouseWheelDown()
| static void BioImager.Win32.MouseWheelDown |
( |
| ) |
|
|
static |
MouseWheelDown() simulates a mouse wheel down event.
Definition at line 73 of file Win32.cs.
74 {
75 mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -120, 0);
76 }
◆ MouseWheelUp()
| static void BioImager.Win32.MouseWheelUp |
( |
| ) |
|
|
static |
"MouseWheelUp()" is a function that simulates a mouse wheel up event.
Definition at line 68 of file Win32.cs.
69 {
70 mouse_event(MOUSEEVENTF_WHEEL, 0, 0, 120, 0);
71 }
◆ SetFocus()
| static void BioImager.Win32.SetFocus |
( |
string |
process | ) |
|
|
static |
It gets the process by name, then sets the foreground window to the process's main window handle
- Parameters
-
| process | The name of the process you want to focus on. |
Definition at line 81 of file Win32.cs.
82 {
83 Process pr = Process.GetProcessesByName(process)[0];
84 SetForegroundWindow(pr.MainWindowHandle);
85 }
◆ MOUSEEVENTF_ABSOLUTE
| const int BioImager.Win32.MOUSEEVENTF_ABSOLUTE = 0x8000 |
|
static |
◆ MOUSEEVENTF_HWHEEL
| const int BioImager.Win32.MOUSEEVENTF_HWHEEL =0x01000 |
|
static |
◆ MOUSEEVENTF_LEFTDOWN
| const int BioImager.Win32.MOUSEEVENTF_LEFTDOWN = 0x0002 |
|
static |
◆ MOUSEEVENTF_LEFTUP
| const int BioImager.Win32.MOUSEEVENTF_LEFTUP = 0x0004 |
|
static |
◆ MOUSEEVENTF_MIDDLEDOWN
| const int BioImager.Win32.MOUSEEVENTF_MIDDLEDOWN = 0x0020 |
|
static |
◆ MOUSEEVENTF_MIDDLEUP
| const int BioImager.Win32.MOUSEEVENTF_MIDDLEUP =0x0040 |
|
static |
◆ MOUSEEVENTF_MOVE
| const int BioImager.Win32.MOUSEEVENTF_MOVE =0x0001 |
|
static |
◆ MOUSEEVENTF_RIGHTDOWN
| const int BioImager.Win32.MOUSEEVENTF_RIGHTDOWN =0x0008 |
|
static |
◆ MOUSEEVENTF_RIGHTUP
| const int BioImager.Win32.MOUSEEVENTF_RIGHTUP =0x0010 |
|
static |
◆ MOUSEEVENTF_WHEEL
| const int BioImager.Win32.MOUSEEVENTF_WHEEL = 0x0800 |
|
static |
◆ MOUSEEVENTF_XDOWN
| const int BioImager.Win32.MOUSEEVENTF_XDOWN =0x0080 |
|
static |
◆ MOUSEEVENTF_XUP
| const int BioImager.Win32.MOUSEEVENTF_XUP =0x0100 |
|
static |
◆ WM_KEYDOWN
| const int BioImager.Win32.WM_KEYDOWN = 0x100 |
|
static |
◆ WM_KEYUP
| const int BioImager.Win32.WM_KEYUP = 0x101 |
|
static |
The documentation for this class was generated from the following file:
- F:/repos/BioImager/BioImager/Source/Win32.cs