convert GLFWwindow* to IntPtr

C++
// C++/CLR
// Convert to IntPtr
IntPtr ptr(window);

// Convert back to GLFWwindow*
(GLFWwindow*) ptr.ToPointer();
Source

Also in C++: