Buena tarde... tengo la versión 23.05... es posible obtener la clase whatpSapp, mencionada en la última version de fwh---
Gracias
JONSSON RUSSI
// whatsapp app must be installed and opened before running this code
#include "FiveWin.ch"
#define ORANGES "https://www.jesmondfruitbarn.com.au/wp-content/uploads/2016/10/Jesmond-Fruit-Barn-Oranges.jpg"
function Main()
local cPhone := ""
local cMsg := "Hello"
if EDITVARS cPhone, cMsg
SendToWhatsApp( AllTrim( cPhone ), AllTrim( cMsg ), ;
{ "..\bitmaps\007.bmp", ORANGES, ;
"https://www.google.co.in/" } )
endif
return nil
function SendToWhatsApp( cPhone, cMsg, aAttach )
local oShell, hBmp
local aSend := {}
if Empty( cPhone ); return .f.; endif
DEFAULT cMsg := "Hello"
if !Empty( aAttach )
if !HB_ISARRAY( aAttach ); aAttach := { aAttach }; endif
AEval( aAttach, <|c,i|
if HB_ISSTRING( c )
if !Empty( hBmp := FW_ReadImage( nil, c, , .t. )[ 1 ] )
AAdd( aSend, hBmp )
else
AAdd( aSend, CRLF + c )
endif
endif
return nil
> )
endif
cMsg := StrTran( cMsg, CRLF, "%0D%0A" )
oShell := CreateObject( "WScript.Shell" )
ShellExecute( 0, "Open", "whatsapp://send?phone="+cPhone+"&text="+cMsg )
SysWait( 0.5 )
AEval( aSend, <|u|
if FW_CopyToClipBoard( u )
SysWait( 1 ); oShell:SendKeys( "^v" ); SysWait( 1 )
endif
return nil
> )
oShell:SendKeys("~")
return nil
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 56 guests