During nanoindentation measurements of thin films the formation of cracks within the film as well as of pile-up or sink-in around the indent are known to affect significantly the precision of hardness and Young's modulus values. The crack pattern in brittle films and the amount of pile-up/sink-in in ductile films allow, however, also to estimate film fracture toughness and to gain knowledge on the film strain hardening behavior, respectively. The shape of the residual imprint and the extension of cracks at the surface after unloading are therefore often analyzed by atomic force microscopy or scanning electron microscopy (SEM). However, the contact area under load, the moment of crack initiation and the extension of the cracks during the loading/unloading cycle cannot be deduced unambiguously by analyzing only the residual imprint and the load-displacement data. We present a miniaturized own nanoindentation and nanoscratch device for use inside a scanning electron microscope. The indentation axis is operated at an inclined angle with respect to the SEM column. This allows looking at the surface around the indent during indentation. Crack and pile-up formation can be directly observed with sub-micrometer resolution and linked to the simultaneously recorded load-displacement data. In a first part of the paper the design concepts of the device will be discussed. In a second part, two case studies - indentation of nanocomposite TiN/SiN x coatings and indentation and scratching of hard diamond-like carbon (DLC) films - will be presented to demonstrate the potential of SEM-indentation and scratching. In the case of indentation of hard coatings, the formation of cracks during loading as well as during unloading was observed. Some cracking events could be correlated to discontinuities in the load-displacement curve. Scratch experiments revealed at which critical load coating failure occurred.