Re: Poke-ing memory allocated through Windows function

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu