Can I change the order of these OpenGL / Win32 calls?

I've been adapting the NeHe OpenGL/Win32 code to be more object-oriented and I don't like the way some of the calls are structured.

The example has the following pseudo-structure:

Register window class
Change display settings with a DEVMODE
Create window
Get DC
Find closest matching pixel format
Set the pixel format to closest match
Create rendering context
Make that context current
Show the window
Set it to foreground
Set it to having focus
Resize the GL scene
Init GL

The points in bold are what I want to move into a rendering class (the rest are what I see being pure Win32 calls) but I'm not sure if I can call them after the Win32 calls.
Essentially what I'm aiming for is to encapsulate the Win32 calls into a Platform::Initiate() type method and the rest into a sort of Renderer::Initiate() method.

So my question essentially boils down to: "Would OpenGL allow these methods to be called in this order?"

Register window class
Create window
Get DC
Show the window
Set it to foreground
Set it to having focus

Change display settings with a DEVMODE
Find closest matching pixel format
Set the pixel format to closest match
Create rendering context
Make that context current
Resize the GL scene
Init GL

(obviously passing through the appropriate window handles and device contexts)

• Have you tried it, to see if it works? The only thing that I could see happening is the DC being affected by the DEVMODE. You also may want to accept some previous answers. – The Communist Duck Feb 25 '11 at 10:52
• I haven't built it yet I was exploring for advice before committing the time. Also 'working' isn't the result I need, for example it may work now then when I add complexity a serious error may occur due to not initialising the GL window in the appropriate manner. – Adam Naylor Feb 25 '11 at 14:39