public void Start() { Task.Factory.StartNew( () => { _hookWin = new NativeWindowEx(); _hookWin.CreateHandle( new CreateParams() ); if ( User32.RegisterShellHookWindow( _hookWin.Handle ) == false ) throw new Exception( "Win32 error" ); _wmShellhookmessage = (int)WUser32.RegisterWindowMessage( "SHELLHOOK" ); _hookWin.MessageRecieved += ShellWinProc; } ); }
public void Start() { Task.Factory.StartNew(() => { _hookWin = new NativeWindowEx(); _hookWin.CreateHandle(new CreateParams()); if (User32.RegisterShellHookWindow(_hookWin.Handle) == false) { throw new Exception("Win32 error"); } _wmShellhookmessage = (int)WUser32.RegisterWindowMessage("SHELLHOOK"); _hookWin.MessageRecieved += ShellWinProc; }); }