How can I programmatically set the screen resolution?

No idea just search in the forum or Google it, I found this