Hi,
Just register to the StateChanged event:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.StateChanged += new EventHandler(MainWindow_StateChanged);
}
void MainWindow_StateChanged(object sender, EventArgs e)
{
MessageBox.Show(this.WindowState.ToString());
}
}