1. Eduardo G.
  2. PowerBuilder
  3. Tuesday, 7 May 2024 10:59 AM UTC

Hello,
I have 2 monitors and for example, pressing a button on the response window should resize this window to the width and height of the extended desktop of the 2 monitors.

Does anyone have the code to perform this functionality?

Thanks

Accepted Answer
Daryl Foster Accepted Answer Pending Moderation
  1. Wednesday, 8 May 2024 02:21 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Eduardo,

I agree with John that resizing to the virtual screen size is probably a bad idea because there is no guarantee that the screens form a continuous rectangle.  I've attached a small sample window (unzip the file and import the .srw file to view it) which finds the virtual screen size and resizes a response window to the virtual screen. It sort of works ok when two screens of the same resolution are side by side, but on my setup part of the maximised window is behind the task bar on one of the screens so it's not ideal.  It should give you some ideas to see if it's actually something you want to add to your application though.

Regards,

Daryl.

Attachments (1)
Comment
  1. Eduardo G.
  2. Wednesday, 8 May 2024 06:12 AM UTC
Thank you very much, it has been very helpful, I appreciate it.



Best regards.
  1. Helpful
There are no comments made yet.
Eduardo G. Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2024 13:57 PM UTC
  2. PowerBuilder
  3. # 1

Thank you very much for the url, it is totally true what you say, when I started to consider the functionality I have seen a lot of casuistry that can only generate problems, hence my question to the air in this forum if someone has already implemented it :-D

Comment
There are no comments made yet.
Eduardo G. Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2024 13:45 PM UTC
  2. PowerBuilder
  3. # 2

Thanks Roland, I forgot to say that I have implemented the window resizing functionality response thanks to the API calls.

As I comment it would be very time saving to have a code to resize a window to the width and height of the total sum of the extended desktop when there are 2 monitors.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2024 13:43 PM UTC
  2. PowerBuilder
  3. # 3

Hi, Eduardo -

There is no rule that adjacent monitors must produce a virtual screen/desktop that encompasses only the viewable space of the monitors. The positioning of the viewable space of each monitor within the virtual screen is configurable by the user. You should not assume that all two-monitor configurations are identical to how yours is configured, as there may very well be non-displayable areas within the virtual screen.

For example, two monitors side-by-side, but different makes/models. What would be the result with what you propose if the monitor on the right has a smaller vertical resolution than the one on the left and they are configured to align along the top? The answer is that the lower portion of the window on the right-side monitor will be cropped (not visible), possibly hiding the response window's response button(s).

I caution you regarding what you have proposed because it may not work as you intended in all circumstances. The link below to a Microsoft Windows help topic contains an explanation of the virtual screen and includes an illustration:

    https://learn.microsoft.com/en-us/windows/win32/gdi/the-virtual-screen

Best regards, John

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2024 12:56 PM UTC
  2. PowerBuilder
  3. # 4

Response windows don't normally allow for resizing. I have an example of how to do that with Windows API functions:

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

 

Comment
  1. Roland Smith
  2. Tuesday, 7 May 2024 12:59 PM UTC
The Environment object has screen width and height properties.
  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.