This study investigates finite-volume effects in physical processes that involve the combination of long-range hadronic matrix elements with electroweak loop integrals. We adopt the approach of implementing the electroweak part as the infinite-volume version, which is denoted as the EW\(_\infty\) method in this work. A general approach is established for correcting finite-volume effects in cases where the hadronic intermediate states are dominated by either a single particle or two particles. For the single-particle case, this work derives the infinite volume reconstruction (IVR) method from a new perspective. For the two-particle case, we provide the correction formulas for power-law finite-volume effects and unphysical terms with exponentially divergent time dependence. The finite-volume formalism developed in this study has broad applications, including the QED corrections in various processes and the two-photon exchange contribution in \(K_L\to\mu^+\mu^-\) or \(\eta\to\mu^+\mu^-\) decays.