Whatsapp

User avatar
Enrico Maria Giordano
Posts: 9053
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 43 times
Contact:

Re: Whatsapp

Post by Enrico Maria Giordano »

Thank you, we will try it. What is "WhatsApp - Escritorio"?
russimicro
Posts: 413
Joined: Sun Jan 31, 2010 3:30 pm
Location: Bucaramanga - Colombia
Been thanked: 5 times

Re: Whatsapp

Post by russimicro »

App local .. como cualquier app nuestra para plataforma windows----

la otra opcion es como un servicio web

https://www.whatsapp.com/download?lang=es
User avatar
Enrico Maria Giordano
Posts: 9053
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 43 times
Contact:

Re: Whatsapp

Post by Enrico Maria Giordano »

Ah, ok, the normal Whatsapp app for Windows, thank you.
wartiaga
Posts: 254
Joined: Wed May 25, 2016 1:04 am
Been thanked: 2 times

Re: Whatsapp

Post by wartiaga »

russimicro wrote: Sun Jun 29, 2025 11:52 am Buen día..

Este Código me funciona --- TOMADO DEL FORO

Code: Select all | Expand

// REQUIERE VERSION WhatsApp - Escritorio
 
FUNCTION PRUEBA__WhatsApp()


LOCAL cPhone := "57"+"325874510"  // NO HACER PRUEBAS CON EL MISMO NUMERO DE QUIEN ENVIA
LOCAL cMenEnv := "Anexo factura de venta en formato PDF"
LOCAL cNomFil := "e:\temp\FACTURA_SP1012.PDF"
       
enviaLinkWhatsApp(ALLTRIM(cPhone),cMenEnv,cNomFil)

RETURN 


//***********************************************************

function enviaLinkWhatsApp(cPhone,cMsg,cFilPdf)

   LOCAL aImgEnv := {}


   IF !FILE(cFilPdf)
      ALERTA("Aviso. Archivo a transferir no existe : "+cFilPdf)
   ENDIF

   IF cFilPdf <> NIL .AND. !EMPTY(cFilPdf)
      aImgEnv := {cFilPdf}
   ENDIF

   IF !EMPTY(cPhone)

      _SendToWhatsApp( AllTrim( cPhone ), AllTrim( cMsg ),  aImgEnv )


   ELSE
      ALERTA("Aviso. Falto el n£mero para WhatSapp ")
   ENDIF


return nil


//****************************************************

function _SendToWhatsApp( cPhone, cMsg, aAttach )

   local oShell
   local aFiles   := {}
   local aOthers  := {}


   if Empty( cPhone ); return .f.; endif

   DEFAULT cMsg := "Hello"

   if !Empty( aAttach )

      if !HB_ISARRAY( aAttach ); aAttach := { aAttach }; endif

      AEval( aAttach, {|c| if( HB_ISSTRING( c ) .and. File( c ), ;
            AAdd( aFiles, c ), AAdd( aOthers, c ) ) } )

   endif

   cMsg  := StrTran( cMsg, CRLF, "%0D%0A" )

   oShell := CreateObject( "WScript.Shell" )
   ShellExecute( 0, "Open", "whatsapp://send?phone="+cPhone+"&text="+cMsg )

   SysWait( 0.2 )


   if !Empty( aFiles )
      if FW_CopyToClipBoard( aFiles, 15 )
         SysWait( 2 ); oShell:SendKeys( "^v" ); SysWait( 1 )
      endif
   endif


   AEval( aOthers, <|u|
      if FW_CopyToClipBoard( u, 2 ) .or. FW_CopyToClipBoard( u )
         SysWait( 1 ); oShell:SendKeys( "^v" ); SysWait( 1 )
      endif
      return nil
      > )
   SysWait( 1 )
   oShell:SendKeys("~")


return nil

//********************************************


Hola, funciona muy bien. ¿Se puede enviar a un grupo de WhatsApp? Gracias.
vinpug
Posts: 22
Joined: Thu Apr 23, 2020 12:41 pm
Been thanked: 1 time

Re: Whatsapp

Post by vinpug »

Hi, I tried using the program, but I could only send messages; attachments didn't arrive. No errors were reported; messages simply arrived without attachments. I'd also like to know if it's possible to automatically close the WhatsApp window that opens when you send a message. Thanks.
User avatar
Otto
Posts: 7020
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 100 times
Been thanked: 91 times
Contact:

Re: Whatsapp

Post by Otto »

FindWindow/PostMessage WM_CLOSE
vinpug
Posts: 22
Joined: Thu Apr 23, 2020 12:41 pm
Been thanked: 1 time

Re: Whatsapp

Post by vinpug »

Thank you very much, Otto.
Post Reply