1. Christopher Craft
  2. PowerBuilder
  3. Tuesday, 22 March 2022 00:37 AM UTC

PB 2019 R3 2728

This seems like a dumb question but I cannot get the PrintScreen function to print the screen of a secondary monitor (or third, etc).  It only prints the primary.  What am I missing?

Chris Craft

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 22 March 2022 13:28 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Chris - 

Since the PrintScreen PowerScript function goes wa-a-a-a-aayyy back to the early versions of PB (when there was no multiple monitor support and PB was supported on multiple platforms), I'm pretty sure it only works for the primary monitor. Sounds like a useful enhancement request!

If you're well-versed using the Windows API, you should be able to develop your own NVO that contains the desired functionality. If you can find an example that uses C++ or C# on the web, the conversion to PowerScript MIGHT not be too difficult. Something to think about.

Regards, John

Comment
  1. Christopher Craft
  2. Tuesday, 22 March 2022 14:57 PM UTC
Thanks again John. I will log a bug for that and look for the Windows API implementation.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 22 March 2022 17:29 PM UTC
  2. PowerBuilder
  3. # 1

Screen capture via Windows API functions:

https://www.topwizprogramming.com/freecode_bitmap.html

 

Comment
  1. Roland Smith
  2. Tuesday, 22 March 2022 17:50 PM UTC
Testing on my work computer, the .bmp file is created but the of_ShellRun doesn't wait so the FileDelete deletes the file. Comment out the FileDelete if you have problems.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.