Buena tarde... tengo la versi贸n 23.05... es posible obtener la clase whatpSapp, mencionada en la 煤ltima version de fwh---
Gracias
JONSSON RUSSI
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 nilhBitmap = NViewLib32( cBmpFile , 1 )
Vs
FW_ReadImage( nil, cBmpFile, , .t. )
We do not know other libraries
But FWH's FW_ReadImage() is very powerful than any.
Saludos buen dia y gracias.
Tengo aplicaci贸n con FW 2.4 con usuarios en producci贸n y tiene personalizaciones, para este caso necesito copiar la Imagen hacia el clipboard del OS, cuento con la funcion NViewLib32( cBmpFile , 1 ) que devuelve un valor num茅rico. Necesito copiar la imagen hacia el clibboard del OS.
Igualmente posee FW actualizado y estamos compilando el nuevo binario
Saludos y gracias a la ayuda de jose Alberto alvares, voy a validar con METHOD CopyToClipboard() CLASS TBitmap
local oClipboard := TClipboard():New( CF_BITMAP )
oClipboard:SetBitmap( Self )
oClipboard:End()
return nil
Buen d铆a...
Funciona perfecto... pero tengo necesidad de enviar PDF... La idea es generar una factura y dar la opci贸n de enviar a whatsApp.
Gracias
If you have FWH2310, you can send images and any files as attachments, pdf, etc
Buen dia..
He actualizado a la fwh 23.10 y funciona perfecto....
Gracias
If you are using FWH2310, please see fwh\samples\whatsapp.prg
Use the function given in that sample program, but not the program I posted above.