Internal Variable for DPI awareness

Just starting out? Need help? Post your questions and find answers here.
User avatar
charvista
Addict
Addict
Posts: 902
Joined: Tue Sep 23, 2008 11:38 pm
Location: Belgium

Internal Variable for DPI awareness

Post by charvista »

Q: During runtime, how to get the boolean for DPI awareness, is it enabled or not?

In Compiler Options, we can check the option "Enable DPI aware executable (Windows)".
I thought to find something like a constant #PB_Compiler_DPI_Awareness or something like that, but alas...
- Windows 11 Home 64-bit
- PureBasic 6.04 LTS (x64)
- 64 Gb RAM
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4636
Joined: Sun Apr 12, 2009 6:27 am

Re: Internal Variable for DPI awareness

Post by RASHAD »

Hi charvista
Try the next snippet
It's originally posted by Blue
Modified by RASHAD

Code: Select all

EnableASM
Procedure.i DPi_option_checked()
  MOV eax, dword [PB_Compiler_DPIAware]
  ProcedureReturn
EndProcedure
DisableASM

If DPi_option_checked()
  ; do this and that
EndIf

Debug "DPi_option_checked() ? " + DPi_option_checked()
Egypt my love
User avatar
charvista
Addict
Addict
Posts: 902
Joined: Tue Sep 23, 2008 11:38 pm
Location: Belgium

Re: Internal Variable for DPI awareness

Post by charvista »

Ah, in Assembler code.
Excellent, it works well.
Thank you !
- Windows 11 Home 64-bit
- PureBasic 6.04 LTS (x64)
- 64 Gb RAM
Post Reply