[Objective] Using carbon dioxide to enhance oil and gas recovery has the potential to generate significant economic benefits. However, our understanding of the interactions between carbon dioxide, water, oil, and rock under high-temperature and high-pressure conditions is still very limited. Therefore, it is necessary to conduct in-depth research on the trends of contact angles with temperature and pressure changes in the coexistence of gas, water, and oil multiphase flow under such conditions. [Method]Using a visual contact angle measurement experimental setup, the contact angles of CO2-water-hexadecane within a quartz capillary are measured under stable gas and liquid conditions at various temperatures and pressures. [Results] The results show that in the quartz capillary tube, the CO2-water-quartz contact angle slightly increases with temperature, while the water-hexadecane-quartz contact angle significantly decreases with increasing temperature. Contact angles are not sensitive to pressure; the CO2-water-quartz contact angle increases with pressure, and the water-hexadecane-quartz contact angle decreases with pressure, but the changes are minimal. Moreover, the introduction of gas can alter the interfacial tension between water and hexadecane, increase the contact angle, and effectively regulate the wettability of the system. [Conclusion]In the context of CO2-EOR, the quartz surface at high temperatures is more water-wet than at low temperatures. When the temperature is raised to 120~150℃ or higher, the quartz surface can completely change from oil-wet to water-wet, which helps the oil phase flow in the pores and significantly promotes oil and gas recovery.