I would see if something like a stick on fridge magnet cut down would trigger it and affix that to the bottom of the window. Then I would drill through the bottom sill for the sensor. That way no drilling into the window itself.
I would be hesitant to go into the sill or the window it self. I worry about the integrity of the weather protection and the overall integrity of the window. You should look at the Quirky Trippers. Thus far they are the smallest and compact sensors I’ve found along with being very aesthetically pleasing, and the custom device type works like a charm. Not to mention they are $40 for 2!
Assuming you mean sliders not double hung. If they are original windows you run the risk of perforating the flashing which is there to force moisture around the window down to the bottom weep holes. Retros you may be ok as there is normally a pretty good gap.