Screenshot-Captura_Pantallas

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Screenshot-Captura_Pantallas

Post by mustafa »

Hola amigos:
Les presento un nuevo experimento que despues de ver los Samples
que han mandado los Maestros Roberto López y Bicahi Esgici

Despues de duras "batallas de programación" :o parece que he conseguido
de mandar los ficheros generados al Server mediante FTP como indico
el Maestro Roberto en:

viewtopic.php?f=9&t=4902&start=20

"Quick and Easy FTP Server"

http://www.pablosoftwaresolutions.com/h ... _lite.html

En supcarpeta "Screenshot_Help" veran ficheros jpg de Help más un fichero de
texto "readmeYA.txt" que intento explicar un poco como conectarse a FTP Server


Importante: Verificar la conecsión con el Servidor FTP ,antes de poner la opción
de captura automática de ficheros. (Mandar un solo fichero de prueba)

Saludos/Regards
Mustafa :idea: ;)

*----------------------------- Google -------------------------------*
Hello friends:
I present a new experiment that after seeing the Samples
Teachers who have sent Roberto Lopez and Bicahi Esgici

After hard "programming battles" :o seem to have gotten
send the generated files to FTP Server as indicated
Master Roberto in:

viewtopic.php?f=9&t=4902&start=20

                 "Quick and Easy FTP Server"

http://www.pablosoftwaresolutions.com/h ... _lite.html

In supcarpeta "Screenshot_Help" see jpg files plus a file Help
Text "readmeYA.txt" I try to explain a little how to connect to FTP Server

Important: Check the connection to the FTP server, before putting the option
automatic capture files. (Send one test file)

Saludos/Regards
Mustafa :idea: ;)
Attachments
Screenshot_Captura_Pantalla_New_1.zip
(607.97 KiB) Downloaded 340 times
Screenshot3.jpg
Screenshot3.jpg (40.77 KiB) Viewed 6635 times
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Screenshot-Captura_Pantallas

Post by Roberto Lopez »

Mustafa,

Great enhancement!

The next, is an option to mail the screenshots :)

An utility that I'm using daily, to send automatic reports via mail, is based on hb_sendmail() and it sends the messages using a Gmail account (this topic has been discussed many times here).

Of all methods proposed to send a mail in the forum, I've preferred to use hb_sendmail() because it appears to me, to be the more fast and reliable.

The following function does the trick:

Code: Select all

REQUEST __HBEXTERN__HBSSL__

*----------------------------------------------------------------------*
PROCEDURE SENDGMAIL ( cTO , cSubject , cBody )
*----------------------------------------------------------------------*

	IF ! TIP_SSL()
		MSGSTOP ( "ERROR SSL" )
		RETURN
	ENDIF

	#pragma TEXTHIDDEN(1) 
		cFrom		:= "YourGmailAddress@gmail.com"            
		cPassword	:= "YourPassword"        
	#pragma TEXTHIDDEN(0) 

	R := hb_SendMail(  "smtp.gmail.com",  465,	;
		cFrom,					;
		cTo,					;
		NIL /* CC */,				;
		{} /* BCC */,				;
		cBody,					;
		cSubject,				;
		NIL /* attachment */,			;
		cFrom,					;
		cPassword,				;
		"",					;
		NIL /* nPriority */,			;
		NIL /* lRead */,			;
		.T. /* lTrace */,			;
		.F.,					;
		NIL /* lNoAuth */,			;
		NIL /* nTimeOut */,			;
		NIL /* cReplyTo */,			;
		.T. )

	IF R
		MSGINFO('Ok!')
	ELSE
		MSGSTOP('Error!')
	ENDIF

RETURN R
You need to have the following files in the application directory:

Code: Select all

libeay32.dll
msvcr120.dll
ssleay32.dll
These files are in the "OpenSSL-Win32" package, available at:

https://slproweb.com/products/Win32OpenSSL.html

To build the app:

Code: Select all

hbmk2 myprog.prg hbssl.hbc 
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Screenshot-Captura_Pantallas

Post by mustafa »

Hola Roberto :
Es un honor recibir tu felicitación
Seguiremos experimentado
Gracias por la utilidad de envío de correo.
Saludos amigo y maestro
Mustafa
*----------------------------------------Google-------------------------*
Hi roberto :
It is an honor to receive your greeting
We continue to experience
Thanks for mailing utility.
Greetings friend and teacher
Mustafa
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Screenshot-Captura_Pantallas

Post by Roberto Lopez »

Mustafa,

A little enhancement.

This is the code (console mode) modified to handle attachments.

The names of the files to attach must be passed as an array.

It works fine (I've just tested):

Code: Select all

REQUEST __HBEXTERN__HBSSL__

*----------------------------------------------------------------------*
Function Main
*----------------------------------------------------------------------*

	Cls

	cTo := 'destination_mail_address'
	cSubject := 'Mail Subject'
	cBody := 'The Mail Body'

	aFilesToAttach := { 'file1.dat' , 'file2.dat' }
	
	? SEND ( cTO , cSubject , cBody , aFilesToAttach )

	WAIT

RETURN

*----------------------------------------------------------------------*
PROCEDURE SEND ( cTO , cSubject , cBody , aFilesToAttach )
*----------------------------------------------------------------------*

	IF ! TIP_SSL()
		RETURN 'No SSL!'
	ENDIF

	#pragma TEXTHIDDEN(1) 
		cFrom		:= "your_address@gmail.com"            
		cPassword	:= "your_password"        
	#pragma TEXTHIDDEN(0) 

	R := hb_SendMail(  "smtp.gmail.com",  465,	;
		cFrom,					;
		cTo,					;
		NIL /* CC */,				;
		{} /* BCC */,				;
		cBody,					;
		cSubject,				;
		aFilesToAttach ,			;
		cFrom,					;
		cPassword,				;
		"",					;
		NIL /* nPriority */,			;
		NIL /* lRead */,			;
		.T. /* lTrace */,			;
		.F.,					;
		NIL /* lNoAuth */,			;
		NIL /* nTimeOut */,			;
		NIL /* cReplyTo */,			;
		.T. )

	IF R
		cMsg := 'Ok!'
	ELSE
		cMsg := 'Error!'
	ENDIF

RETURN cMsg
And, to build it:

Code: Select all

hbmk2 yourprg.prg hbssl.hbc hbtip.hbc 
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Screenshot-Captura_Pantallas

Post by mustafa »

Hola Roberto
Gracias por la aportación

Hi Roberto
Thanks for the contribution

Saludos/ Regards

Mustafa
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Screenshot-Captura_Pantallas

Post by bpd2000 »

Thank you Mustafa, Roberto Lopez and Esgici
Tested even on ftp successfully
BPD
Convert Dream into Reality through HMG
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Screenshot-Captura_Pantallas

Post by mustafa »

Hola amigos:
Seguimos con los experimentos
A sugerencia del Maestro Roberto López
que podría incorporarase al sample una opción
de correo automático que por intervalo de tiempos
mandará a un determinado correo el Fichero Capturado
silenciosamente.
El Maestro me mandó unas muestras de código Fuente
para correo , pero lamento mi ignoracia no he sabido
interpretar, me acordé que DaNiElMaXiMiLiAnO hace
algun tiempo había publicado un sample para mandar
correo y he recogido una parte de su Sample, para
implemntar mi experimento.

"CDOsys sending email" -> http://hmgforum.com/viewtopic.php?f=24&t=3473

Mis conocimientos son muy escasos referente al Servidores
de Correo Saliente y de Puertos , he probado con
Gmail y veo que está funcionando y he fracasado con
Yahoo creo que es un problema de permisos Ver "Help_06_MAIL.jpg"
en Carpeta de la aplicación "Screenshot_Help".
Tambien he creado un Contador inverso para las capturas
es Opcional.
Finalmente vi otro post del Foro "Print Windows Form"
Donde se pueden imprimir Ficheros gráficos ver
viewtopic.php?f=9&t=3196
y mediante un pequeño retóque lo he añadido a mi
sample.
Bueno amigos espero que les gusta dicho sample.
Saludos/Greeting

Mustafa
*---------------------------------------- Google ------------------------------*
Hello friends:
We continue with experiments
At the suggestion of Maestro Roberto Lopez
the sample could incorporarase an option
automatic mail that time interval
will send a particular email the file Captured
silently.
The Master sent me some samples of code Source
mail, but I regret my ignorance I could not
interpret, I remembered that DaNiElMaXiMiLiAnO ago
some time had published a sample to send
mail and have collected a part of your Sample, for
implemntar my experiment.

"CDOsys sending email" -> http://hmgforum.com/viewtopic.php?f=24&t=3473

My knowledge is very scarce concerning the Servers
and Outgoing Mail Ports, I tested with
Gmail and see that it's working and I have failed to
Yahoo think it's a permissions problem See "Help_06_MAIL.jpg"
Folder, "Screenshot_Help" application.
I have also created a reverse counter for catches
It is optional.
Finally I saw another forum post "Windows Print Form"
Where you can print graphics files see
viewtopic.php?f=9&t=3196
and through a small touch I've added to my
sample.
Well folks hope you like this sample.

Saludos/Greeting
Mustafa
Attachments
Screenshot_Captura_Pantalla_New_3-Mail_Counter_Print.zip
(1.18 MiB) Downloaded 396 times
Screenshot5.jpg
Screenshot5.jpg (54.55 KiB) Viewed 6434 times
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Screenshot-Captura_Pantallas

Post by mustafa »

Hello friends:
Following experiments.
I seem to have reached the end of this Sample
exhausted but happy the wonders
we can do with HMG. :D

Thanks to Maestro Roberto Lopez is the
person who inspired me for this project
and also to all wise tips
especially the friend you Esgici.

*--- News Screenshot-Captura Pantallas - 2016 ----*

1.- Send Send Picture Picture FTP and e-Mail
    It has incorporated the option to send the
    Files captured in format -> ZIP

Option 2. With ZIP until not reached
    10 catches no file name is sent.

3.- When the Zip file is created, Folder
    "Screenshot_Back" spend all files
    I make up the new ZIP, followed by the deleted
    of all Capeta "Screenshot"

4.- In the Formats Capture has been incorporated
    the PDF option is a trick provided by
    Mr. Esgici to capture a PNG file and then
    by "HPDFPRINT IMAGE cFileName.Png"
    it becomes Pdf file.
    New Pdf Files are in "Screenshot_Pdf"

5.- Adaptation of the Sample Print Option published
    by Mr. BP Dave and Mr. Esgici, it creates a
    Backup Folder "Picture_Back" you have from
    Form image Print Menu -> Delete Back
    
  viewtopic.php?f=9&t=3196&p=47057&hilit=BP+Dave#p47057
    
    Errors:
    I see sometimes fails especially if loaded
    for viewing, some file ".jpg", not so
    Same with "Png". (I have not been able to find solution)

6.- Connection Error: e-Mails
    Habeces appears similar to this mesaje and of course
    "hangs" the program did not if it's because I've been
    doing tests sending mail to Yahoo ???
  * -------------------------------------------------------------------------------------- *
WINOLE / 1007 Error Could not send the message to the SMTP server.
The error code was 0x80040217 transport.
The server response was not available (0x80040211): SEND (DOS Error -2147352567)
  * -------------------------------------------------------------------------------------- *

7.- Under the Button "Exit", this hidden an undocumented Button
    because of the myriad of tests I've done, necesitava
    a quick option Erase all content Folder
    "Screenshot_Back\*.*" If poneis the cursor under the cursor
    Button "Exit" appears TOOLTIP "Kill Files", press
    cursor and the contents of the folder will be deleted.

    Well I hope I can serve you this experiment
    Saludos/Greetings
    Mustafa :lol: :idea: :D
Attachments
Screenshot_Captura_Pantalla_New_8-Mail_Counter_Print.zip
(1.25 MiB) Downloaded 313 times
Last edited by mustafa on Wed Oct 26, 2016 12:55 pm, edited 2 times in total.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Screenshot-Captura_Pantallas

Post by Pablo César »

Felicitaciones Mustafa y gracias por compartir.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Screenshot-Captura_Pantallas

Post by andyglezl »

Gracias Mustafa, le daremos una vista.
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply