Search found 327 matches

by KuroiLight
06 Jan 2018, 02:45
Forum: Ask For Help
Topic: Couple of questions.
Replies: 10
Views: 1646

Re: Couple of questions.

Sorry, I meant to link you to the Hotkey command page: https://autohotkey.com/docs/commands/Hotkey.htm
There is a difference between creating hotkeys like alt::doSomething() and Hotkey, Alt, %doSomething%
by KuroiLight
04 Jan 2018, 21:16
Forum: Ask For Help
Topic: Couple of questions.
Replies: 10
Views: 1646

Re: Couple of questions.

I think divanebaba's suggestion is possible regardless of using an array; If you only expect the file to change between script runs, then loading the file into an array will be faster over-all. You can also add a check for last modification time and reload the file only when it differs. If you want ...
by KuroiLight
02 Jan 2018, 13:39
Forum: Ask For Help
Topic: Unable to get FileOpen to work
Replies: 3
Views: 855

Re: Unable to get FileOpen to work

MrMajorThorburn wrote: I did have to make the logfile variable global as it did not resolve correctly in the _DebugOut function.
This was the actual problem, I should have spotted this. :?
have a good year.
by KuroiLight
01 Jan 2018, 20:51
Forum: Ask For Help
Topic: IfWinActive question
Replies: 13
Views: 1999

Re: IfWinActive question

If the objective is to stop the user from using the Run dialog completely, then do: Loop { WinWait, Run ahk_class #32770, ControlGet, EditHwnd, Hwnd,, Edit1, WinSet, Disable,, ahk_id %EditHwnd% ControlGet, BtnHwnd, Hwnd,, Button4, WinSet, Disable,, ahk_id %BtnHwnd% WinWaitClose } Mind you, this will...
by KuroiLight
01 Jan 2018, 15:43
Forum: Ask For Help
Topic: Unable to get FileOpen to work
Replies: 3
Views: 855

Re: Unable to get FileOpen to work

It throw no errors for me, just doesn't log to file. It may be that the 'a' [append] option just doesn't work for some reason. If you arn't doing formatting and caching on the log entries then you can just go with: ; File for logging global logfile := A_ScriptDir . "\Debug.log" FormatTime, Now FileA...
by KuroiLight
31 Dec 2017, 23:06
Forum: Ask For Help
Topic: Couple of questions.
Replies: 10
Views: 1646

Re: Couple of questions.

1. I think you'll need to use a dllcall for this, possibly SetWindowPos , also set WS_CLIPSIBLINGS as the docs specify e.g. Gui, 1: Add, Picture, +0x4000000 x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%, %var_4% 2. I think you missed what I meant by read into an array. Like this: alt:: if(WinExist("test"...
by KuroiLight
31 Dec 2017, 14:43
Forum: Ask For Help
Topic: ControlClick On Text
Replies: 18
Views: 2345

Re: ControlClick On Text

Does the control have a title? please post the line in which the control is added.
by KuroiLight
31 Dec 2017, 14:31
Forum: Ask For Help
Topic: Couple of questions.
Replies: 10
Views: 1646

Re: Couple of questions.

Oh, I thought you were having trouble getting gLabel to work, my bad. for what you want to do, you may have to adjust the layers of the controls. or Just use the picture as the button with gLabel: global MySubroutine Gui, Add, Picture, x0 y0 w100 h100 gMySubroutine, % ".\sample.jpg" return MySubrout...
by KuroiLight
31 Dec 2017, 14:02
Forum: Ask For Help
Topic: Couple of questions.
Replies: 10
Views: 1646

Re: Couple of questions.

You can speedup lookup by reading the file into an array/map at the start of the script instead of reading from the file every time the hotkeys called. GUI, Add, Picture is probably not going to get much faster without switching to gdi, assuming it doesn't already use it efficiently itself. *EDIT* a...
by KuroiLight
31 Dec 2017, 03:13
Forum: Ask For Help
Topic: I want to optimize my script.
Replies: 9
Views: 2261

Re: I want to optimize my script.

You should avoid using strings like this altogether, an Array is more appropriate and likely faster for the interpreter.
If you need to split a string list of values and rejoin them after, use StrSplit and Format.
Though it seems you found your answer.
by KuroiLight
31 Dec 2017, 00:50
Forum: Ask For Help
Topic: Simple Script to backup a folder every day
Replies: 16
Views: 3580

Re: Simple Script to backup a folder every day

you should loop through the files and check to see if the backed up copies have an different modification/creation timestamp than the originals then update the backups. Here: SetWorkingDir %A_ScriptDir% CreateDirectoryBackup(".\FolderOrigin", ".\FolderDest") return CreateDirectoryBackup(Source_Direc...
by KuroiLight
30 Dec 2017, 23:39
Forum: Ask For Help
Topic: How best to permanently store a variable
Replies: 13
Views: 3311

Re: How best to permanently store a variable

Its a lot of code, that does very little. It basically boils down to: BackVar(ByRef var, new_value, filename) { static var_lasttime var := new_value if(!var_lasttime and (A_TickCount - var_lasttime) > 60000) { var_lasttime := A_TickCount hFile := FileOpen(filename, "rw-rwd") hFile.Write(var) hFile.C...
by KuroiLight
30 Dec 2017, 13:35
Forum: Ask For Help
Topic: How best to permanently store a variable
Replies: 13
Views: 3311

Re: How best to permanently store a variable

If you are looking to store a variable but don't want to write too often to the HDD, Then you should be better off just storing the variable in memory and only writing to file every so often, or after a certain number of accesses, this is how I do Logging so I'm not keeping my SSD too busy. somethin...
by KuroiLight
29 Dec 2017, 02:21
Forum: Ask For Help
Topic: Do scripts handle WM_CLOSE? Bug?
Replies: 0
Views: 352

Do scripts handle WM_CLOSE? Bug?

IDK why but all my scripts stopped responding to WinClose today, I'm 100% sure they were before. I decided to test for errors via dllcall, trying both SendMessage with WM_CLOSE and CloseWindow SendMessage returned no errors but did nothing and CloseWindow caused my scripts to end but a hidden window...
by KuroiLight
29 Dec 2017, 00:21
Forum: Ask For Help
Topic: Script Refuses to die - Winclose Topic is solved
Replies: 8
Views: 1357

Re: Script Refuses to die - Winclose Topic is solved

do """" for example: """Hello World"""
by KuroiLight
29 Dec 2017, 00:11
Forum: Ask For Help
Topic: Script Refuses to die - Winclose Topic is solved
Replies: 8
Views: 1357

Re: Script Refuses to die - Winclose Topic is solved

Yea. Make sure DetectHiddenWindows, On is at the top of your script, and retry WinClose
by KuroiLight
28 Dec 2017, 23:57
Forum: Ask For Help
Topic: Script Refuses to die - Winclose Topic is solved
Replies: 8
Views: 1357

Re: Script Refuses to die - Winclose Topic is solved

Code: Select all

WinGet, Script_PID, PID, ahk_id %Hwnd%
Process, Close, %Script_PID%
Are you on Windows 10?
by KuroiLight
28 Dec 2017, 23:49
Forum: Ask For Help
Topic: Script Refuses to die - Winclose Topic is solved
Replies: 8
Views: 1357

Re: Script Refuses to die - Winclose Topic is solved

Don't know if its related, but I just started having the same problem, WinClose & WinKill won't close other scripts; Process, Close works though I don't want to use it in my case.
by KuroiLight
27 Dec 2017, 14:55
Forum: Ask For Help
Topic: Script crashing, assuming access violation, not sure. Topic is solved
Replies: 10
Views: 1699

Re: Script crashing, assuming access violation, not sure. Topic is solved

Ok changing the message to WM_COPYDATA worked. In-case anyone is wondering here's what I ended up with: CNS.ahk ;Centralized Notification System ;Version: 1.0 ;Author: KuroiLight/klomb ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #Include %A_ScriptDIr%\includes\CommonCode.ahk #NoEnv #SingleInstance, force #Per...

Go to advanced search