public void NativeWindow_WndProc_InvokeWithoutHandle_Nop(int msg) { using (new NoAssertContext()) { var window = new SubNativeWindow(); var m = new Message { Msg = msg, Result = (IntPtr)1 }; window.WndProc(ref m); Assert.Equal(IntPtr.Zero, m.Result); } }
public void NativeWindow_WndProc_InvokeWithCreatedHandle_Success(int msg) { var window = new SubNativeWindow(); window.CreateHandle(new CreateParams()); try { var m = new Message { Msg = msg, Result = (IntPtr)1 }; window.WndProc(ref m); Assert.Equal(IntPtr.Zero, m.Result); } finally { window.DestroyHandle(); } }
public void NativeWindow_WndProc_InvokeWithValidAssignedHandle_Success(int msg) { using var control = new Control(); var window = new SubNativeWindow(); window.AssignHandle(control.Handle); try { var m = new Message { Msg = msg, Result = (IntPtr)1 }; window.WndProc(ref m); Assert.Equal(IntPtr.Zero, m.Result); Assert.Equal(control.Handle, window.Handle); } finally { window.ReleaseHandle(); } }