I present to you the 2 functions I made for clicking and click-dragging in trove while the window is not focused.
It's not perfect and I can't guarantee that it will work in all situations but seems to work pretty well for me.
Enjoy you freeloaders.
BackgroundClick(x, y, messageDelay, PID) {
lParam := x | (y << 16)
SendMessage, 0x006, 00000002, 00000000, , ahk_pid %PID% ;ACTIVE
PostMessage, 0x200, 00000001, %lParam%, , ahk_pid %PID% ;MOUSEMOVE
PostMessage, 0x201, 0x00120BD6, 0x01D80041, , ahk_pid %PID% ;LBUTTONDOWN
Sleep, %messageDelay%
PostMessage, 0x202, 0x00120BD6, 0x01D80041, , ahk_pid %PID% ;LBUTTONUP
return
}
BackgroundClickDrag(startX, startY, endX, endY, messageDelay, PID) {
;MessageDelay is used twice because we are using 3 messages that use the mouse
lParam := startX | (startY << 16)
SendMessage, 0x006, 00000002, 00000000, , ahk_pid %PID% ;ACTIVE
PostMessage, 0x200, 00000001, %lParam%, , ahk_pid %PID% ;MOUSEMOVE
PostMessage, 0x201, 00000001, %lParam%, , ahk_pid %PID% ;LBUTTONDOWN
Sleep, %messageDelay%
lParam := endX | (endY << 16)
PostMessage, 0x200, 0x0001, %lParam%, , ahk_pid %PID% ;MOUSEMOVE
Sleep, %messageDelay%
PostMessage, 0x202, 00000000, 02020001, , ahk_pid %PID% ;LBUTTONUP
return
}