Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API Call - SENDMESSAGE()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00228861
Message ID:
00229155
Vues:
20
>>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.
>

I'm assuming that there's an extra , in the declare at the end; there are only 4 integer parameters.

It may be that the Win16 implementation of SendMessage can only talk to other Win16 applications. Under Win16, all Win16 apps run in a single Virtual Machine, and key features of the Win16 subsystem as well as the address space are shared. Each Win32 application has its own VDM and an isolated 32 bit address space. Have you tried killing an FPW session from FPW? If you can, then it's likely that the Win16 implementation doesn't get applied outside the Win16 environment.

>As I said orignally, I think the best way to accomplish this is via DDE.
>
>Sorry,
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform