I think you can use the CopyMemory API
Take a look at the address for how to use ithttp://www.vbapi.com/ref/c/copymemory.html