Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send messages to whatsapp from VFP
Message
From
10/04/2020 13:11:59
 
 
To
09/04/2020 12:51:32
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01674024
Message ID:
01674027
Views:
75
>hello, how are you, here is the code I use to send messages from my application via WhatsApp, it works perfect for sending text, but I have not been able to automatically attach a file, any suggestion to do so, thanks
>
>Here is my code:
>
>local lt, lhwnd
>lt = "Whatsapp"
>ox = createobject ( "Wscript.Shell" )
>wait "" timeout 3
>smensaje=strtran(alltrim(xsmensaje)," ", "%20")
>stelefono=strtran(alltrim(xstelefono),"-", "")
>comando="whatsapp://send?phone=1"+alltrim(stelefono)+"&text=%0A"+alltrim(smensaje)
>if ximagen
>	=shellexecute(0, "open", comando,"", "", 1)
>else
>	=shellexecute(0, "open", comando,"", "C:\PROYECTO", 1)
>endif
>lhwnd = findwindow (0, lt)
>if lhwnd!= 0 && Comprueba si la ventana está activada
>	setforegroundwindow (lhwnd) && Establece el foco en la ventana de la aplicación donde Tú envías la llave.
>	showwindow (lhwnd, 1)
>	ox.sendkeys ( "{ENTER}" )
>else
>	messagebox(" espere un momento por favor!!!!!!!",0,'AVISO',10000)
>	ox.sendkeys ( "{ENTER}" )
>	if ximagen
>		ox.sendkeys ("^(V)")
>	endif
>	ox.sendkeys ("%{F4}")
>endif
>ox.sendkeys ("{ENTER}")
>
>ox.sendkeys ("%{F4}")
>return 1
>
Whatsapp Business seems to have an API for that: https://developers.facebook.com/docs/whatsapp/api/messages/media
Gensoft Sàrl
Christian Carron
Previous
Reply
Map
View

Click here to load this message in the networking platform