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
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
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.
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
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.
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
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
Best regards.