Nevermind, it's working perfectly so it must be right
Here is the whole business in C#, in case that helps anyone...
---
// Variables having to do with the resizing code follow
protected bool bSizeMode = false;
/// <summary>
/// Windows Constants for WndProc call in BeginResize/EndResize events
/// </summary>
protected const int WM_SIZING = 0x214,
WM_ENTERSIZEMOVE = 0x231,
WM_EXITSIZEMOVE = 0x232,
WM_SYSCOMMAND = 0x112,
SC_SIZE = 0xF000;
/// <summary>
/// Fires once at the beginning of a resizing drag.
/// </summary>
public event EventHandler BeginResize;
/// <summary>
/// Fires once at the end of a resizing drag.
/// </summary>
public event EventHandler EndResize;
/// <summary>
/// Process Windows messages (in this case to provide Begin/EndResize events
/// </summary>
/// <param name="m"></param>
protected override void WndProc(ref Message m)
{
switch ( m.Msg )
{
case WM_SIZING:
// Resize event already provided
break;
case WM_SYSCOMMAND:
bSizeMode = ((m.WParam.ToInt32() & 0xFFF0) == SC_SIZE);
break;
case WM_ENTERSIZEMOVE:
if ( bSizeMode )
{
OnBeginResize(EventArgs.Empty);
}
break;
case WM_EXITSIZEMOVE:
{
if ( bSizeMode )
{
OnEndResize(EventArgs.Empty);
}
break;
}
} // end switch
base.WndProc (ref m);
}
/// <summary>
/// Raise BeginResize event
/// </summary>
/// <param name="e"></param>
protected virtual void OnBeginResize(System.EventArgs e)
{
if ( BeginResize != null )
BeginResize(this, e);
}
/// <summary>
/// Raise EndResize event
/// </summary>
/// <param name="e"></param>
protected virtual void OnEndResize(System.EventArgs e)
{
if ( EndResize != null )
EndResize(this, e);
}
---