Search found 299 matches

by pneumatic
03 Oct 2018, 08:11
Forum: Ask For Help
Topic: -DPIScale not working properly
Replies: 19
Views: 3367

Re: -DPIScale not working properly

This is working on my Windows 10 system to force raster scaling. DllCall("User32\SetThreadDpiAwarenessContext", "UInt" , -1) Must be called before any GUI's are created, and -DPIScale must be set also. But I have no idea how reliable it is. Also the scaling is very ugly. Can play around a bit with G...
by pneumatic
03 Oct 2018, 07:55
Forum: Ask For Help
Topic: -DPIScale not working properly
Replies: 19
Views: 3367

Re: -DPIScale not working properly

Result := DllCall("User32\SetProcessDpiAwarenessContext", "UInt" , -1) ;-1 = DPI_AWARENESS_CONTEXT_UNAWARE ;-2 = DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ;-3 = DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ;-4 = DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 This returns 0 meaning it succeeded, but it didn't actua...
by pneumatic
03 Oct 2018, 06:51
Forum: Ask For Help
Topic: -DPIScale not working properly
Replies: 19
Views: 3367

Re: -DPIScale not working properly

Not sure, but it may have to do with the fact you don't define the font-size? So add something like Gui, Font, s10 to ensure "it knows" what font size to use, otherwise it will use the default system setting. Code snippet to find the default size here: https://github.com/hi5/dpi#guidefaultfont (per...
by pneumatic
03 Oct 2018, 06:37
Forum: Ask For Help
Topic: -DPIScale not working properly
Replies: 19
Views: 3367

Re: -DPIScale not working properly

Ok so it seems the problem might be the Autohotkey process DPI scaling mode is still set to "System Aware", regardless of the -DPIScale setting. In another thread I saw we can get current DPI scaling awareness by: ProcessDPIAwareness := {0: "PROCESS_DPI_UNAWARE", 1: "PROCESS_SYSTEM_DPI_AWARE", 2: "P...
by pneumatic
03 Oct 2018, 05:44
Forum: Ask For Help
Topic: -DPIScale not working properly
Replies: 19
Views: 3367

Re: -DPIScale not working properly

Might be on to something...

https://docs.microsoft.com/en-gb/window ... iawareness

Just need to figure out how to use it. Any help appreciated.
by pneumatic
03 Oct 2018, 05:30
Forum: Ask For Help
Topic: -DPIScale not working properly
Replies: 19
Views: 3367

Re: -DPIScale not working properly

So I notice some apps are apparently "DPI unaware", and in these cases Windows uses simple raster upscaling for the GUI and you get a blurry application window. This proves it's possible for Windows to just render the GUI internally at normal 96 DPI (100% zoom) prior to raster upscaling the GUI. Thi...
by pneumatic
03 Oct 2018, 04:02
Forum: Ask For Help
Topic: -DPIScale not working properly
Replies: 19
Views: 3367

-DPIScale not working properly

Edit: see "solution" https://autohotkey.com/boards/viewtopic.php?p=243128#p243128 I was expecting the GUI option "-DPIScale" to tell Windows not to perform any DPI scaling for the GUI, and therefore produce the same appearance as if DPI scaling had been turned off. On my Windows 10 test system, this...
by pneumatic
27 Sep 2018, 16:37
Forum: Ask For Help
Topic: Force a dynamic var inside a function to local scope
Replies: 4
Views: 710

Re: Force a dynamic var inside a function to local scope

just me wrote:Local Variables:
Force-local mode [v1.1.27+]:
Thanks. I must remember to check the online documentation as I'm still using 1.1.24.
by pneumatic
27 Sep 2018, 00:30
Forum: Ask For Help
Topic: Force a dynamic var inside a function to local scope
Replies: 4
Views: 710

Force a dynamic var inside a function to local scope

By default any variable reference inside a function resolves to a local variable unless no variable of that name exists, in which case a superglobal is used if it exists. However if the variable reference is dynamic, then the rule changes to include globals, not just superglobals. Is there any way t...
by pneumatic
26 Aug 2018, 18:44
Forum: Suggestions on documentation improvements
Topic: Suggestions on documentation improvements
Replies: 688
Views: 226573

Re: Suggestions on documentation improvements

So do you also conclude that 37 == 1 should be true? Obviously not :lol: So 1 and 0/"" aren't pointers to some underlying representation or boolean data structure of truth and falsity - they are themselves literal representations of truth and falsity. So comparisons between truth and falsity will o...
by pneumatic
26 Aug 2018, 07:49
Forum: Suggestions on documentation improvements
Topic: Suggestions on documentation improvements
Replies: 688
Views: 226573

Re: Suggestions on documentation improvements

It compares if the values are exactly the same. And "" is not 0. In practice you are right; ahk is comparing "" and 0. But the documentation implies that the comparison is not necessarily between "" and 0, because: 1. blank var "holds a false value". 2. the word false holds the value 0. So the comp...
by pneumatic
26 Aug 2018, 05:34
Forum: Suggestions on documentation improvements
Topic: Suggestions on documentation improvements
Replies: 688
Views: 226573

Re: Suggestions on documentation improvements

The documentation says my var holds "a false value", so when comparing it to another false value (the word false) why shouldn't we expect the result to be true?
by pneumatic
25 Aug 2018, 21:51
Forum: Suggestions on documentation improvements
Topic: Suggestions on documentation improvements
Replies: 688
Views: 226573

Re: Suggestions on documentation improvements

a variable can be used to hold a false value simply by making it blank or assigning 0 to it Let's test it... var := "" if (var = false) msgbox nope, this line won't occur because false is explicitly defined as a var containing 0 The words true and false are built-in variables containing 1 and 0.
by pneumatic
24 Mar 2018, 12:23
Forum: Ask For Help
Topic: How to exit script gracefully Topic is solved
Replies: 2
Views: 619

How to exit script gracefully Topic is solved

Hello In my script I'm using OnExit, Quit to call my Quit subroutine which then eventually calls ExitApp. My concern is that Quit might interrupt some other thread that was doing something important like writing a file, and interrupted it half way through, leaving those files in an inconsistent stat...
by pneumatic
24 Mar 2018, 11:55
Forum: Bug Reports
Topic: Adding button removes slider border
Replies: 0
Views: 819

Adding button removes slider border

Not sure if this is a bug/feature of AHK or Windows, but it's unexpected behaviour. Gui , New , +hwndHGUI Gui , Add , Text , vText1, Slider1 Gui , Add , Slider, Buddy1Text1 x50 y10 w250 ;Gui , Add , Button , x140 y60 w60 h23 , Button Gui , Show , w320 h100 return Adding a button to the GUI causes th...
by pneumatic
23 Mar 2018, 12:29
Forum: Scripts and Functions
Topic: Set laptop brightness & show Win 10's native OSD
Replies: 12
Views: 8526

Re: Set laptop brightness & show Win 10's native OSD

Thank you qwerty12 for taking the time to make this class. I would like to add a couple of extra conditions to it: 1. Detect if the user's system supports this method of brightness control in the first place, and if not, do nothing. Should I simply modify line 48 as follows? if (jump && BrightnessSe...
by pneumatic
08 Mar 2018, 21:32
Forum: Bug Reports
Topic: WinGetPos gives on some win bad values
Replies: 1
Views: 923

Re: WinGetPos gives on some win bad values

Try using a different WinTitle ( ahk_id vs ahk_pid vs ahk_exe vs Title ). Sometimes they will give a different value because a different windows API function is being used to retrieve it, and the windows API is very difficult and convoluted to know under what circumstances exactly which values will ...
by pneumatic
07 Mar 2018, 17:19
Forum: Ask For Help
Topic: Checked groupbox
Replies: 8
Views: 1407

Re: Checked groupbox

Thanks for the solutions. My main concern wasn't actually with the management of child controls (I was already doing that manually in an unsophisticated way) but rather to ensure the checkbox gets drawn on top of the groupbox. It seems the basic rule is that as long as the checkbox is added after th...
by pneumatic
07 Mar 2018, 05:02
Forum: Ask For Help
Topic: Checked groupbox
Replies: 8
Views: 1407

Checked groupbox

Hi Is it possible to achieve a checked groupbox like this http://www.csharphelper.com/howto_check_groupbox.png The article where this image is from mentions the following technique: 1. check whether the CheckBox is inside the GroupBox and, if it is, move it into the GroupBox‘s parent 2. move the Che...
by pneumatic
06 Mar 2018, 19:20
Forum: Scripts and Functions
Topic: Masonjar13's Library List
Replies: 40
Views: 16310

Re: Masonjar13's Library List

Hi Masonjar Came across a post of yours here regarding animated cursors not being restored after hiding them https://autohotkey.com/board/topic/5727-hiding-the-mouse-cursor/page-2#entry654705 Not sure if you had seen the fix, and I couldn't find it in your library, but it seems the animations can be...

Go to advanced search