How do I get the handle fo an OpenGL window?

After creating a window via glutCreateWindow(), how can i get the handle of this window?

You can’t. There are different window managers (win32, X etc.) around and libraries like GLUT are created to hide that differences. If you work with Windows, you could try to obtain the DC of the current window by using wglGetCurrentDC, but I don’t know any win32 function that would retrieve the window handle from a dc… My advice: if you need the window handle, create your window manually.

OK, I will take a try, int fact, I want to retrive the default value of an OpenGL window’s position and dimension, so I use the Win32 function GetWindowInfo, but you know the first parameter of this function is the window’s handle, so I need it, maybe there is something else can perform this, I don’t know.

Thank you !

Try:
wglGetCurrentDC
Then
WindowFromDC

http://msdn2.microsoft.com/en-us/library/ms534898.aspx