1. Andere Rene
  2. PowerBuilder
  3. Tuesday, 28 May 2019 13:46 PM UTC

Hi all

I need to determine the numbers of monitor in PB. There are already some examples but not in PB code. Do you have any examples how I can determine the number of connected monitors?

 

Or other function about monitor!

 

Thx

André Rust

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 28 May 2019 16:20 PM UTC
  2. PowerBuilder
  3. # 1

There is no built-in function in PowerBuilder to do this.  You would need to tap into Windows APIs.  Not sure which Windows API can accomplish this, but hopefully I have nudged you in the right direction.

Comment
  1. Andere Rene
  2. Wednesday, 29 May 2019 05:42 AM UTC
Thanks Armeen
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 28 May 2019 21:57 PM UTC
  2. PowerBuilder
  3. # 2

The Windows API GetSystemMetrics will tell you the number of display monitors if you supply an argument value of 80 (SM_CMONITORS).

Define the following local external function in the Window or User object from which you want to call this WinAPI:

FUNCTION Integer GetSystemMetrics(Integer nIndex) LIBRARY "user32.dll"

Once the function definition has been saved in your object, you invoke it via this example code:

Integer li_num_monitors
li_num_monitors = GetSystemMetrics(80) // 80 = SM_CMONITORS, # of monitors.

 

Comment
  1. Andere Rene
  2. Wednesday, 29 May 2019 05:41 AM UTC
Thanks John

Now I get the number of monitors displayed.

If there are any examples in PB with monitor values please let me know



André Rust
  1. Helpful
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Wednesday, 29 May 2019 13:14 PM UTC
  2. PowerBuilder
  3. # 3

Here's the WINAPI list of functions for dealing with monitors.

Microsoft Monitor Configuration Functions

 

Comment
  1. Andere Rene
  2. Wednesday, 29 May 2019 13:20 PM UTC
Thx Brad
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 29 May 2019 14:41 PM UTC
  2. PowerBuilder
  3. # 4

Here is some Windows API info specific to multiple monitors.

Multiple Display Monitors Reference

If you are wanting some other or additional information, you'll need to be more specific as to what you looking for.

Comment
  1. Andere Rene
  2. Tuesday, 4 June 2019 12:42 PM UTC
Thx, John
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 29 May 2019 18:25 PM UTC
  2. PowerBuilder
  3. # 5

Hi André;

   FYI ... from my STD framework's example order entry App :

 

Regards ... Chris

Comment
  1. Andere Rene
  2. Tuesday, 4 June 2019 12:41 PM UTC
Thx, Chris
  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.