The mother told him not to open the window, but the boy opened it anyway.

Literal

Mother [topic-は] window [object-を] open-not [indirect-command-ようにと] said [despite-のに], that boy [topic-は] window [object-を] opened

~ないようにと言った = 'told not to do X' — the indirect command with negative. ~のに at the clause boundary means 'despite/even though,' expressing frustration that the instruction was ignored.