Here's a WoW function for setting the resolution. Will this do the job?

SetScreenResolution