Classes in AHK, Basic tutorial.

Helpful script writing tricks and HowTo's
Pall Parker
Posts: 2
Joined: 24 Jul 2018, 09:34

Re: Classes in AHK, Basic tutorial.

24 Jul 2018, 09:40

Thanks for the tutorial!!!
Posts: 21
Joined: 04 Feb 2016, 20:09

Re: Classes in AHK, Basic tutorial.

30 Jul 2018, 15:34

classes remind me of ARRAYS
User avatar
Sabestian Caine
Posts: 373
Joined: 12 Apr 2015, 03:53

Re: Classes in AHK, Basic tutorial.

01 Jan 2019, 01:58

Great tutorial on Classes. :bravo: :bravo: :bravo:

But, still I am not getting how to use classes in simple stuffs?? :roll: :roll: :roll:
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.
Posts: 649
Joined: 16 Oct 2013, 13:53

Re: Classes in AHK, Basic tutorial.

27 Jan 2019, 03:44

I like the simplicity of the lesson of Class above.
I think even, that the description / comments is good when the complexity increases.

However, there are still parts that I do not understand. (eg. this.ID - is there more similar "variables" like this.?)
Searched in AHK help file but did not find anything.

Another thing that I didn't get to operate, as I desire, is the calculator. Wrong windows can be activated.
(for example, Explorer can become active instead of the Calculator - Maybe it is the programscript / Win 10 / Swedish version?)
How can I be sure that the right window is activated (Now it was so - most of time - but I just had luck?)
Perhaps the example had worked better if the instruction WinActivate had been supplemented with which window to be activated?.

Another problem that arose was when the Notepad were opened. Notepad were opened so quickly that it became a wrong header.
I solved this with the following code .:

Code: Select all

IfWinNotExist ahk_class Notepad
{	Run Notepad
	WinWait ahk_class Notepad
Finally, although the example does not handle problems, is it perhaps important?
If a code doesn't work as intended (for various reasons)
For example, if nothing happens, an error management can give tips on what went wrong?

I think the example shows that Class can add details that cannot be done otherwise (eg. __New)
Thanks again! :bravo:

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 4 guests