Taking a current screen_print

Author: i.sharp@pcisystems.co.uk (Iain Sharp)

We have used a hint found here to do clipboard pasting using ^SELECT^TEXT and ^INS_SELECT.

My question is, does anyone know whether it is possible to 'macro' Alt-Print Screen (i.e. copy current window graphics to clipboard) and then access them in uniface?

We have an 'automatic' support call function where uses press a button and it logs the call with us via web-services. The users are often expecting us to be able to see a copy of their screen including error messages etc, and if we could get an image of their screen as they click the support icon, we'd be a step ahead.

11 Comments

  1. Hi Iain,

    think I've seen a note on the internet about screenshots activated from uniface.

    It was on good old T.U.R.F.

    http://hosted.byjones.net/turf/viewtopic.php?f=11&t=863&p=2158&hilit=screen#p2158

    Maybe a simple "SENDKEY" can do the job ??

    Success, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. Yeah, but the bit on Turf is the question without an answer, all that really tells me is that I am not the only one with this requirement.

    What is "SENDKEY"? It's not a uniface command.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  3. Andrea stated on TURF:

    Maybe you prefer a tool.
    ZapGrab is light and easy and do the work.

    Think this can be the answer.

     

    Sendkey is a way to simulate keystrokes to all kind of windows handles (some old DDE ways for remote Control).
    So you have a remote option for the "SHIFT+PRINT".

    Uli

     


    Author: ulrich-merkel (ulrichmerkel@web.de)
  4. ZapGrab requires the user to highlight the area they want to screen capture.

    I just want to capture the current window, save it as a bitmap or jpeg, load it as a string into my component and include it in the web-services call so I can attach it to the support log internally.

    No user input should be required.

    And how does one access "SENDKEY" from within uniface proc? Is it some kind of executable?


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  5. I need something similar. Screendump of current window (or better a specifeid area) to a bmp file. Anyone tried to wrap some Windows functions in a simple dll that I can call from Uniface?


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  6. Have a look at: http://www.codeproject.com/search.aspx?q=screen+capture&x=0&y=0&sbo=kw which offers a variety of ways to capture a screen from an application


    Author: ulrich-merkel (ulrichmerkel@web.de)
  7. I enriched the USEQREAD.DLL with an option to invoke the "print screen". you can download the DLL plus a description from uli-merkel.de as "dITo project SEQREAD plus - how2test.zip" after you have installed the DLL, you can simulate pressing "print screen" by perform "M4LS_CATCHSCREEN"


    Author: ulrich-merkel (ulrichmerkel@web.de)
  8. I tried Uli's DLL. It works great simulating Print Screen ! But we always want more: Simulate Alt Printscreen for current window. Give some coordinates as parameter so we can pick up a section of the screen Option to save to file Some way to put the captured image in a Uniface field


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  9. Hi Theo, based on the code I documented, I think it's possible for you to add a "ALT-Printscreen" variation. For all the other luxuries, I think it's best to install a proper screen-capture tool which is activated with pressing printscreen.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  10. Hi Uli, Using an external tool that reuires user input is not an option. I am playing with an idea for a low cost/no cost GUI test tool automated test tool for regression testing GUI aspects of Uniface applications. Not a serious project for me at the moment but I have started to collect information, tools etc. Theo


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  11. Hi Theo, well, you have the screen in the clipboard as a base to work from. And I added perform "M4LS_CATCHWINDOW" so you can get the Uniface window as well. (Downloadable from www.uli-merkel.de). Now all you need is some graphic tool which accepts commands from a scripting tool to do what you want. There is no need to reconstruct this, have a look whats available in the different marketplaces. Or you can use "automatisation" on MSPAINT to save a file you got from the clipboard (and manipulate the image as well) as decribed here: http://community.spiceworks.com/scripts/show/793-screenshot-emailed-to-in-one-click In general: using uniface to launch PowerShell Scripts my be a way to do all these jobs.


    Author: ulrich-merkel (ulrichmerkel@web.de)