Using Native SetWindowPos function

I wanted to resize video window by mouse wheel scrolling. So I set new value to the Width property and new value to the Height property, but I've got flickering.
When we set new Width property window is redrawing and when we set new Height property window is redrawing again.

That's why I decided to use native function to set this values immediatly.

To get window handle you need to use WindowInteropHelper.

WindowInteropHelper helper = new WindowInteropHelper(this);
SetWindowPos(helper.Handle, IntPtr.Zero, (int)this.Left, (int)this.Top, (int)newWidth, (int)newHeight, SWP.SHOWWINDOW);

Last edited Sep 18, 2010 at 2:41 PM by Denis_Yakimenko, version 6


No comments yet.