surport Z buffer,render some object and then read the z_buffer

some time I have abandoned my work on this topic,but now i think i should comlete it.So I want my project surport z buffer,but under windous(not use glut),then render some objects and then scan the z buffer to obtain the data.
please anybody help me,one tiny branch or simple example is very useful. Thank you!

glEnable( GL_DEPTH_TEST );
glDepthMask(1);
glClear( all );
draw someit
glReadPixels(… GL_DEPTH_COMPONENT … );

Thank you!
A algorithm said:
glutInitDisplayMode(GLUT_DEPTH) is need,
but glut doesn`t fit windouws(VC frame work)
so is it needed?
And can this algorithm make sure it is hardware acceleration?
Thank you!

When you are selcting the pixelformat for your window, make shure you set the depth bit parameter in the pixeldescriptor to a value greater then zero. Current hardware usually supports 24bit depth buffer. To check your pixelformat for a depth buffer use DescribePixelFormat and test the corresponding parameter of the pixeldescriptor record.
Depth buffers are supported by all 3d hardware singe 15 years, so accleleration won’t be a problem. oO

the capacity can be set? and the area?
that means i want to desingate special area ,set its capacity and get its z-buffer. Is it doable?

I don’t quite understand what are you talking about :-/

The depth buffer is common for the whole window. Once you set it’s capacity (bit depth) it is constant.
To get data from the depth buffer use ReadPixels.

I hope you do know how to set OpenGL up in a window, if not - just google for it. MSDN library also has some nice examples.