Search found 299 matches

by pneumatic
13 Jan 2020, 15:50
Forum: Ask For Help
Topic: Detect when montior is turned off or idle?
Replies: 12
Views: 2969

Re: Detect when montior is turned off or idle?

Considering this is a 4 year old thread.. Idk. But taking a look at the structure, if you're using 7 or below, GUID_MONITOR_POWER_ON is needed, which reports either 0 or 1. But, for 8+, GUID_CONSOLE_DISPLAY_STATE is used, which has 0, 1, or 2, where 2 = dimmed. How I had written it, dimmed is synon...
by pneumatic
13 Jan 2020, 14:58
Forum: Ask For Help
Topic: Detect when montior is turned off or idle?
Replies: 12
Views: 2969

Re: Detect when montior is turned off or idle?

#persistent #singleInstance force GUID_MONITOR_POWER_ON:="02731015-4510-4526-99e6-e5a17ebd1aea" GUID_CONSOLE_DISPLAY_STATE:="6fe69556-704a-47a0-8f24-c28d936fda47" global monitorStatus:=1 global newGUID:="" varSetCapacity(newGUID,16,0) if a_OSVersion in WIN_8,WIN_8.1,WIN_10 dllCall("Rpcrt4\UuidFromS...
by pneumatic
13 Jan 2020, 12:57
Forum: Ask For Help
Topic: Detect when montior is turned off or idle?
Replies: 12
Views: 2969

Re: Detect when montior is turned off or idle?

Even if the offset is correct, your usage is not. See the second paragraph for "VarOrAddress". I knew I was doing something wrong, I just didn't know WHAT. Thank you, lexikos. The following now works (tested on Windows 8.1)(the offset was correct). #persistent #singleInstance force GUID_MONITOR_POW...
by pneumatic
08 Jan 2020, 10:01
Forum: Ask For Help
Topic: OnMessage threads clarification needed Topic is solved
Replies: 5
Views: 775

Re: OnMessage threads clarification needed Topic is solved

Just to clarify - will Critical 3000 only be in effect for the thread in which it's declared, or until a Critical Off is encountered? The documentation isn't entirely clear, it says "Note: Increasing the message-check interval too much may reduce the responsiveness of various events such as GUI wind...
by pneumatic
06 Jan 2020, 06:29
Forum: Ask For Help
Topic: VarSetCapacity vs AHK_L
Replies: 11
Views: 2157

Re: VarSetCapacity vs AHK_L

And also I'm not sure whether blanking a var is exactly the same as just setting all its bits to 0. It could be that blanking a var somehow removes it from the process's memory space and it becomes a null pointer instead of a pointer to a var which contains x bytes made up of 0's. Even ahk treats th...
by pneumatic
05 Jan 2020, 03:27
Forum: Ask For Help
Topic: VarSetCapacity vs AHK_L
Replies: 11
Views: 2157

Re: VarSetCapacity vs AHK_L

why do you think that AHK_H requires you to set the variable to blank first, but AHK_L doesn't? The difference to main AutoHotkey is that #NoEnv is set by default and VarSetCapacity keeps memory in variable when capacity is changed. There are scenarios where not blanking a var first could result in...
by pneumatic
27 Dec 2019, 20:47
Forum: Ask For Help
Topic: VarSetCapacity vs AHK_L
Replies: 11
Views: 2157

Re: VarSetCapacity vs AHK_L

Since I couldn't get a clear answer on whether var := "" , VarSetCapacity(var, %RunTimeBoundNumber%) Is equivalent to VarSetCapacity(var, %RunTimeBoundNumber%, 0) The solution I ended up going with is to put comments in my _L script like this ;#AHK_H var := "" VarSetCapacity(var, 1024) Then patch th...
by pneumatic
19 Dec 2019, 06:27
Forum: Ask For Help
Topic: Missing carriage return
Replies: 5
Views: 410

Re: Missing carriage return

Sorry, I misinterpreted the rule. I thought disabling EOLT meant that CR+LF becomes LF. But actually all it means is that LF remains as LF instead of becoming CR+LF. So if a line in a string contains CR+LF, it will just remain as CR+LF, since the LF portion of it remains as LF. And if another line i...
by pneumatic
18 Dec 2019, 19:22
Forum: Ask For Help
Topic: Missing carriage return
Replies: 5
Views: 410

Re: Missing carriage return

But in the first example, OutputFileContents contains CR+LF (because it originated from FileRead which requires the *t option to convert CR+LF's to LF) and yet FileAppend still writes it back to file as CR+LF. And in the last example there is a mixture of CR+LF and LF in the output file, and CR's ar...
by pneumatic
18 Dec 2019, 14:52
Forum: Ask For Help
Topic: Missing carriage return
Replies: 5
Views: 410

Missing carriage return

Edit: solved, not a bug, just my misinterpretation of what "disable end of line translation" means. Contents of InputFile.txt: https://i.lensdump.com/i/iN4aaZ.png Now read the file in and write it back out to file to confirm FileRead and FileAppend are working properly: FileRead , OutputFileContents...
by pneumatic
14 Dec 2019, 10:34
Forum: AutoHotkey_H
Topic: Starting with AHK-H
Replies: 7
Views: 1269

Re: Starting with AHK-H

Put the AHK_H executable (x64w\Autohotkey.exe) alongside your .ahk file, then rename it to the same as your .ahk file, then run the executable. x64w\Autohotkey.exe = 64-bit unicode Win32w\Autohotkey.exe = 32-bit unicode x64a\Autohotkey.exe = 64-bit ansi Win32a\Autohotkey.exe = 32-bit ansi _MT versio...
by pneumatic
12 Dec 2019, 00:20
Forum: Ask For Help
Topic: VarSetCapacity vs AHK_L
Replies: 11
Views: 2157

Re: VarSetCapacity vs AHK_L

You will need to use VarSetCapacity(s, -1) to update the variable's internally-stored string length to the length of its current contents, see VarSetCapacity . Thanks, it works! And it was there in the documentation all along :oops: :oops: :oops: :oops: :oops: But I'm still not sure if VarSetCapaci...
by pneumatic
11 Dec 2019, 02:17
Forum: Ask For Help
Topic: VarSetCapacity vs AHK_L
Replies: 11
Views: 2157

Re: VarSetCapacity vs AHK_L

i'm guessing you are running your test script on ansi (a) and not unicode (w) I use Unicode 64-bit exclusively. Speculation: the contents of the string are unpredictable and depend on what happens to be in that memory address on your particular system. On your system it happens to be something that...
by pneumatic
04 Dec 2019, 20:23
Forum: Ask For Help
Topic: AHK Script Encryption Topic is solved
Replies: 50
Views: 7219

Re: AHK Script Encryption Topic is solved

There are several "tricks" for speeding up script execution. You should probably try them out and see how it goes. The sustained 4 second CPU load occurs before the first line of ahk code is even executed. The fact that it doesn't occur on my Win7 machine leads me to speculate that it's not actuall...
by pneumatic
02 Dec 2019, 19:21
Forum: Bug Reports
Topic: If statement changes contents of var
Replies: 14
Views: 3702

Re: If statement changes contents of var

Thanks, I did mean to assign.

When I first encountered that type of expression I thought it was silly too, but now I can't live without it :lol:

I mean you get 2 lines for the price of 1 - less code and improved performance, what's not to like?
by pneumatic
02 Dec 2019, 18:58
Forum: Wish List
Topic: Execution continues after Reload command
Replies: 11
Views: 1694

Re: Execution continues after Reload command

so i guess Reload inside the exit routine will not recursively call it As long as ExitApp,2 isn't in the autoexec section it won't. If you're concerned about there being no ExitApp inside ExitApp(), it's is not needed as ahk automatically does that, even if a runtime error occurs during it. However...
by pneumatic
02 Dec 2019, 18:22
Forum: Ask For Help
Topic: Suspend is not enough, even Pause in not enough - how to solve it instead of AHK script terminate?
Replies: 4
Views: 1386

Re: Suspend is not enough, even Pause in not enough - how to solve it instead of AHK script terminate?

Really don't know how to start AHK not as admin - I'm starting script - so AHK file. If your Windows has a non administrator user account available, put the ahk executable (which is probably in c:\program files\autohotkey) alongside your ahk file and rename the exe to the same as the ahk file, then...
by pneumatic
01 Dec 2019, 20:06
Forum: Ask For Help
Topic: Suspend is not enough, even Pause in not enough - how to solve it instead of AHK script terminate?
Replies: 4
Views: 1386

Re: Suspend is not enough, even Pause in not enough - how to solve it instead of AHK script terminate?

I encountered something like that, but it only occurs when all of the following conditions occur simultaneously: 1. My script is running as administrator 2. My script's GUI window is visible and activated 3. The application which suffers from blocked input is running at a lower "integrity" level (i....
by pneumatic
01 Dec 2019, 19:50
Forum: Wish List
Topic: Execution continues after Reload command
Replies: 11
Views: 1694

Re: Execution continues after Reload command

So if Reload is used on its own (without ExitApp after it) Reload will automatically call the OnExit routine, and crucially, will NOT interrupt it, instead allowing the OnExit routine to run for a few seconds, after which this ahk dialogue is posted https://i.lensdump.com/i/iogc2P.png Couple of issu...
by pneumatic
01 Dec 2019, 19:23
Forum: Ask For Help
Topic: ExitCode Topic is solved
Replies: 7
Views: 585

Re: ExitCode Topic is solved

Thanks guys. Funnily enough, the original topic of this thread was going to be asking about what is the purpose of OnExit when you can just make your own function and call that instead :lol: According to docs, here are some things unique about the OnExit routine -does not obey #MaxThreads and cannot...

Go to advanced search