Jump to content

open textbox on mouse click


 Share

Recommended Posts

  • Moderators

I several mouse positions and based on them I would like to display something diffrent.

Hi, mrjoli021. I believe you would have to put forth considerable effort to provide us with less information :)

Can you please explain in detail what you're trying to accomplish, and provide what you have thus far (even if it does not work).

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I want something like this. I have a map and need to make it as my wallpaper. When I click on certain cities, I would like to get a txt or msgbox to come up with more info on that city.

if MouseClick ( "left" , 373, 430, 1 ) Then
   MsgBox(4096, "Test", "This is a test", 10)
EndIf
Link to comment
Share on other sites

This is something that is quite easy to accomplish.

I suggest to try to solve it yourself, and try to break out of your usual routine

and providing lousy information, and not even trying anything except modifying

code handouts.

You know it makes sense and will be better for you, when you login with your next project.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

why is this shows up when I run the program, but when I click on position (373, 430) it does not show up

if MouseClick ( "left" , 373, 430, 1 ) = 1 then 
          ICG()
endif

Func ICG()
   ToolTip($account & @CRLF & $computer & @CRLF & $tvid & @CRLF & $ip,0, 0,"ICG Support Info:")
   Sleep(10000)
   ToolTip("")
EndFunc
Link to comment
Share on other sites

Because MouseClick Function Clicks the mouse at the coordinates you supply.

MouseClick returns non zero on success, so your function is called.

You should be looking at the functions

_IsPressed() ;can detect a mouseclick if called in a loop

MouseGetPos ; can return the position of the mouse at the time it is called.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Seems to me like you're thinking along the lines of Visual Studio programming where you can define events. AutoIt is a bit different in handling events...

#include <array.au3>
#include <guiconstants.au3>

GUICreate("test", 200, 200, -1, -1)
GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()
$aMouse = MouseGetPos() ; Remembers current mouse position

Select

Case $msg = $GUI_EVENT_PRIMARYDOWN
ConsoleWrite("Mouse Clicked at " & $aMouse[0] & "," & $aMouse[1] & @LF)

Case $msg = $GUI_EVENT_CLOSE
Exit

EndSelect
WEnd

What I've done here is told autoit to report in the console window where the mouse position is when the mouse is pressed. You can change it and add IF/THEN statements to perform functions on the x,y of the mouse position at the time of a click.

If this helps you, please post that it does. Thanks!

EDIT:

Had to add back the #includes as the forum stripped it out for some reason....

Also, I've read over some of the posts from others, and I must apologize for the way you've been spoken to. Not everyone in the tech world posesses soft skills.....

Edited by Colyn1337
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...