Search found 515 matches

by AHK_user
06 Mar 2024, 14:08
Forum: Ask for Help (v2)
Topic: Generate a string of multiple times the same character Topic is solved
Replies: 3
Views: 115

Re: Generate a string of multiple times the same character Topic is solved

@RussF and @Rohwedder :
Thanks for the responses, this indeed works well.

Small change to allow 0 as an input:

Code: Select all

Replic(T, N) {
	Return N=0 ? "" : StrReplace(Format("{:0" N "}",0),0,T)
}
by AHK_user
06 Mar 2024, 06:26
Forum: Ask for Help (v2)
Topic: Generate a string of multiple times the same character Topic is solved
Replies: 3
Views: 115

Generate a string of multiple times the same character Topic is solved

Does anybody knows a good method to generate a string of an amount of the same character? A loop would be the most obvious choice, but is there a better/faster method? In my code I need to create a variable that contains a specific number of tabs. Currently I use SubStr, but it has the disadvantage ...
by AHK_user
26 Jan 2024, 14:08
Forum: Ask for Help (v2)
Topic: Create a function DrawLine - GUI Topic is solved
Replies: 7
Views: 505

Re: Create a function DrawLine - GUI Topic is solved

That is easy: #Requires AutoHotkey v2.0 #SingleInstance force MyGui := Gui(, 'Test Draw a line v1') MyGui.SetFont('cGreen bold underline s13', 'Verdana') MyGui.AddText('x15 y10 w300 h20 center', 'Draw a line / Rectangle') AddRectangle(MyGui, 50 , 100, 100, 100,"Blue",10) MyGui.Show("x200 y200 h400 w...
by AHK_user
24 Jan 2024, 13:45
Forum: Ask for Help (v2)
Topic: Create a function DrawLine - GUI Topic is solved
Replies: 7
Views: 505

Re: Create a function DrawLine - GUI Topic is solved

To simply draw a line on a Gui, just use an empty text with a background color.

Code: Select all

MyGui.AddText("w100 h2 BackgroundBlack")
by AHK_user
24 Jan 2024, 06:32
Forum: Ask for Help (v2)
Topic: Create a function DrawLine - GUI Topic is solved
Replies: 7
Views: 505

Re: Create a function DrawLine - GUI Topic is solved

GuiBox := GuiRectangle() GuiBox.MovePos(10, 10, 300, 300) GuiBox.Show() GuiRectangle(x:= 0, y:= 0 ,w:= 100 ,h:=100 , Color:="Blue",Thickness := 2){ Static GuiBox := "" if IsObject(GuiBox){ try GuiBox.Destroy() } GuiBox := Gui(" +ToolWindow -Caption +AlwaysOnTop +E0x20 -DPIScale", "Highlight") GuiBo...
by AHK_user
20 Dec 2023, 06:30
Forum: Scripts and Functions (v2)
Topic: Small AHK v2 functions
Replies: 2
Views: 937

Re: Small AHK v2 functions

I do not understand.
V2 has already default min and max functions, who accept both parameters or arrays.

Only the HasVal functions does not exist.
by AHK_user
16 Dec 2023, 15:27
Forum: Ask for Help (v2)
Topic: [V2] Overwrite ahk functions??? Topic is solved
Replies: 17
Views: 1334

Re: [V2] Overwrite ahk functions??? Topic is solved

OK, thanks for the explanation, I never done a lot of error handling. This is the final proper code: #Requires AutoHotkey v2.0 #SingleInstance force ; example effort to try to overwrite original ahk code WinGetPos.DefineProp("Call", {Call:_WinGetPos}) _WinGetPos(this, &X?, &Y?, &W?, &H?, args*) { tr...
by AHK_user
16 Dec 2023, 05:39
Forum: Ask for Help (v2)
Topic: [V2] Overwrite ahk functions??? Topic is solved
Replies: 17
Views: 1334

Re: [V2] Overwrite ahk functions??? Topic is solved

lexikos : So like this? Could you explain the difference? It seems TargetError has the same properties. #Requires AutoHotkey v2.0 #SingleInstance force ; example effort to try to overwrite original ahk code WinGetPos.DefineProp("Call", {Call:_WinGetPos}) _WinGetPos(this, &X?, &Y?, &W?, &H?, args*) ...
by AHK_user
11 Dec 2023, 14:42
Forum: Ask for Help (v2)
Topic: Very first Autohotkey V2 script, need advice
Replies: 4
Views: 320

Re: Very first Autohotkey V2 script, need advice

This is the same script, written shorter: #Requires AutoHotkey v2.0 #SingleInstance force Hotkey("<", RemapAll) Hotkey("< up", RestoreAll) RemapAll(ThisHotkey){ Hotkey("j", (*)=>(SendInput("{Left}")), "On") Hotkey("k", (*)=>(SendInput("{Down}")), "On") Hotkey("i", (*)=>(SendInput("{Up}")), "On") Hot...
by AHK_user
09 Dec 2023, 06:58
Forum: Ask for Help (v2)
Topic: [V2] Overwrite ahk functions??? Topic is solved
Replies: 17
Views: 1334

Re: [V2] Overwrite ahk functions??? Topic is solved

@AHK_user It is better to catch TargetError than to inspect the Message. The documentation says "A TargetError is thrown if the window could not be found." It does not say what message the TargetError will have. @lexikos: I am not that familiar with the error handling. Could you give an example, or...
by AHK_user
08 Dec 2023, 01:35
Forum: Suggestions on Documentation Improvements
Topic: v2 Tutorial code doesnt work? Topic is solved
Replies: 4
Views: 592

Re: v2 Tutorial code doesnt work? Topic is solved

It should normally work, please check if you have notepad installed on you computer.

This is certainly not the correct place for this post, Please move it to Bug reports.
by AHK_user
07 Dec 2023, 17:56
Forum: Scripts and Functions (v2)
Topic: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated
Replies: 9
Views: 2004

Re: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated

Cool script, I like it. :bravo: I would not advise the use of my Object2Str function, a better function would be my Obj_Gui function. Obj_Gui is a nice example how to display more complex variables. https://www.autohotkey.com/boards/viewtopic.php?f=83&t=103437&hilit=gui+object#p459683 :think: I will...
by AHK_user
03 Dec 2023, 05:00
Forum: Ask for Help (v2)
Topic: [V2] Overwrite ahk functions??? Topic is solved
Replies: 17
Views: 1334

Re: [V2] Overwrite ahk functions??? Topic is solved

I improved error handling so it would only react on the "Target window not found". In other cases it would just display the error as normal, not mentioning the modified function. #Requires AutoHotkey v2.0 #SingleInstance force ; example effort to try to overwrite original ahk code WinGetPos.DefinePr...
by AHK_user
02 Dec 2023, 18:20
Forum: Ask for Help (v2)
Topic: [V2] Overwrite ahk functions??? Topic is solved
Replies: 17
Views: 1334

Re: [V2] Overwrite ahk functions??? Topic is solved

Thanks! This was what I was looking for. Amazing what V2 can do.

Of course it is not the best practice, that would be to just name it different but so cool that this is possible.

:D :bravo:
by AHK_user
02 Dec 2023, 09:54
Forum: Ask for Help (v2)
Topic: [V2] Overwrite ahk functions??? Topic is solved
Replies: 17
Views: 1334

Re: [V2] Overwrite ahk functions??? Topic is solved

Is it maybe possible to first create a clone of copy of the function and use that clone in the new function?
by AHK_user
02 Dec 2023, 09:44
Forum: Ask for Help (v2)
Topic: [V2] Overwrite ahk functions??? Topic is solved
Replies: 17
Views: 1334

[V2] Overwrite ahk functions??? Topic is solved

Is it possible to change the behaviour of native ahk functions, but still have access to the original functions? On the forum you can find examples how to overwrite or modify existing classes like Gui. https://www.autohotkey.com/boards/viewtopic.php?f=83&t=86124&hilit=gui+ext+v2 It is possible to ov...
by AHK_user
02 Dec 2023, 06:57
Forum: Ask for Help (v2)
Topic: Help updating my script to V2 Topic is solved
Replies: 8
Views: 620

Re: Help updating my script to V2 Topic is solved

The V1 to V2 convertor is now updated to handle this script.
Apparently the Gui, New command gave a small error.
https://github.com/mmikeww/AHK-v2-script-converter
by AHK_user
30 Nov 2023, 06:27
Forum: Ask for Help (v2)
Topic: Encrypt/Decrypt Topic is solved
Replies: 2
Views: 365

Re: Encrypt/Decrypt Topic is solved

mikeyww wrote:
28 Nov 2023, 05:24
Hello,

The forum page has a search form in the top right corner. Perhaps the following page helps.

viewtopic.php?f=83&t=96117
Thanks!
My excuses, It seems that I missed this :facepalm:
by AHK_user
28 Nov 2023, 04:51
Forum: Ask for Help (v2)
Topic: Encrypt/Decrypt Topic is solved
Replies: 2
Views: 365

Encrypt/Decrypt Topic is solved

Does somebody has good Encrypt/Decrypt functions for AHK V2?
by AHK_user
22 Nov 2023, 15:19
Forum: Scripts and Functions (v2)
Topic: [v2-Beta] - QuickLinks
Replies: 16
Views: 4735

Re: [v2-Beta] - QuickLinks

This is a great piece of kit, thank you so much for sharing! @AHK_user would you be willing to put the script on GitHub so the community could collaborate on improving it? A thread of forum posts generally isn't a super amazing medium for this. I could do it myself, but it feels a bit wrong to impl...

Go to advanced search