How can I counteract the effects of WD-40?
You can remove the oil film with a rag or paper towel soaked in some organic solvent like isopropyl alcohol.

Don't these windows have any stop so they can be left ajar without blowing open? It might be good to install something like that instead. A long hook and eyelet would be the simplest.