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:
00229148
Views:
18
>Okay, here's the answer we came up with
>
>
>** Return window handle of VB app
>lnhwnd = is_run([Form1])
>
>lclstring = "Did you get this message"
>
>
>sendmsg = RegFN('SendMessage', 'III@C', 'I')
>
>retval = CallFN(sendmsg, lnhwnd, 12, 0, @lclstring)
>
>We took this farther,
>
>The VB guys are writing the window handle of a textbox to an ini file, I'm opening the ini file and pulling that value out. I place that value in the lnhwnd variable and we can write directly to the textbox value.
>
>Thanx for your help.
hI Fred,

I have to agree with Vlad for a number of reasons. First and foremost is that I don't think that VB could process the message correctly anyway. I did, however, come across another reason. Before getting to that, I should point out that I have used SendMessage() from FPW using HWND_BROADCAST to cause open windows to reload a portion of the WIN.INI file with success.

The code below was used to try to shutdown VFP from FPW and FPW from VFP. From FPW it didn't work. From VFP it did.
* This doesn't work - FPW 2.6/Win95
SET LIBRARY TO FOXTOOLS ADDITIVE
m.hwnd = Is_Run("Microsoft Visual FoxPro") && VFP
* Note this was also tried using I as the data type with no difference
m.sendmsg = RegFN("SendMessage", "LLLL", "L")
* 16 is WM_CLOSE
m.result = CallFN(m.sendmsg, m.hwnd, 16, 0 , 0) && returns 0
* This does work - VFP 6.0/Win95
lnhwnd = Is_Run32("Microsoft FoxPro") && FPW
DECLARE INTEGER SendMessage IN Win32API;
  INTEGER hwnd, INTEGER umsg, INTEGER wparam, INTEGER, lparam
lnresult = SendMessage(lnhwnd, 16, 0 , 0) && returns 0 also
I also tried from FPW to use WM_QUIT, WM_DESTROY, WM_QUERYENDSESSION without succeeding.

As I said orignally, I think the best way to accomplish this is via DDE.

Sorry,
George

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

Click here to load this message in the networking platform