TLODBC_sHell had this kind of code with 3 panes:
dx and dy are just delta of mouse positions against drag X Y positions.
void OnLButtonDown(HWND hWnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
{
int dx, dy;
SetCapture(hWnd);
dx = x - uDragX;
if (dx > - 10 && dx < 10)
bDragX = TRUE;
dy = y - uDragY;
if (dy > - 10 && dy < 10)
bDragY = TRUE;
}
void OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags)
{
ReleaseCapture();
bDragX = FALSE;
bDragY = FALSE;
}
void OnMouseMove(HWND hWnd, int x, int y, UINT keyFlags)
{
RECT rc;
BOOL bMove;
int dx = x - uDragX;
int dy = y - uDragY;
if (dx > -5 && dx < 5)
SetCursor(LoadCursor(NULL, IDC_SIZEWE));
else if (dy > -5 && dy < 5)
SetCursor(LoadCursor(NULL, IDC_SIZENS));
else
SetCursor(LoadCursor(NULL, IDC_ARROW));
bMove = FALSE;
GetClientRect(hWnd, &rc);
if (bDragX && !bDragY) // X
{
if (x > 50 && x < (rc.right - 50))
{
uDragX = x;
bMove = TRUE;
}
}
if (bDragY && !bDragX) // Y
{
if ((y > 50) && y < (rc.bottom - 50))
{
uDragY = y;
bMove = TRUE;
}
}
if (bMove)
{
ReSizeWindows(hWnd);
}
}