Nonlinear, i.e., multiphoton microscopy is a powerful technique for imaging deep into biological tissues. Its penetration depth can be increased further using adaptive optics. In this work, we present a fast, feedback-based adaptive-optics algorithm, termed C-DASH, for multiphoton imaging through multiple-scattering media. C-DASH utilizes complex-valued light shaping (i.e., joint shaping of amplitude and phase), which offers several advantages over phase-only techniques: it converges faster, it delivers higher image quality enhancement, it shows a robust performance largely insensitive to the axial position of the correction plane, and it has a higher ability to cope with, on the one hand, scattering media that vary over time and, on the other hand, scattering media that are partially absorbing. Furthermore, our method is practically self-aligning. We also present a simple way to implement C-DASH using a single reflection off a phase-only spatial light modulator. We provide a thorough characterization of our method, presenting results of numerical simulations as well as two-photon excited fluorescence imaging experiments. Published by the American Physical Society 2024