BExplorer.Shell.RestoreWindowActivator.ActivateForm C# (CSharp) Method

ActivateForm() public method

public ActivateForm ( Window form, Window window, IntPtr hwnd ) : void
form System.Windows.Window
window System.Windows.Window
hwnd System.IntPtr
return void
		public override void ActivateForm(Window form, Window window, IntPtr hwnd) {
			var fHandle = (PresentationSource.FromVisual(form) as HwndSource).Handle;
			var wHandle = (PresentationSource.FromVisual(window) as HwndSource).Handle;
			if (window == null || wHandle != fHandle) {

				// set as active form in task bar
				User32.ShowWindow(fHandle, User32.ShowWindowCommands.Restore);
				User32.SetForegroundWindow(fHandle);

				// stop flashing...happens occassionally when switching quickly when activate manuver is fails
				Shell32.FlashWindow(fHandle, 0);
			}
		}
	}
RestoreWindowActivator