Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Whatsapp unicode
Message
De
02/11/2020 06:24:29
 
 
À
02/11/2020 04:12:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Divers
Thread ID:
01676908
Message ID:
01676936
Vues:
38
Tariq,

It would be something like
comando='whatsapp://send?phone=' + m.cPhone + '&' + 'text=' + URLEncode(m.cMessage)
Is your message already encoded in UTF-8? If so, the above will do. If not, you must encode it beforehand, adjusting to the regional settings and/or code page of your textual data.

>Sir I prepared codes but do not know how to use your FUNCTION URLEncode with my string
>
>
>Declare  Integer FindWindow In WIN32API String , String
>Declare  Integer SetForegroundWindow In WIN32API Integer
>Declare  Integer  ShowWindow  In WIN32API Integer , Integer
>Declare Integer ShellExecute In shell32.Dll ;
>	INTEGER hndWin, ;
>	STRING cAction, ;
>	STRING cFileName, ;
>	STRING cParams, ;
>	STRING cDir, ;
>	INTEGER nShowWin
>
>Local lt, lhwnd
>
>cPhone=[923456857062]
>
>
>#define CRLF CHR(13)+CHR(10)
>
>
>cMessage=Alltrim('ãÍÊÑã'+Space(1)+Alltrim('ãÍãÏ ÇÑÔÏ');
>				+space(5)+Alltrim("(")+Alltrim(Str(2400))+Alltrim(")");
>				+space(5)+Alltrim("ÇÓáÇã Úáí˜ã")+space(5);
>				+Space(1)+Alltrim('Àã äÿ ÂÌ')+Space(1)+;
>				ALLTRIM(Padl(Substr(Alltrim(Dtoc({^2020-10-10})),7,2),2,'0')+Alltrim('-');
>				+Padl(Substr(Alltrim(Dtoc({^2020-10-10})),4,2),2,'0')+Alltrim('-')+Padl(Substr(Alltrim(Dtoc({^2020-10-10})),1,2),2,'0'));
>				+Space(1)+Alltrim('˜æ ')+;
>				+Space(1)+Alltrim('˜í')+Space(1)+Alltrim('íäŠ ÔÑŠ')+Space(1)+Alltrim('˜Ç ÂяÑ')+Space(1)+Alltrim(Str(115));
>				+Space(1)+Alltrim('Ș ˜ÑáíÇ Àÿ ÌÓ˜í æǁÓí ˜í ÊÇÑíÎ')+Space(1);
>				+ALLTRIM(Padl(Substr(Alltrim(Dtoc({^2020-10-10})),7,2),2,'0')+Alltrim('-');
>				+Padl(Substr(Alltrim(Dtoc({^2020-10-10})),4,2),2,'0')+Alltrim('-')+Padl(Substr(Alltrim(Dtoc({^2020-10-10})),1,2),2,'0'));
>				+Space(1)+Alltrim('Àÿ');
>				+space(5)+Alltrim('ÇæÑ Â˜Ç ÈíáäÓ')+Space(1);
>				+Alltrim(Str(1500))+Alltrim('-')+Space(1)+Alltrim('Àÿ');
>				+space(5)+Alltrim('À㠁 ˜ÿ ÇÚÊãÇÏ ÇæÑ ÊÚÇæä ˜ÿ áíÆÿ ԘѐÒÇÑ ÀíŸ');
>				+space(5)+Alltrim('Àíæä ŠíáÑÒ ÈÀÇæá æÑ');
>				+space(5)+Alltrim("3190509-0301"))
>
>
>comando='whatsapp://send?phone=&cPhone&text=&cMessage'
>
>
>=ShellExecute(0, 'open', comando,'', '', 1)
>
>Wait "" Timeout 3
>lt = "Whatsapp"
>lhwnd = FindWindow (0, lt)
>If lhwnd!= 0 					
>	SetForegroundWindow (lhwnd) 
>	ShowWindow (lhwnd, 1)
>	ox = Createobject ( "Wscript.Shell" )
>	ox.sendKeys ( '{ENTER}' )
>	*Messagebox ( "Message Sent" )
>Else
>	Messagebox ( "Whatsapp no activated!" )
>Endif
>
>
>
>
>FUNCTION URLEncode (Text AS String, UTF8 AS Boolean) AS String
>
>	LOCAL OriginalText AS String
>	LOCAL Encoded AS String
>	LOCAL CharIndex AS Integer
>	LOCAL CharAt AS Character
>	
>	IF m.UTF8
>		m.OriginalText = STRCONV(STRCONV(m.Text,1),9)
>	ELSE
>		m.OriginalText = m.Text
>	ENDIF
>
>	m.Encoded = ""
>	FOR m.CharIndex = 1 TO LEN(m.OriginalText)
>	
>		m.CharAt = SUBSTR(m.OriginalText,m.CharIndex,1)
>		
>		IF m.CharAt $ ":/?#[]@!$&'()*+,;=%" OR !BETWEEN(ASC(m.CharAt), 33, 127)
>			m.CharAt = "%" + STRCONV(m.CharAt,15)
>		ENDIF
>		
>		m.Encoded = m.Encoded + m.CharAt
>	
>	ENDFOR
>	
>	RETURN m.Encoded
>ENDFUNC
>
>
>The original message looks like in attachment
>
>Please help
----------------------------------
António Tavares Lopes
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform