You can do this by setting the correct resolution in a DEVMODE structure, then calling ChangeDisplaySettingsEx to actually make the change.
You may want to use EnumDisplaySettingsEx to find a resolution supported by the display and graphics card in question.