here is an example (and explanation) of the windows API's..

i hope this makes it clear.