...to switch the screen resolution at the beginning of my app, but it just turns the screen black, the the cursor is still visible and appears pixelated as it would for 1024x768 resolution. I tried running this code at various points during my programs setup but nothing works, any idea on what might be causing this?

When you capture the display, you're preventing anything with a window level below the shielding level from displaying (and other apps from even knowing that there was a resolution change). You need to make your OpenGL context or window appear above it to see anything.