Jump to content

Problem with ControlClick


Recommended Posts

Hello im trying to send a left click to a minimized window but i could not make it work, the keystroke i use in the same while works correctly.

My code looks like this

AutoItSetOption("WinTitleMatchMode", 4)
$hwnd = WinGetHandle("classname=*******")
If @Error Then
   MsgBox(0, "Sorry the handle could not be found.")
Else
EndIf
While 1 = 1
   ControlSend($hwnd, "", "", "{Q}")
   ControlClick($hwnd, "", "", "Left",1,131,132)
   Wend

Sorry for my english and thanks for the help :D

Link to comment
Share on other sites

To minimize a window, the WinSetState function works for me.

An example:-

#include <GUIConstantsEx.au3>

WinSetState ( WinGetTitle("[Class:SciTEWindow]"), "", @SW_MINIMIZE ) ; Where SciTEWindow is the class of the window to be minimized.
;                                                                      Class of the >>>> Window <<<< found by SciTE menu > Tools > AU3Info.
;                                                                      Note square brackets used.
Link to comment
Share on other sites

  • 2 weeks later...

Malkey +1

You do not need to send any click on minimalize, since if your window get resize, your coordiantes does not work anymore. Better to use what Malkey posted.

P.S.: check your mouse coordinates. Use it on window coordinate, or windows screen coordinates?

Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

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...