Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
API Call - SENDMESSAGE()
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00228861
Message ID:
00228928
Views:
18
>>>Has anyone gotten the SENDMESSAGE() aAPI call to work?
>>>
>>> I need to send a text message to a VB 6.0 app from FPW2.6. I was hoping to use the SENDMESSAGE() API call, but I cannot get the correct syntax.
>>>
>>>Basically I'm using the following code.
>>>
>>>x=SENDMESSAGE(lnwindhand, wm_command, em_settext,lcmsg)
>>>
>>>lnwindhand is the window handle of the app I'm sending the message to.
>>>wm_command, I need the hex value of this
>>>em_settext, I need the hex vcalue for this.
>>>lcmsg = "1234568,Houston,Tx,Elm&Main"
>>>
>>>Help please.
>>
>>Hi Fred,
>>
>>I don't think you're going to have any success in trying to use SendMessage() to do this, especially in view of the way VFP handles windows messaging. However, there is an alternative that will do what you want, and, BTW, uses Windows messaging services: DDE. DDESetTopic() allows you to define a UDF name that can receive the messages. If the FPW app does need to receive messages back, you'll only have to initiate the connection with the VFP using the native commands. No need for foxtools and declaring the function.
>
>
>
>
>
>Sorry, I used the wrong source code. I'm using Foxtools with regfn() and callfn(). I cannot use VFP, the app is written in FPW2.6. The VB programmers don't want to add DDE to their app because the FPW 2.6 app is being replaced in 6~8 months. The RegFn is returning an error (Invalid function).
>
>sendmsg = regfn("SendMessage","CI","I","CI")
>
>retval = callfn(sendmsg,0,0,lnhwnd,lcmsg)

Fred,

Oh, VB programmers, I understand< g >.

Here's the declaration and a call to try:
* If strings are being passed as the wparam and lparam values
sendmsg = RegFN('SendMessage', 'II@C@C', 'I')
* lnhwnd is the handle of the Window to send it to
* lcwstring/lclstring are the strings to send
retval = CallFN(sendmsg, lnhwnd, 0, @lcwstring, @lclstring)
Let me know how that works for the VB guys.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform