Name for a device that prevents the user from operating something incorrectly

Solution 1:

The standard term used in all types of industry for this is an interlock.

Interlocks can be implemented with software, electrical circuitry, or by mechanical means.

An example of a software interlock is a piece of code which checks a number of variables before allowing a certain action to execute.

An electrical interlock is usually a chain of sensors, switches, or relays that have to be set in the correct state to allow an operation to take place. A common example is the sensors in elevator doors which prevent them from crushing a person when they sense someone is obstructing the door's automatic closing, or to prevent the doors from opening while the elevator is in motion or stopped between floors.

Mechanical interlocks are physical devices that prevent a mechanical system from entering an unwanted state. Locking bearings and corresponding grooves in the gear selector shafts of a manual transmission, for example, prevent more than one gear from being selected at a given time.

The linked wikipedia article is not entirely accurate - it suggests the term is more specific than it actually is in practice. For example, it says :

For example, in a typical household microwave oven, the switch that disables the magnetron if the door is opened is not an interlock.

While I think in practice most engineers I know would certainly refer to such devices as interlocks, formally. The article's talk section has some good citations on the erroneous nature of that particular statement.

Solution 2:

The term used by the UK Government Health and Safety Executive is 'safeguards'.

[Under 'What do I have to do ?'. . . Before you start.]

Check that the machine is complete, with all safeguards fitted, and free from defects. The term ‘safeguarding’ includes guards, interlocks, two-hand controls, light guards, pressure-sensitive mats etc. By law, the supplier must provide the right safeguards and inform buyers of any risks ('residual risks') that users need to be aware of and manage because they could not be designed out

HSE

Solution 3:

There is an enormous variety of such devices, so the terminology varies depending on the particular usage, but here are some blanket terms:

Interlock

A mechanical device or system architecture which requires some external set of requirements to be met in order to continue operation. In the example you gave, the device which prevents the handle from turning with the sash open is the interlock. In this case, it is a safety interlock.

Source: I'm an aerospace engineer

A safety interlock can be a:

Behavior-shaping constraint

These constraints force the user to make the device safe, often by way of an interlock. For example, in manual transmissions, there is an interlock which requires the driver to depress the clutch petal before starting the vehicle. This system is a behavior-shaping constraint, since the driver soon learns the process, and instinctively makes the system safe.

https://en.wikipedia.org/wiki/Behavior-shaping_constraint

Poka-Yoke

Borrowed from Japanese, poka-yoke means "mistake-proofing" or "inadvertent error prevention". Specifically, it is a design wherein a system will bring the operator's attention to improper conditions. Thus, a poka-yoke doesn't actually prevent misuse like an interlock does, but instead relies on the operator to correct the condition.

For example: when keys are left in an automobile ignition, modern vehicles will make a persistent dinging sound when the driver door is open in an attempt to alert the driver, who might otherwise lock the keys in the vehicle.

This is in contrast to an interlock, which would instead prevent the doors from locking while the key is in the ignition.

https://en.wikipedia.org/wiki/Poka-yoke

Defensive-Design

This is the the general design principle which attempts to predict ways a device could be misused, and designing in a way which makes such misuse difficult or impossible. https://en.wikipedia.org/wiki/Defensive_design

Solution 4:

I agree with many of the other answers here in regards to a generic term, but there is a term that relates specifically to your examples that I have not seen.

Stop

A "stop" is a piece on a mechanical device that prevents it from moving too far. The window handle would have a stop that prevents you from turning it too far, and the hinge of the window itself would have a stop that prevents it from opening too far. This is also used for a "door stop" that keeps the door from hitting a wall.