hiitiger / goverlay

DirectX hook and game overlay solution for Electron, Qt and CEF, just like discord/steam game overlay,inject any app to overlay in your game
Other
800 stars 111 forks source link

Is there a way to fetch the current x & y position of the overlay? #121

Closed rob1121 closed 4 months ago

rob1121 commented 9 months ago

I'm attempting to retrieve the updated x and y coordinates of the overlay window after moving it, but the window.getPosition() consistently returns the same [x, y] value. Any suggestions on how to accurately fetch the x and y coordinates?

hiitiger commented 9 months ago

if you need to get the in game postion of an overlay window, you can add an ipc message for it, pass it from ingame dll to app side thought the IPC each time a movement is done

rob1121 commented 8 months ago

Thank you, @hiitiger. Can you direct me to the specific file I should check?

hiitiger commented 8 months ago

@rob1121 https://github.com/hiitiger/sln/blob/main/n_overlay/overlay/overlay.cc#L369 https://github.com/hiitiger/sln/blob/main/n_overlay/overlay/overlay.cc#L415

here you can send back the new windows position from in-game to electron side