private void SetBaseline(PInvoker wrapper) { wrapper.DllName = ""; wrapper.DllNamePrefix = ""; wrapper.DllNameSuffix = ""; wrapper.DllPath = ""; wrapper.MethodNameTransform = NameTransforms.NoOp; wrapper.MethodNamePrefix = ""; wrapper.MethodNameSuffix = ""; }
void Timer1Tick(object sender, EventArgs e) { ticks--; if (ticks == 0) { var p = new POINT(); p.X = Control.MousePosition.X; p.Y = Control.MousePosition.Y; var hwnd = PInvoker.WindowFromPoint(p); lblResult.Text = "Window hwnd: " + hwnd.ToString(); ticks = 5; } lblTimeLeft.Text = ticks.ToString(); }
static void Main(string[] args) { HandlerRoutine handlerRoutine = new HandlerRoutine(ConsoleCtrlCheck); if (Environment.OSVersion.Platform == PlatformID.Win32NT) { PInvoker.SetConsoleCtrlHandler(handlerRoutine, true); } ServiceMain instance = new ServiceMain(); _Runner = new BasicServiceRunner(instance, args); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); _Runner.RunService(true); GC.KeepAlive(handlerRoutine); }
private void NotificationForm_Load(object sender, EventArgs e) { PInvoker.SetForegroundWindow(this.Handle); }