[For example, cooking wine.]
Wine is produced to be drunk and as an offshoot it is put into food for ‘flavour’. As has been clearly shown by the other posts, we should stay away from any form of alcohol, which also includes not eating food prepared with it. When in France, a wine imbibing society, stay away from their food!
There is a tendency for humans to take the easy option, trying to outthink others without any benefit except self satisfaction. When there is ample food to eat without the added wine, consume this. Why sail against the wind? Why come up with excuses for doing something when the normal understanding is straight forward? Why risk it?
Some medicines have alcohol in them so that the active ingredients can be delivered to the human body in a proper manner. If there are alcohol free alternatives, then use these; if not, then the according to the Quran the greater good clause is enacted, so taking the medicine outweighs the risk of the alcohol so we can take them. The same goes for medicines in capsule form which have gelatine as an ingredient. This is sometimes derived from animal sources and some people will not take their medication because of this, risking their health and well being. If no alternatives exist, then the greater good prevails, but try explaining that to a Muslim patient!
As a general rule, stay away from intoxicants, stay away from animal products, and stay away from haram.