>I need to implement a one keystroke/menu item method of printing screens in my application.
>
>The Windows Scripting Host documentation says I can use WSH to issue an alt+PrintScreen to get a picture of the screen into the clipboard. I can then put the clipboard in a VFP report and print it.
>
>I would prefer not to depend upon the presence of WSH on all of the user machines. I do not see Print Screen in the list of keys in INKEY. Is there a Win32 API call or another better way to do this?
>
>Thanks.
>
>
>Tim
Use this:
DECLARE INTEGER GetDesktopWindow IN Win32api
DECLARE INTEGER PrintWindow IN DibApi32 ;
INTEGER HWnd, ;
INTEGER fPrintArea, ;
INTEGER fPrintOpt, ;
INTEGER wxScale, ;
INTEGER wyScale, ;
STRING @ szJobName
LOCAL nRetVal,cJobName
cJobName = 'Print Screen'
nRetVal = PrintWindow(GetDesktopWindow(),1,1,0,0,@cJobName)
IF nRetVal != 0
IF nRetVal != 6
MESSAGEBOX("Unable to print the window" + chr(10) + ;
"See System Administrator " + STR(nRetVal),48, ;
"FUBA Print Screen ")
ENDIF
ENDIF
You need too DIBAPI32.DLL in your path.
Vladimir Zografski
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst