Send string between apps

Just starting out? Need help? Post your questions and find answers here.
Cyllceaux
Enthusiast
Enthusiast
Posts: 511
Joined: Mon Jun 23, 2014 1:18 pm

Re: Send string between apps

Post 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
ZX80
Enthusiast
Enthusiast
Posts: 365
Joined: Mon Dec 12, 2016 1:37 pm

Re: Send string between apps

Post by ZX80 »

Cyllceaux, thanks for reply. It's interesting, but...
You talk about shared memory, but I asked about global buffer.
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 283
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: Send string between apps

Post 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
Proud supporter of PB! * Musician * C64/6502 Freak
ZX80
Enthusiast
Enthusiast
Posts: 365
Joined: Mon Dec 12, 2016 1:37 pm

Re: Send string between apps

Post 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?
Post Reply