MarcusFernstrom Posted January 10, 2014 Share Posted January 10, 2014 I've been trying to figure out how to make a function to remap locations. I'd like to have it so that you click a button "Map coordinates", and then click on the locations. I know how to get the mouse coordinates, but I can't figure out how to trigger a function when the mouse button is clicked in other windows. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 11, 2014 Share Posted January 11, 2014 See _IsPressed() in the Help file. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Rogue5099 Posted January 11, 2014 Share Posted January 11, 2014 (edited) #include <Misc.au3> #include <GuiConstants.au3> $GUICoord = GUICreate('Mouse Finder Tool', '150', '20', '-1', '-1', '-1', '128') Global $CoordInput = GUICtrlCreateInput('', '0', '0', '150', '20', '1') GUICtrlSetFont($CoordInput, '9', '600', '', 'Arial') GUICtrlSetState($CoordInput, $GUI_DISABLE) GUISetState(@SW_SHOW, $GUICoord) WinSetOnTop($GUICoord, '', '1') AdlibRegister("RefreshCoord", 50) Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("01", $hDLL) Then $Pos = MouseGetPos() ConsoleWrite("X: " & $Pos['0'] & " Y: " & $Pos['1'] & @CRLF) While _IsPressed("01") Sleep(1) WEnd EndIf If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop WEnd DllClose($hDLL) AdlibUnRegister("RefreshCoord") GUIDelete($GUICoord) Func RefreshCoord() $Pos = MouseGetPos() GUICtrlSetData($CoordInput, "X: " & $Pos['0'] & " Y: " & $Pos['1']) EndFunc Edited January 11, 2014 by Rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now