Search found 107 matches

by Onimuru
24 Jun 2022, 11:18
Forum: Ask for Help (v1)
Topic: Radial Menu v4 on Second Monitor
Replies: 3
Views: 518

Re: Radial Menu v4 on Second Monitor

Post the source of Radial Menu v4.
by Onimuru
24 Jun 2022, 02:26
Forum: Ask for Help (v1)
Topic: is there a better way to do this? Topic is solved
Replies: 4
Views: 474

Re: is there a better way to do this? Topic is solved

Here is a better way, there's a good chance that you don't need to consider the entire array so stop when you find a match: gArray := ["one", "two", "three", "four", "five"] gVar := "three" MsgBox, % IsItThere(gArray, gVar) ? "Yes" : "No" IsItThere(array, string) { for index, value in array { if (va...
by Onimuru
10 Jun 2022, 13:57
Forum: Ask for Help (v2)
Topic: "Missing" vs empty-string variadic parameter?
Replies: 6
Views: 1266

Re: "Missing" vs empty-string variadic parameter?

You can use

Code: Select all

IsSet()

Code: Select all

f(x*) {
	for v in x {
		if (!IsSet(v)) {
			MsgBox("Null.")
		}
		else if (v == "") {
			MsgBox("Empty string.")
		}
	}
}
by Onimuru
28 Jul 2021, 16:09
Forum: Wish List
Topic: GDI Become Official Autohotkey
Replies: 9
Views: 3314

Re: GDI Become Official Autohotkey

Yes you're right of course. I just thought I would say something lol
by Onimuru
28 Jul 2021, 01:48
Forum: Wish List
Topic: GDI Become Official Autohotkey
Replies: 9
Views: 3314

Re: GDI Become Official Autohotkey

I am against this, there are so many implementations of GDIp at this point and including any one wrapper would inevitably annoy people who have worked hard to write their own library and now need to combat the built in one.
by Onimuru
11 Jul 2021, 17:58
Forum: Ask for Help (v2)
Topic: How can I tell if a function exists? Topic is solved
Replies: 2
Views: 1152

Re: How can I tell if a function exists? Topic is solved

I would just use a try/catch block for that.
by Onimuru
17 Jun 2021, 08:43
Forum: Ask for Help (v1)
Topic: Help with GetKeyState please Topic is solved
Replies: 3
Views: 361

Re: Help with GetKeyState please Topic is solved

You need to give the hotkey the wildcard modifier:

Code: Select all

*$XButton2::
	if GetKeyState("LButton", "P") {
		Tooltip, Lbutton down
	}
	else {
		Tooltip, Lbutton Not down
	}

	return
by Onimuru
09 Jun 2021, 08:39
Forum: Ask for Help (v1)
Topic: Issue with movable picture controls. Topic is solved
Replies: 16
Views: 948

Re: Issue with movable picture controls. Topic is solved

I think you're fighting child z-order here. You can register WM_LBUTTONDOWN and if the hWnd is a control you can use the following code to bring it to the top: SWP_NOMOVE := 0x0002, SWP_NOREDRAW := 0x0008, SWP_NOSENDCHANGING := 0x0400, SWP_NOSIZE := 0x0001 if (!DllCall("User32\SetWindowPos", "Ptr", ...
by Onimuru
09 Jun 2021, 07:17
Forum: Ask for Help (v2)
Topic: Direct2D
Replies: 5
Views: 1207

Re: Direct2D

Cloaker on the AHK Discord server solved this for me. Here is the working solution: DrawLine(x1, y1, x2, y2, brush, strokeWidth := 1.0, strokeStyle := 0) { point0 := Buffer(8) NumPut("Float", x1, "Float", y1, point0) point1 := Buffer(8) NumPut("Float", x2, "Float", y2, point1) ComCall(15, this.Ptr, ...
by Onimuru
07 Jun 2021, 13:31
Forum: Ask for Help (v2)
Topic: Direct2D QuickStart - Drawing a Simple Rectangle Topic is solved
Replies: 10
Views: 3990

Re: Direct2D QuickStart - Drawing a Simple Rectangle Topic is solved

Because if the return type is HRESULT, any return value other than 0 will throw an OSError which in turn closes the script.
by Onimuru
07 Jun 2021, 07:56
Forum: Ask for Help (v2)
Topic: Direct2D
Replies: 5
Views: 1207

Re: Direct2D

Very well, thank you.
by Onimuru
07 Jun 2021, 07:16
Forum: Ask for Help (v2)
Topic: Direct2D
Replies: 5
Views: 1207

Re: Direct2D

malcev Thank you, I've managed to piece that together already. I'm struggling with two things in particular: 1] How do I convert a GDIp bitmap such that when I lock it's bits, I can pass that to ID2D1Bitmap::CopyFromMemory 2] How do I construct D2D1_POINT_2F for use with https://docs.microsoft.com/...
by Onimuru
06 Jun 2021, 04:54
Forum: Gaming Help (v1)
Topic: How to get color of cursor in game? Topic is solved
Replies: 7
Views: 885

Re: How to get color of cursor in game? Topic is solved

@emanate22

I can't replicate your issue. My best guess is that the cursor handle that you're retrieving from the game isn't valid for some reason but I don't know what the underlying issue might be. Perhaps you can open a new help request for this?
by Onimuru
06 Jun 2021, 04:36
Forum: Gaming Help (v1)
Topic: How to get color of cursor in game? Topic is solved
Replies: 7
Views: 885

Re: How to get color of cursor in game? Topic is solved

Error handling is important! You can get a more descriptive message from User32 functions with the following function: ErrorFromMessage(messageID) { if (!(length := DllCall("Kernel32\FormatMessage", "UInt", 0x1100 ;? 0x1100 = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER , "Ptr", 0, "U...
by Onimuru
05 Jun 2021, 18:52
Forum: Ask for Help (v2)
Topic: Direct2D
Replies: 5
Views: 1207

Direct2D

Has anyone made an effort at wrapping Direct2D for use with ahk v2?

I'm particularly struggling to marry a D2D1 bitmap with a GDIp bitmap's pBits and then draw to a layered hWnd RenderTarget. Any help would be greatly appreciated.
by Onimuru
26 May 2021, 08:59
Forum: AutoHotkey Development
Topic: [wish] Wish delete = for comparing strings
Replies: 46
Views: 14042

Re: [wish] Wish delete = for comparing strings

Most work in coding does not stem from typing an extra : before =. I don't think you should be so dismissive of this idea. v2 creates the perfect opportunity to do away with that unnecessary operator and just use the standard = operator since backwards compatibility is clearly not an issue. I think...
by Onimuru
22 May 2021, 16:12
Forum: Gaming Help (v1)
Topic: pixel search wont look for multiple colors
Replies: 5
Views: 722

Re: pixel search wont look for multiple colors

Lookup GDIp Lockbits. You can provide a bitmap to that function and it will return the bitmap data, after that you can test for however many colors you want in a loop.
by Onimuru
19 May 2021, 21:47
Forum: Ask for Help (v2)
Topic: Is there still a new operator of sorts? Topic is solved
Replies: 2
Views: 695

Re: Is there still a new operator of sorts? Topic is solved

You can use super:

Code: Select all

	static call(a:="", b:="", c:="") {
		;return s.new().method(a, b, c)
		return super().method(a, b, c)
	}
by Onimuru
15 May 2021, 05:05
Forum: Ask for Help (v2)
Topic: Custom prototype methods Topic is solved
Replies: 3
Views: 1063

Re: Custom prototype methods Topic is solved

v2 doesnt have an autoexecute section anymore, so u can include it pretty much anywhere it would syntactically make sense to do so(eg not inside a class definition where the instance vars go or in unreachable code paths, eg after an explicit return of the autoexec thread). of course, trying to call...
by Onimuru
14 May 2021, 08:20
Forum: Ask for Help (v2)
Topic: Custom prototype methods Topic is solved
Replies: 3
Views: 1063

Re: Custom prototype methods Topic is solved

I see that it's possible to do this: Array.Prototype.DefineProp("IndexOf", {Call: (this, needle, start := 0) => IndexOf(this, needle, start)}) IndexOf(this, needle, start) { static minIndex := [1][1] == 1 s := this.Length , start := (start >= 0) ? (Min(s, start)) : (Max(s + start, 0)) loop (s - star...

Go to advanced search