Jump to content
Sign in to follow this  
jlorenz1

How to simulate a mouse click on a invisible window with a certain handle?

Recommended Posts

Hi,

PixelSearch ( left, top, right, bottom, color [, shade-variation = 0 [, step = 1 [, hwnd]]] )

Searches a rectangle of pixels for the pixel color provided  depending on a specified window handle.

MouseClick ( "button" [, x, y [, clicks = 1 [, speed = 10]]] ) makes a click on a specified position.

How can I simulate a MouseClick on a window depending on a specified handle, which is invisibel, and without moving the mouse really?

Is this possible? How is the syntax?

Thanks in advance

Jan


Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Share this post


Link to post
Share on other sites

You can't.

You can simulate the click, but the pixel part is not possible...

ControlClick

Why would you want to look for pixels?

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Hi jdelaney,

it's just for a browser game (=collecting  items ). I wanna do other things on my browser during that time .... There are no controls, only items...

Edited by jlorenz1

Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Share this post


Link to post
Share on other sites

jlorenz1,

You have been a member since '03 - I would have expected you to keep abreast of changes to the Forum rules (there is also a link at bottom right of each page). :(

Please read them before you post again - thread locked. :naughty:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By pete_wilde
      Hi Guys,
      As I am still finding my feet with AutoIT, I thought that I would do a quick test.
      I therefore created some HTML code to create a small yellow non-functioning test button on a web page.
      <td><div class="wg-button"><a style="position:relative" href="javascript:void(1)"><img src="button.png" alt=""> <span style="position:absolute;left:17px;top:31px; cursor:pointer; width:126px;">TEST</span></a></div></td> I then tried to see if AutoIT could detect if I clicked on the button link.
      #include <Misc.au3> #include <Msgboxconstants.au3> LOCAL $sPos LOCAL $sColor LOCAL $sYellow = "#FFFF00" While 1 $sPos = MouseGetPos() $sColor = Hex(PixelGetColor($sPos[0], $sPos[1])) $sColor = "#" & StringMid($sColor,3) ToolTip($sColor) If (_IsPressed("01") = True) And ($sColor = $sYellow) Then MsgBox (262144,"Found it","X=" & $sPos[0] & " Y=" & $sPos[1]) EndIf Wend The code correctly detects when I click on the button.
      However, it also highlights on anything else yellow (e.g. a yellow background) that I click on, not just the button.
      I did change the link from "empty" to "www.google.com" and then checked if the current browser URL changed also, thereby indicating that I clicked on a yellow link rather than just a yellow background. That worked fine.
      However, as it is about improving my knowledge of AutoIT rather than for a specific project, can anyone think of another way which I could do it?
      Detecting a URL change is fine, but I then end up on a new page i.e. www.google.com.
      I would like to see if I can do it without changing the size.
      Any ideas?
      Many thanks,
      Pete 
       
    • By vargheseg
      I am new to AutoIT but I do use Sikuli.  Decided to use AutoIT for  this project as all  the required can be created in an .exe file, does not  need Java like Sikuli.
      Also  which can be pushed to tool bar of Windows 10 desktop.
      Our users will interact with a client/server application and normally work on dual screen. The script needs to detect the c/s application from the dual screen,  needs to do three mouse clicks based of image/pixel comparison, will need to wait till the  click object is available and then finally take screen capture  of the top 40 rows  and save the .jpeg file to  windows file share location.
      once the file save is completed,  pop up message - the screen capture is completed. Then the users can do their regular work.
      Potentially  other factor that will play are the screen resolution.
      Can anyone guide me to some relevant scripts already in the forum. In the meantime I am learning  the basics of the  tool.
       
      Appreciate feedback and any help
      George V
       
       
    • By nooneclose
      Good morning, I have been thinking about trying to make my Autoit script run in the background. I found out today that it is impossible due to the UIA and mouseclick functions that I use. However, while reading other posts about running Autoit scripts in the background I saw a reply mentioning how a script like mine might be able to run on a VM while still giving me the ability to work on my Host OS. Can someone confirm this? 
      Here is a link to the thread where I saw VM mentioned. 
      the person who mentioned it was @ViciousXUSMC 
    • By Clouds
      Hi,
      I'm writing a script that interacts with a webpage.
      The contents of the webpage depend on the size of the browser window.
      To get the (for me) correct contents from the page, the browser window must be maximized.
      However, I also don't need or want to see the browser window when the script creates it, so it should be invisible.
      At first I created the browser window with simply this: 
      $oIE = _IECreate ($url ,0 ,0 ,1 ,0) However, from the results I can see that the invisible browser window isn't maximized.
      So I changed the code to maximize the window, but then it becomes visible.
      Now I have this:
      $oIE = _IECreate ($url ,0 ,0 ,1 ,0) $hIE = _IEPropertyGet($oIE, "hwnd") WinSetState($hIE, "", @SW_MAXIMIZE) WinSetState($hIE, "", @SW_HIDE) ...but then I do see the browser window shortly when it is maximized.
      I could live with that if it were just a single browser window. But the script is opening (and closing) quite a few browser windows, and I don't wait to see them flicker, nor do I want to (be able to accidentally) interact with these windows.
      Any ideas on how to create and invisible yet maximized IE windows?
    • By irfan666
      Hi, how to make autoit "monitoring" program, Basically i want autoit to autoclick "start" button only  when the program is "stop" ? thanks
       

×
×
  • Create New...