Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print Screen in VFP app
Message
 
To
11/11/2004 10:22:11
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00960436
Message ID:
00960444
Views:
12
>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 && title you want to show when printing

    cJobName = 'Print Screen' && could be passed as a parameter, also.

    nRetVal = PrintWindow(GetDesktopWindow(),1,1,0,0,@cJobName)
    IF nRetVal != 0
        IF nRetVal != 6 && 6 = User canceled printing
            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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform