protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_SYSCOMMAND: int command = m.WParam.ToInt32() & 0xfff0; if (command == SC_MINIMIZE) //Window BEFORE minimized... { _presenter.RegisterState(_pContainer.VerticalScroll.Value); } break; } base.WndProc(ref m); }