4Eyes Posted October 19, 2010 Posted October 19, 2010 (edited) Folks, I hope this hasn't been asked before... I did look first. Under Windows 7 and maybe Vista too, there's an option to "Make it easier to read what's on your screen". This is visible in the Display Control Panel applet. I've found that this causes havoc with the size of text in a window. If you design a GUI to look correct at 100% er... 'magnification' is not the right word but I see no reference to what it should be called, it doesn't look right at 125% or 150%. The text is 'magnified' and no longer fits in labels, buttons or ListViews. I've had a quick squizz in the registry but couldn't find anything appropriate... it's a big place and without a reference to even what this is called it's a nightmare. I haven't included any code as it's really obvious. Ok, so does anybody know how to detect this 'feature' and how do I deal with it? 4Eyes Edited October 19, 2010 by 4Eyes
hessebou Posted October 19, 2010 Posted October 19, 2010 what about this? GUICtrlSetFont then it should dont matter what the win7/vista settings are.
4Eyes Posted October 19, 2010 Author Posted October 19, 2010 hessebou, Thanks. I use GUICtrlSetFont(). Unless there's a flag that I don't know of, I don't know what to do. Grrr... I don't have access to anything but XP at the mom. I'll upload a couple pic's this arvo to show the diff. Anybody? 4Eyes
4Eyes Posted October 20, 2010 Author Posted October 20, 2010 Ok, here are 2 screen shots to demonstrate the problem. GUISizingTest is at 100% and GUISizingTest is ... ah, you guessed it! You can clearly see that the text is magnified but the controls (label and button) are not. As far as I can see at the moment, if the user is using Win 7 (and maybe Vista too) I need to ask if they are using this magnification 'feature' then change the sizes of controls. This is ridiculous of course. 4Eyes
hessebou Posted October 21, 2010 Posted October 21, 2010 ok i tryed a little bit around. the 100% normal view means 96DPI. so you can use this to check DPI and if its not 96 do a msgbox or exit the script. #include <WinAPI.au3> $ScreenDC = _WinAPI_GetDC(0) $DPI = _WinAPI_GetDeviceCaps($ScreenDC,88) _WinAPI_ReleaseDC(0,$ScreenDC) msgbox(0,"",$DPI)
4Eyes Posted October 22, 2010 Author Posted October 22, 2010 hessebou, Ah, thank you. I didn't realise it was a DPI change. Using my 20/20 hindsight I see I can do the same in XP. Now, not only do I know what to call it, I can detect it too. Thanks so much. Regards, 4Eyes
Joemonkey Posted February 28, 2011 Posted February 28, 2011 Is there any way to code it to read the setting (100%, 125%, 150%) and if it's set to 100%, run the GUI, but if it's set to 125 or 150 it reads that value in, sets it to 100%, then on GUI exit set it back to the way it was? Sorry if this is considered thread necromancy, I'm having the same issue and didn't want to start a new thread
KaFu Posted February 28, 2011 Posted February 28, 2011 _GUISetFont_Ex() and _GUICtrlSetFont_Ex() as used should solve the issues. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
4Eyes Posted February 28, 2011 Author Posted February 28, 2011 Hi guys, I settled my issue by using a scaling factor on the fonts and gui elements as necessary. I set a $var called $10point (and others for other point sizes) and change the contents of the var for each of 100%, 125% and 150%. It works reasonably well except when you end up with fractional point sizes like 125% of 11 point. KaFu, I haven't studied your posts fully yet but will see if it is a better solution. See, it just goes to show, a little necromancy never hurt anyone. Regards, 4Eyes
Joemonkey Posted March 1, 2011 Posted March 1, 2011 _GUISetFont_Ex() and _GUICtrlSetFont_Ex() as used should solve the issues.After I read through the code a few times it made sense and I was able to implement it. Thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now