Thank you for telling me nothing about the code. Couold you please give an example for me to work off of. You have sadi nothing about the actual code, only about how the code is different for different OS's and asking why I would want to use it.
I'm not trying to be rude or unhelpful, I'm just trying to point out that this is in no way simple. It's so annoyingly complex that I don't know what the code is off the top of my head. Have you tried googling it?