English
Forum

String-Memory-Variable with Sendmessage in a Process transfer...?

 

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
 
04/07/16  
 




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
 
XProfan X3
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

04/08/16  
 



@Funkheld:

wm_copydata (example) is the Special Message, with the one Speicherbereiche of Process To Process copy can.
 
04/08/16  
 




funkheld
Yes thanks for Help.

How can this Please still in XProfan umsetzen: [...] 

thanks.greeting
 
04/08/16  
 



Beispiellink I had settled:  [...] 
 
04/08/16  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.098 Views

Untitledvor 0 min.
H.Brill10/17/22
iF06/03/18
rquindt03/04/18
Peter Max Müller12/19/17
More...

Themeninformationen

this Topic has 3 subscriber:

funkheld (2x)
iF (2x)
Georg Teles (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie