to do this you need:
1.read
MSDN about WinAPI functions
2.look at
tutorials, search and study existing examples
3.take simple examples and modify slightly, check result
4.use debugger to understand how does your code work or why not
5.when you stuck anyway - post your work at forum and ask precise question