Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print Screen in VFP
Message
From
03/07/1998 03:10:40
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00113820
Message ID:
00113988
Views:
22
>I'm trying to add print screen capabilities to a VFP app. I understand that you can copy the contents of a screen to the clipboard with Alt-PrintScrn and that you can paste those contents into a general field in a database. I haven't been able to create a report that prints general fields, though. Is it possible?
>
>Or, is there some command or API call that will dump the contents of the clipboard straight to the printer?
>
>This app is targeted towards folks who are not necessariliy computer-literate, so I want to make this as simple as possible.
>
> TIA,
> ROB


Rob,
Surely there are other ways. Possibly better ones. May be faster ones. But if the client has Word this function works fine:

lparameters siventana
if pcount() = 0
siventana = .f.
endif

declare keybd_event in win32api ;
short bvk, short bscan, integer dwflags, integer deextrainfo
activate screen
vuelta = keybd_event(44, iif(siventana, 0, 1), 0, 0) && esto copia al portapapeles
wait window "Imprimiendo pantalla..." timeout 1 && necesary to wait task done

obj_word = createobject("word.application")
obj_word.documents.Add()
obj_word.Selection.Paste
obj_word.activedocument.printout(.f.)
obj_word.quit(0)
release obj_word
Saludos,
A.G.P.
---------
Previous
Reply
Map
View

Click here to load this message in the networking platform