Well to begin with, it would depend on your OS/Compiler.

But let's have a guess at the win32 API and go with
http://msdn2.microsoft.com/en-us/library/aa364407.aspx