Can the cockpit windows on commercial airliners open during flight?
I'm sure that the cabin pressure difference prevents this at altitude when the cabin is pressurized, due that they often slide inwards and then to the side.

That being said, Boeing produced a video showing that it's no problem flying with an open window on the 737 if say it opens on takeoff. You can close it assuming it's not damaged or you can land with it. They also showed that the side window can be opened in flight in case for instance visibility is impaired through the main window, and while it hardly looks comfortable, it can be done. This assumes that the cabin is unpressurized.

The sort of thing you might be thinking about is a cooper vane, but I don't think any aircraft have those on the cockpit windows.