Closed arch-daemone closed 5 years ago
This depends on the location of the user's WinGetPosEx.ahk
file. According to the AutoHotkey documentation:
A script may call a function in an external file without having to use #Include. For this to work, a file of the same name as the function must exist in one of the following library directories:
%A_ScriptDir%\Lib\ ; Local library - requires [v1.0.90+]. %A_MyDocuments%\AutoHotkey\Lib\ ; User library. path-to-the-currently-running-AutoHotkey.exe\Lib\ ; Standard library.
That being said, whomever downloads this repo is likely to not place it within those directories, and instead attempt to run WindowPadX from whichever location to which it was downloaded.
Basically, all that to say—I agree with the change (although I haven't personally tested it).
Interesting. The location of WinGetPosEx.ahk is right next to WindowPadX.ahk and WXPA.ahk, in this repo, i.e. %A_ScriptDir%
.
Is there a commonly used WinGetPosEx that many ahk users would already have? This is the only serious ahk script I've ever tinkered with, besides one I made a while ago to log me into my office's fire register when I log into my laptop! So I certainly don't have a WinGetPosEx already.
No, you're right in that most users wouldn't have WinGetPosEx previously installed. That's the main reason that I agree with your proposed change. :)
I apologize if my previous message was confusing. Chalk it up to me being a bit too tired to have written a properly coherent comment.
Ah, ok. No problem! Actually, after reading your first comment I was trying to figure out if it was worth putting WinGetPosEx in %A_ScriptDir%/Lib
instead of adding the #include line. But then we need to find out if the implicit import preferentially looks there or in one of the global locations, and if users who have a global WinGetPosEx would actually want it to go looking globally first (because it probably doesn't)...
Those were the things buzzing through my mind when I asked if many users had a WinGetPosEx already. Sorry, I tend to overthink these things!
So what's the protocol these days? @hoppfrosch , how do you feel about a merge? :) I saw from @pacobyte's PR in November that you're not actively working on (or even using!) WindowPadX anymore. Is the nod from @pacobyte good for you?
Hi @hoppfrosch Any thoughts? Can I have a merge?
I found the fix that @DaemonExMachina put together useful. It would be nice to see it merged.
Merge done
Trying to run WindowPadX was failing (at least in AHK v1.1) with the error that it was trying to call the nonexistent function WinGetPosEx.
This was due to a missing #include line to the file WinGetPosEx.ahk. This has now been added, and the script can run and compile again.