Mouse Click doesn't work - (Moved)

Recommended Posts

Hi All,

I am trying to login into our application using AutoIT. When I launch the application a splash screen appears and the login screen goes behind it. At this point the script pauses and I loose control of everything. I have literally tried everything for the past two days but nothing has worked yet. Any suggestions would be appreciated.

RunWait("\\mchsv411.siplaceworld.net\splmshare\int00\conf\start_apps\windows\start_nx110.bat en portal_client int00 tc112", "", @SW_MAXIMIZE)

AutoItSetOption("SendKeyDelay", 200)

Local $hWnd = WinWaitActive("Teamcenter Login") MouseClick("left", @DesktopWidth / 2, @DesktopHeight / 2) The splash screen has title "Teamcenter" and is static. I tried to click on the center to get control of login window. I have tried WinActivate, WinSetState, ControlCommand and a lot of other things. Link to post Share on other sites • Moderators Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columns ChooseFileFolder ---- Single and multiple selections from specified path treeview listing Date_Time_Convert -- Easily convert date/time formats, including the language used ExtMsgBox --------- A highly customisable replacement for MsgBox GUIExtender -------- Extend and retract multiple sections within a GUI GUIFrame ---------- Subdivide GUIs into many adjustable frames GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView Marquee ----------- Scrolling tickertape GUIs NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes Notify ------------- Small notifications on the edge of the display Scrollbars ----------Automatically sized scrollbars with a single command StringSize ---------- Automatically size controls to fit text Toast -------------- Small GUIs which pop out of the notification area Link to post Share on other sites 5 hours ago, lunarlattice said: I have tried WinActivate, WinSetState, ControlCommand and a lot of other things. Where is the code so? Post the AutoItWindowInfoTool summary too Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Link to post Share on other sites Splash Screen Summary >>>> Window <<<< Title: Teamcenter Class: Static Position: 366, 218 Size: 633, 332 Style: 0x9600000E ExStyle: 0x00000000 Handle: 0x0000000000D4097E >>>> Control <<<< Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: Login Window Summary >>>> Window <<<< Title: Teamcenter Login Class: SWT_Window0 Position: 283, 64 Size: 800, 600 Style: 0x960A0000 ExStyle: 0x00100000 Handle: 0x00000000006003FC >>>> Control <<<< Class: SWT_Window0 Instance: 5 ClassnameNN: SWT_Window05 Name: Advanced (Class): [CLASS:SWT_Window0; INSTANCE:5] ID: 4328256 Text: Position: 323, 250 Size: 447, 350 ControlClick Coords: 12, 30 Style: 0x56010000 ExStyle: 0x00100000 Handle: 0x0000000000420B40 There are edit boxes inside the login window. Currently I am using Quote Local$hWnd = WinWaitActive("Teamcenter Login")

MouseClick("left", @DesktopWidth / 2, @DesktopHeight / 2)

But this works intermittently , it stops working abruptly and the script is paused all of a sudden.

Share on other sites

@lunarlattice
The script seems to be paused because you are using WinWaitActive(), and it does wait until the specifyed window became the active one.

Try to kill the splash screen using WinClose() or WinKill(), and then use WinGetHandle() or any other Win* function to interact with the login window.
If you need furhter assistance, please post the script you are working on in the <> code tag

Spoiler

Create an account

Register a new account

• Similar Content

• I'm writing a script that uses a lot of specific mouse clicks to automate tasks on my browser, server system, and email software for work.
Sometimes the system gets updated or someone drags a handle to the left or right and I have to put in new mouse click coordinates.

It would be a lot more easy to label them and put them in some sort of ini file, but then i have to load every X and Y (and sometimes mouse speed) into a variable

How would you guys go about such a script, any ideas on how to store and load lot's of click coordinates from a file?
There are some pixel color checks, sleeps and other code between the mouse clicks too..

- string replace new coordinates in the main script with another autoit script that uses a crosshair to show every mouse position.
- manually write an ini file and load every X, Y, Speed into a huge number of variables: $Searchinput_X = iniread....,$Searchinput_Yiniread...., $Searchinput_Speed = iniread.... - split a textfile line by line into an array and ignore labels that begin with ";" for example (a bit like a custom ini file) These all seem somewhat tedious i guess.. • By dejhost Hi. I am trying to automate a software called "LabelImg" (https://pypi.org/project/labelImg/). My autoit-script is started once I selected a folder with images within LabelImg. Pressing the button "Next Image" or pressing the shortcut "d" (https://github.com/tzutalin/labelImg#Hotkeys) jumps to the next image in the selected folder. This shall happen once per second. #include <Misc.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> Opt("WinTitleMatchMode", 1) Local$hDLL = DllOpen("user32.dll") While 1 If _IsPressed("1B", $hDLL) Then ExitLoop Else Local$temp = WinActivate("labelImg") ConsoleWrite($temp & @CRLF) If WinActivate("labelImg") Then ConsoleWrite("All Set!" & @CRLF) EndIf ;Send("d") Local$temp = MouseClick($MOUSE_CLICK_RIGHT, 50, 200) If$temp <> 1 Then MsgBox(1, "$temp",$temp) ExitLoop EndIf Sleep(1000) EndIf WEnd DllClose(\$hDLL) So the Send ("d")-command and the MouseClick are alternative methods to jump to the next image. Both fail.
Both ConsoleWrite's deliver proper feedback (I continiously get the handle and "All set" ).

Could you tell me what I'm doing wrong?
Thank you.
• By Rskm
Hi, recently i created a GUI for some calculations in AutoIT.  The GUI has 2 tabs and on the first tab, it has few inputboxes where i use to click with mouse and start entering the inputs. i recently made some changes in the position of these textboxes. I made this by changing the autoit code file instead of making changes in KODA. Now i cannot click inside these textboxes with mouse. However, i can use TAB key to cycle through/enter input in these input boxes. what could have made the inputboxes not responding to mouseclicks. thanks
• By lonardd
Hi,
I have a very strange problem concerning MouseClick function.
I need to start Control Panel, navigate it on the Display Section (Adjust screen resolution link), click on it, and from the next Dialog choose Intel Graphic tool tab and navigate into it when it opens.
I wasn't using MouseClick() at first when I tried to use Control IDs, but I was fed up with the Autoit Window Info poor and inaccurate info (It flickers and the moment I click on the control the control ID and class disappear) so I ended up choosing the easiest way.
The code I'm posting worked OK until two weeks ago, the mouse clicks were accurately performed and the Script reached the end with no errors...and I was happy.
All of a sudden, between one try and the other, I noticed the cursor not flying exactly where it was supposed to, namely to the Control Panel ->Display->Adjust screen resolution link   but it clicked some 30 pixels below and some 30 pixels to the left, choosing obviously and undesired function and from that point it screwed the whole thing up. And from that moment onward, it seems I can no longer regain the mouse to click on that sequence.
Could it be because my Control Panel ->Display form moved slightly from one test to another and therefore I got that small offside?
If you believe this is the reason, I should then re position the Control Panel ->Display window to 0,0 and recalculate all the clicks.
do you have a suggestion?

Thanks a lot
Dave

RotateDisplays.au3

• I have created a UDF that will allow you to easily create a customizable GUI with either a standard progress bar or a marquee style progress bar. You can change the size and back ground color of the GUI, as well as the font, font size, and color of the text. The function doesn't require any parameters to operate, but the default text is very generic so you probably would want to set that at the very least.
×

• Wiki
• AutoIt Resources

• FAQ
×
• Create New...