Re: Poke-ing memory allocated through Windows function
- Posted by jacques deschĂȘnes <desja at globetrotter.net> Feb 18, 2006
- 541 views
Hi Jonas, here the way to use global memory for clipboard usage
-- code sample atom hGlobal, pData -- allocate global memory with flags required by clipboard hGlobal = GlobalAlloc(32,GMEM_MOVEABLE) -- lock it to ensure the system don't move it while your program is accessing it. pData = GlobalLock(hGlobal) poke(pData,"hello world"&0) GlobalUnlock(hGlobal) SetClipboardData(CF_TEXT,hGlobal) . . . GlobalFree(hGlobal) -- free it with that function when no more needed.
regards, Jacques DeschĂȘnes