In order to investigate the formation of radio emitting shock waves above flaring active regions, we combine spectral and imaging observations of type II radio events with X-ray imaging and full-Sun observations and, in one case, with the extrapolated magnetic field configuration in the corona. We confirm and extend earlier findings that type II bursts are emitted above active region loops seen in soft X-ray images. Sources at successively lower frequencies are non-radially displaced from the axis of the active region loops. Two new radio features identified in high resolution spectrograms establish a possible link between the type II emission and the preceding activity in the underlying corona: 1. Groups of fast drift bursts or pulsations with a restricted bandwidth are observed in coronal loops from the impulsive flare phase until the onset of the type II emission. These groups or their high frequency cut-off are found in the spectral range around the backward extrapolated type II lanes. Envelope features of the group (starting frequency and/or cut-off frequency) drift gradually to lower frequencies, at a normalized drift rate similar to the following type II lanes. The sources are located between the sites of Her emission and of the type II emission. We refer to this burst group and its envelope features as a type II precursor. 2. Immediately before the type LI emission a short(less than or equal to 1 min duration) series of narrow-band bursts occurs at frequencies between the split bands of the type II lanes. As a whole, the burst sequence has an inverted U-shaped spectral envelope. We therefore call it an are. It has fundamental-harmonic structure as the subsequent type II, burst, but no band split. The source is located near or above the summits of the coronal loops where the precursor emission occurred before, and close to the site where the type II emission starts. The ai-e feature occurs especially prior to high frequency type II bursts, i.e. type IT shocks formed at comparatively low coronal height. It is concluded that the type II burst is related to a plasma jet or a blast wave that originates in closed magnetic structures in the active region, and is first recognized during the early impulsive phase (between the onset and main maximum of the hard X-ray emission). This disturbance becomes or launches a shock wave when it attains the summit of these structures. The shock is refracted into overlying field regions, where it becomes visible through the type II emission.