| |
|
|
funkheld | Hello, good day.
i want a String a Memory-Variable stick and Sendmessage in a Process Send. there with Getmessage receive and there with Print spend. The Variable worth1& would like I in Sendmessage by a Memory-Variable supplant.
How functions the Please?
Thank you.
$MAKE CLE
$H Messages.PH
Declare h&,hd&,hd1&,ende&,wert&,worth1&,b_send&,Text$,tadr&
declare pointer#
dim pointer#,32
Declare lever ZielFenster
Proc Process
parameters hd&,hd1&
declare w&,w1&,ende&
windowtitle "empfang"
window 10,10 - 150, 150
ende& = 0
whilenot ende&
sleep 1
GetMessage
If %Message = $1000
w&=&wParam
w1&= &lParam
locate 3,1
print " " + st$(w&) + " "
setText hd&, st$(w&)
locate 5,1
print " " + st$(w1&) + " "
setText hd1&, st$(w1&)
endif
endwhile
endproc
windowtitle "send"
window 10,200-200,200
hd& = create("Text", %hWnd, "", 20, 10, 60, 20)
hd1& = create("Text", %hWnd, "", 20, 35, 60, 20)
b_send& = Create("Button",%hWnd,"send", 10, 65, 80, 24)
h&=pExec("|Prozess",hd&,hd1&)
sleep 500
ZielFenster = FindWindow("empfang")
ende& = 0
whilenot ende&
waitinput
If Clicked(b_send&)
wert&=wert&+1
worth1&=worth1&+5
String pointer#,0 = "Test"
PostMessage(ZielFenster, $1000, wert&, worth1&)
endif
endwhile
end
|
|
|
| |
|
|
|
Georg Teles | Nabend !
naja must it because a Memory-Variable his ? look times the command To MapFile on, the there since XProfan X2 (faith) ... otherwise here other example with Mapfile, the code is Steinkohle & stammt from the Community therefore have straight no Link moreover parat
Def CreateFileMapping(6) !"KERNEL32","CreateFileMappingA"
Def UnmapViewOfFile(1) !"KERNEL32","UnmapViewOfFile"
Def MapViewOfFile(5) !"KERNEL32","MapViewOfFile"
Def CloseHandle(1) !"KERNEL32","CloseHandle"
Declare h&,hd&,hd1&,ende&,wert&,worth1&,b_send&,Text$,tadr&
Declare lever ZielFenster
Declare HandleMap&, ViewPointer&, Buffer#
Proc Process
Declare HandleMap&, ViewPointer&, Buffer#
declare ende&, button&, Text$
windowtitle "empfang"
window 10,10 - 150, 150
clear ende&
button& = create("Button",%HWnd,"auslesen",5,5,100,20)
OpenMap "testmap", 4096
whilenot ende&
Waitinput
If clicked(button&)
Text$ = ReadStrFromMap()
locate 3,1
print " " + Text$ + " "
EndIf
endwhile
CloseMap()
endproc
windowtitle "send"
window 10,200-200,200
hd& = create("Text", %hWnd, "", 20, 10, 100, 20)
b_send& = Create("Button",%hWnd,"send", 10, 65, 80, 24)
h&=pExec("|Prozess")
sleep 500
ZielFenster = FindWindow("empfang")
clear ende&
OpenMap "testmap", 4096
whilenot ende&
waitinput
If Clicked(b_send&)
Text$ = "testtext "+Str $(rnd(200))
Settext hd&,Text$
WriteStrToMap(text $)
endif
endwhile
CloseMap()
end
Proc OpenMap
Parameters MapName$, Size&
HandleMap& = CreateFileMapping($FFFFFFFF,0, 402653188,0,Size&,Addr(MapName$))
If HandleMap& <= 0
MessageBox("Error at create the Mappings !","Fehler",16)
Else
ViewPointer& = MapViewOfFile(HandleMap&, 983071, 0, 0, 0)
Case ViewPointer& = 0 : MessageBox("Error at create the Views !","Fehler",16)
Endif
ENDPROC
Proc WriteStrToMap
Parameters Text$
Declare OldBuffer&
If ViewPointer& <> 0
Dim Buffer#, Len(Text$)
OldBuffer& = Buffer#
Buffer# = ViewPointer&
Char Buffer#,0 = Text$
Buffer# = OldBuffer&
Dispose Buffer#
EndIf
ENDPROC
Proc ReadStrFromMap
Declare Result$, OldBuffer&
If ViewPointer& <> 0
Dim Buffer#, 512
OldBuffer& = Buffer#
Buffer# = ViewPointer&
Result$ = String $(Buffer#,0)
Buffer# = OldBuffer&
Dispose Buffer#
EndIf
Return Result$
ENDPROC
Proc CloseMap
UnMapViewOfFile(ViewPointer&)
CloseHandle(HandleMap&)
ENDPROC
Hello |
|
|
| |
|
|
|
| @Funkheld:
wm_copydata (example) is the Special Message, with the one Speicherbereiche of Process To Process copy can. |
|
|
| |
|
|
|
funkheld | Yes thanks for Help.
How can this Please still in XProfan umsetzen: [...]
thanks.greeting |
|
|
| |
|
|
|
| Beispiellink I had settled: [...] |
|
|
| |
|
|