Position sensitive detectors (PSDs) based on lateral photovoltaic effect (LPE) are extremely versatile in many areas. Generally speaking, it has an optimal operating frequency which corresponding to the best sensitivity. How to effectively adjust a certain operating frequency in a fixed structure and achieve a large sensitivity improvement has always been a challenge. Here, we demonstrate an unusual selectively enhanced violet and near-infrared LPE observed in rapid thermal annealing (RTA) treated ZnO/Si homo-heterostructure. It exhibits excellent performance in the wavelength of 445 nm and 980 nm, and the optimum lateral photovoltage (LPV) sensitivity can be controlled by manipulating the annealing temperature. Notably, the optical response time of the annealed sample is increased by about 25 times compared with the as-deposited one. We attribute this anomalous effect to the defect ionization in ZnO layer, as well as the resistivity change after annealing. This work suggests an effective approach that can selectively enhance the sensitivity of PSDs in violet and infrared region. Moreover, it shows high sensitivity and fast photoresponse speed, which may open new paths toward violet and infrared photoelectric detection.