public static void SubclassHWnd(IntPtr hWnd) { Logs.InfoFormat("[PID:{0}] Sandbox.Bootstrap: Setup Keyboardhook ({1})", Sandbox.Pid, Process.GetCurrentProcess().MainWindowHandle.ToString()); NewWndProc = MyWndProc; OldWndProc = SetWindowLong(hWnd, GWL_WNDPROC, NewWndProc); }
void SubclassHWnd(IntPtr hWnd) { // hWnd is the window we want to subclass..., create a new delegate for the new wndproc newWndProc = new Win32WndProc(MyWndProc); // subclass oldWndProc = SetWindowLong(hWnd, GWL_WNDPROC, newWndProc); }
public void StartSubclass(IntPtr hWnd) { // delegate for the new wndproc newWndProc = new Win32WndProc(MyWndProc); if (oldWndProc.ToInt32() != 0) { SetWindowLong(hWnd, GWL_WNDPROC, newWndProc); } else { oldWndProc = SetWindowLong(hWnd, GWL_WNDPROC, newWndProc); } }
internal static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, Win32WndProc newProc);
public static extern IntPtr SetWindowLong(IntPtr hWnd, uint nIndex, Win32WndProc newProc);
private void StopSubclass() { if (WBIEServerHandle().Equals(m_NullPointer)) return; WinApis.SetWindowLong(m_hWBServerHandle, WinApis.GWL_WNDPROC, oldWndProc); oldWndProc = IntPtr.Zero; newWndProc = null; m_Subclassed = false; }
private void StartSubclass() { if (WBIEServerHandle().Equals(m_NullPointer)) return; // delegate for the new wndproc newWndProc = new Win32WndProc(MyWndProc); //if (oldWndProc.ToInt32() != 0) // SetWindowLong(m_hWBServerHandle, WinApis.GWL_WNDPROC, newWndProc); //else oldWndProc = SetWindowLong(m_hWBServerHandle, WinApis.GWL_WNDPROC, newWndProc); m_Subclassed = true; }
void SubclassHWnd(IntPtr hWnd) { // hWnd is the window you want to subclass..., create a new // delegate for the new wndproc newWndProc = new Win32WndProc(MyWndProc); // subclass oldWndProc = SetWindowLong(hWnd, GWL_WNDPROC, newWndProc); IsGetHWnd = false; }
public void StartSubclass(IntPtr hWnd) { // delegate for the new wndproc newWndProc = new Win32WndProc(MyWndProc); if (oldWndProc.ToInt32() != 0) SetWindowLong(hWnd, GWL_WNDPROC, newWndProc); else oldWndProc = SetWindowLong(hWnd, GWL_WNDPROC, newWndProc); }
private bool AssignHandle() { _thisWndProc = WndProc; _oldWndProc = SetWindowLong(_sendHandle, GWL_WNDPROC, _thisWndProc); return _oldWndProc != IntPtr.Zero; }
static extern IntPtr SetWindowLong(IntPtr hwnd, int nindex, Win32WndProc newproc);
void SubclassHWnd(IntPtr hWnd) { newWndProc = new Win32WndProc(MyWndProc); oldWndProc = SetWindowLong(hWnd, GWL_WNDPROC, newWndProc); }