Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Diagnostics;
- using System.Runtime.InteropServices;
- using System.Threading;
- using WindowsInput;
- using WindowsInput.Native;
- namespace ConsoleApp16
- {
- static class Program
- {
- const UInt32 WM_KEYDOWN = 0x0100;
- const int VK_F5 = 0x74;
- [DllImport("user32.dll")]
- static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);
- [STAThread]
- static void Main()
- {
- while (true)
- {
- Process[] processes = Process.GetProcessesByName("iexplore");
- foreach (Process proc in processes)
- PostMessage(proc.MainWindowHandle, WM_KEYDOWN, VK_F5, 0);
- Thread.Sleep(5000);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement