Good morning,
I have programs using windows only (no OpenWindowedScreen or OpenScreen).
I wrote these programs on my computer with a resolution of 1366x768 pixels with an enlargement factor of 100%.
If I run it on a computer with a resolution of 1920x1080 pixels, with an enlargement factor of 150%, for example, the display is not correct.
I would like, at the start of my program, to set the resolution to 1366x768 pixels with an enlargement factor of 100% and at the end of my program, return the previous values.
I searched through the posts but couldn't find anything along these lines.
Is there a solution?
Thank you for your help
Desktop resolution
-
DarkDragon
- Addict

- Posts: 2347
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: Desktop resolution
So you want to change the screen resolution including all other programs? The usual way would be to enable DPI Aware Executable in the compiler options and/or using DesktopScaledX/DesktopScaledY to scale the remaining things.


bye,
Daniel
Daniel
Re: Desktop resolution
Hello DarkDragon,
Thank you for your answer, I tried that but you have to take into account the resolution and the enlargement factor and it's not simple.
I'm simply looking for a routine that would change the resolution and magnification factor at the start of the program and return the previous values at the end of the program. There must be a routine that does this.
Thank you for your answer, I tried that but you have to take into account the resolution and the enlargement factor and it's not simple.
I'm simply looking for a routine that would change the resolution and magnification factor at the start of the program and return the previous values at the end of the program. There must be a routine that does this.
-
DarkDragon
- Addict

- Posts: 2347
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: Desktop resolution
With the ChangeDisplaySettings_ API function you can change the screen's resolution on Windows:jak64 wrote: Sat Nov 16, 2024 9:59 am Hello DarkDragon,
Thank you for your answer, I tried that but you have to take into account the resolution and the enlargement factor and it's not simple.
I'm simply looking for a routine that would change the resolution and magnification factor at the start of the program and return the previous values at the end of the program. There must be a routine that does this.
http://www.purearea.net/pb/CodeArchiv/W ... eenMode.pb
bye,
Daniel
Daniel
Re: Desktop resolution
Thanks but the code does not work with PureBasic v6.10!
Re: Desktop resolution
Remove this line and its corresponding EndIf:
Code: Select all
If CreateGadgetList(WindowID(0))Re: Desktop resolution
Thanks spikey
It works great!
It works great!
Re: Desktop resolution
I think the desktop resolution will do a very good scientific article. I imagine the title :
Correlation of the published alternation of two display scale values under Licrosoft and the impoverishment of its clients, direct or non.
Correlation of the published alternation of two display scale values under Licrosoft and the impoverishment of its clients, direct or non.
