Search found 4090 matches

by swagfag
16 Jan 2021, 19:33
Forum: Ask For Help
Topic: Put a structure to a DLL file Topic is solved
Replies: 4
Views: 226

Re: Put a structure to a DLL file Topic is solved

ur struct size and layout(offsets) are all wrong StructLen := 12 + StrLen(File) + 1 VarSetCapacity(ParamStruct, StructLen, 0) ... NumPut(2, ParamStruct, 0, "Uint") ; 2 - ManualMap injection method NumPut(0, ParamStruct, 4, "Uint") ; 0 - NtCreateThreadEx NumPut(uFlags, ParamStruct, 8, "UInt") ; In C ...
by swagfag
16 Jan 2021, 19:20
Forum: Ask For Help
Topic: Function recursion limit exceeded
Replies: 2
Views: 66

Re: Function recursion limit exceeded

im looping the code with a Gosub at the end of the code
then dont do that and use a goto or, better yet, a regular Loop
by swagfag
22 Dec 2020, 04:02
Forum: Ask For Help
Topic: VarSetCapacity variable reading error Topic is solved
Replies: 3
Views: 81

Re: VarSetCapacity variable reading error Topic is solved

because u cannot return VarSetCapacity allocated variables from functions(except by assigning back to a ByRef function parameter) if u want to return using the return keyword, ull have to allocate memory on the heap using dllcall GlobalAlloc or HeapAlloc or any other memory management function avail...
by swagfag
21 Dec 2020, 07:25
Forum: AutoHotkey v2 Help
Topic: GroupBox Controls?
Replies: 1
Views: 56

Re: GroupBox Controls?

u dont. u add the controls to a Gui object. if ure asking how to sensibly position controls "belonging" inside a GroupBox inside the GroupBox, u can use the Section and its related xs , ys positional GuiControl option specifiers or u can use math and calculate some coordinates urself then set the co...
by swagfag
16 Dec 2020, 11:46
Forum: Ask For Help
Topic: Defining Class Members (in vs out of constructor) Topic is solved
Replies: 3
Views: 82

Re: Defining Class Members (in vs out of constructor) Topic is solved

depends. identical by what metric? after having been constructed, instances derived from these classes can be considered identical - both will contain the same named fields with the same values. its the method by which this was achieved that differs. in ur first example, the variables are set by the...
by swagfag
16 Dec 2020, 02:32
Forum: Gaming
Topic: Help with DLL call
Replies: 1
Views: 51

Re: Help with DLL call

ull have to find out what the defines are mapped to. if HWND and RECT are the ones from the windows headers, their type is Ptr . MouseButton could be anything(a pointer, an enum, etc), so ud have to check. sample code could look like this: DllCall("the_dll_name.dll\MouseClick", "Ptr", some_hwnd, "Pt...
by swagfag
14 Dec 2020, 03:00
Forum: AutoHotkey v2 Development
Topic: [v2.122] Class.New() memory leak Topic is solved
Replies: 2
Views: 209

Re: [v2.122] Class.New() memory leak Topic is solved

im not convinced it's the .New() thats causing the supposed leaks. this script declares a bunch of global(but this probably doesnt matter) variables. they have to be stored somewhere, which takes up some bit of space. im not sure whether theres any kind of mechanism built into ahk to prune blanked-o...
by swagfag
14 Dec 2020, 02:46
Forum: Ask For Help
Topic: Safe to link two objects together? Topic is solved
Replies: 2
Views: 85

Re: Safe to link two objects together? Topic is solved

If both objects are created and linked inside of a function as local variables, will both objects be released when it exits while still linked together this way? no they wont be, and if u for some reason lose ur only handle to those objects, u will have leaked them. there is more(although not much)...
by swagfag
11 Dec 2020, 08:13
Forum: Ask For Help
Topic: Sending class members to functions?
Replies: 4
Views: 108

Re: Sending class members to functions?

its something specific to ahk in general(and v2, hopefully, only for the time being) object properties cannot be the target of OutputVar function(command) parameters(fails silently in v1; u get an error in v2) workarounds are: introduce a method that queries the x/y and assigns them to the propertie...
by swagfag
08 Dec 2020, 06:38
Forum: AutoHotkey v2 Help
Topic: Working directory for Loop Files?
Replies: 1
Views: 448

Re: Working directory for Loop Files?

it uses whatever directory was the default one prior to the loop starting. basically it takes a snapshot, it doesnt matter what u set the default to afterwards
by swagfag
07 Dec 2020, 03:06
Forum: AutoHotkey v2 Help
Topic: Is empty return still required in V2? Topic is solved
Replies: 1
Views: 663

Re: Is empty return still required in V2? Topic is solved

its not required. v2 hotkeys are now entirely based on functions instead of labels. a function whose scope ends implicitly returns an empty string. single line hotkeys implicitly return(same as in v1)
by swagfag
06 Dec 2020, 03:25
Forum: AutoHotkey v2 Help
Topic: GDI+ MeasureString function not working in v2-alpha
Replies: 3
Views: 889

Re: GDI+ MeasureString function not working in v2-alpha

Ptr := A_PtrSize ? "UPtr" : "UInt" not needed, replace all ptr types with 'Ptr' declare library functions force- local or declare their variables local , Ptr, StrPtr(sString) this could probably just be 'Str', sString, but i cant check for sure ObjPtr(RC) returns the address of where the AHK object...
by swagfag
03 Dec 2020, 04:58
Forum: AutoHotkey v2 Help
Topic: Create nested class instance from variable Topic is solved
Replies: 5
Views: 686

Re: Create nested class instance from variable Topic is solved

C is just a variable name i chose cause i couldnt come up with anything better. u should probably rename it to something more meaningful. it doesnt refer to the class class c {} (in ur code). Where can I find documentation about this? Don*t have even an idea where to search for ... u cant search fo...
by swagfag
02 Dec 2020, 07:32
Forum: AutoHotkey v2 Help
Topic: Create nested class instance from variable Topic is solved
Replies: 5
Views: 686

Re: Create nested class instance from variable Topic is solved

u have to parse the string and iterate through the classes until u get to the one u wish to new up #Requires AutoHotkey v2.0-a122-f595abc2 class b { class c {} } cn := "b.c" o4 := newFromString(cn) newFromString(str, Args*) { ClassNames := StrSplit(str, '.') C := %ClassNames.RemoveAt(1)% for name in...
by swagfag
01 Dec 2020, 17:58
Forum: Gaming
Topic: Finding centre of an object
Replies: 3
Views: 846

Re: Finding centre of an object

is it possible this, is it possible that. many things are possible. and many are not. depending on the degree of expertise and all. what ure describing is possible. is it possible out of the box? no, ull have to implement the algorithms that make it possible urself. i dont know why u would want to w...
by swagfag
01 Dec 2020, 11:49
Forum: Gaming
Topic: Finding centre of an object
Replies: 3
Views: 846

Re: Finding centre of an object

with opencv, first u isolate the red channel(or whichever one gives u the most consistent outline), then u clean it up with some morphological transformations, blurs/sharpens if need be, then u make a cv contour out of it. divide its moments to obtain the centroid(if thats what u meant by "center". ...
by swagfag
01 Dec 2020, 08:53
Forum: Ask For Help
Topic: Hardware for data crunching and large arrays
Replies: 2
Views: 184

Re: Hardware for data crunching and large arrays

but if u do want to throw hardware at ahk in particular, get the one with the highest sustained single core clock count this will net u virtually no gains whatsoever in comparison with improving ur number crunching algorithms or simply rewriting the logic in native code. u should probably just do th...
by swagfag
01 Dec 2020, 05:49
Forum: Ask For Help
Topic: Closing File Objects on the Object Topic is solved
Replies: 1
Views: 142

Re: Closing File Objects on the Object Topic is solved

its not needed, releasing the last reference to a FileObject closes it automatically

FO := is a syntax error though
by swagfag
30 Nov 2020, 18:41
Forum: Bug Reports
Topic: Excess of Goto to the same label?
Replies: 5
Views: 881

Re: Excess of Goto to the same label?

ive explained the nature of the error already: firing up too many pseudothreads without allowing them to finish. u have a menu action button that clears a flag( condition ) and a MsgBox confirmation button that sets it. the flag is evaluated at the very beginning of each outer while loop iteration( ...
by swagfag
30 Nov 2020, 16:50
Forum: AutoHotkey v2 Help
Topic: Conditional Hotkeys without labels? Topic is solved
Replies: 5
Views: 871

Re: Conditional Hotkeys without labels? Topic is solved

#Requires AutoHotkey v2.0-a122-f595abc2 MySimpleHotkey(hotkeyTrigger, whatToSend) { MyCustomSendFunc(ThisHotkey) { ; hotkey callbacks require at least one argument Send(whatToSend) } Hotkey(hotkeyTrigger, 'MyCustomSendFunc') } HotIfWinActive "ahk_class Notepad" MySimpleHotkey "^!c", "^c" ; sends CT...

Go to advanced search