Page 2 of 2

Re: Send string between apps

Posted: Wed Nov 13, 2019 11:22 am
by Cyllceaux
how about viewtopic.php?p=109501

Code: Select all

; sender
;
mapped_h = CreateFileMapping_($FFFFFFFF,0,#PAGE_READWRITE,0,1024,"shared")
mapped_p = MapViewOfFile_(mapped_h,#FILE_MAP_ALL_ACCESS,0,0,1024)
;
w_main_nr = 1
w_main_h = OpenWindow(w_main_nr,1024+10,10,100,100,"sender",#PB_Window_SystemMenu)

ListViewGadget(1,1,1,WindowWidth(0)-1,WindowHeight(0)-1)
AddGadgetItem(1,-1,"sender")
AddGadgetItem(1,-1,"")
AddGadgetItem(1,-1,Str(mapped_h))
AddGadgetItem(1,-1,Str(mapped_p))
;
Repeat
  event = WindowEvent()
  If event = 0
    Delay(20)
    n = n+1
    If n = 10
      n = 0
      nn = nn+1
      PokeL(mapped_p,nn)
      SetGadgetItemText(1,1,Str(PeekL(mapped_p)),0)
    EndIf
  EndIf
Until event = #PB_Event_CloseWindow

Re: Send string between apps

Posted: Wed Nov 13, 2019 11:38 am
by ZX80
Cyllceaux, thanks for reply. It's interesting, but...
You talk about shared memory, but I asked about global buffer.

Re: Send string between apps

Posted: Wed Nov 13, 2019 7:19 pm
by oreopa
Wolf wrote:So thanks again @JHPJHP & @oreopa & @IdeasVacuum for SendMessage codes and examples, especially @JHPJHP for great CopyData example code in "Windows Services & Other Stuff" topic, thanks man :D
I also learned it from JHPJHP stuff ;) So I guess I say thanks here to him also! :D

Re: Send string between apps

Posted: Sun Nov 17, 2019 11:41 am
by ZX80
Okay. Then I will ask you in another way. I don't need to know, what's inside global system buffer (aka clipboard). Just backup it "as is" (create an image, save this memory area in other place). Binary data package (RAW) without examination. Need to know the buffer address in memory and data size. Probably, somewhat else. It will be necessary to restore original data later. Can someone show me this trick?