Jump to content

Immitate double click No Mouse Movement


Recommended Posts

Just seem to have hit a bit of a hurdle.

I am trying to get Autoit to tick a box in a dialogue box. However no windows shortcut works (eg. spacebar etc.).

So having moved to the tick box (how can i produce a double click of the mouse (which ticks the box) without moving the mouse each time. I will need to do this many times in a tall dialogue box you need to scroll through if trying to use the mouse to do it?

Can i map a keyboard shortcut or something?

Thanks

Neil

 

Link to comment
Share on other sites

what does the au3 window tool says about that checkbox?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Did not know of this tool but found it.

Clicking the tick box gives me this.

Not sure if it helps.

Thanks

Neil

>>>> Window <<<<
Title:    GridTrader
Class:    #32770
Position:    613, 20
Size:    626, 754
Style:    0x94CC20C4
ExStyle:    0x00010501
Handle:    0x004F0B3C

>>>> Control <<<<
Class:    SysListView32
Instance:    1
ClassnameNN:    SysListView321
Name:    
Advanced (Class):    [CLASS:SysListView32; INSTANCE:1]
ID:    1357
Text:    List1
Position:    18, 37
Size:    577, 601
ControlClick Coords:    47, 177
Style:    0x5021940D
ExStyle:    0x00000204
Handle:    0x00C70BF6

>>>> Mouse <<<<
Position:    686, 265
Cursor ID:    0
Color:    0xDBEAEC

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Inputs
List1
&Load
&Save
OK
Cancel
Reset


>>>> Hidden Text <<<<
1
false
None
2018.06.14 20:37:00

Link to comment
Share on other sites

Not sure what to do with this as my knowledge of this scripting language is elementary.

Do i somehow modify the function to retrieve the Handle of the control and then somehow use the SetItemChecked function to check the control?

If so can you help with an example or give a few more pointers?

Thanks for your help.

Link to comment
Share on other sites

Try this:

#include <GuiListView.au3>

$hLV = ControlGetHandle("GridTrader", "", "SysListView321")
_GUICtrlListView_SetItemChecked($hLV, 0)

It should set checked state for the first row in your ListView.

If it will work, you can easily accomodate it to set checked state to desired rows ...

Edited by Zedna
Link to comment
Share on other sites

Am i right in thinking that i can use the info in au3 window info (as below) to click a button.

Like

ControlClick($hWnd, "", "[Class:Button;Instance:1]")

Or is it better to use an ID?

>>>> Window <<<<
Title:  OANDA - MetaTrader - [EURGBP,M5]
Class:    MetaQuotes::MetaTrader::4.00
 

>>>> Control <<<<
Class:    Button
Instance:    1
ClassnameNN:    Button1
Name:    
Advanced (Class):    [CLASS:Button; INSTANCE:1]
ID:    1025
Text:    Expert properties
 

Edited by Paxman
Link to comment
Share on other sites

I created a simple script to test this and it errors.

#include <MsgBoxConstants.au3>

; This is my first script
MsgBox($MB_SYSTEMMODAL, "My First Script!", "Hello World!")

ControlClick($hWnd, "", "Button1")  err $hWnd possibly used before declaration and err undeclared global variable.

So in VBA i would know where to look but i am stumped here.

Also once it has errored how can i get back to a screen without the error codes on please.

thanks

Neil

Edited by Paxman
Link to comment
Share on other sites

After some googling i added global $hwnd to start and error went. However i think i need something before the button click to tell it what window to go to?

can i use this function i found in the recorder

Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc

and then use

_WinWaitActivate("9762353: OANDA - MetaTrader - [EURGBP,M5]","")

Or is that not the way to do it?

 

Edited by Paxman
Link to comment
Share on other sites

  • Moderators

$hWnd is the variable that refers to the window. Look at the example for ControlClick in the help file; it shows you everything you need to know.

"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

  • Moderators
21 minutes ago, Paxman said:

Help is good, knowing where to look is the thing :)

Every function in AutoIt has a page in the help file, many with not one but multiple examples...

"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

15 hours ago, Zedna said:

Try this:

#include <GuiListView.au3>

$hLV = ControlGetHandle("GridTrader", "", "SysListView321")
_GUICtrlListView_SetItemChecked($hLV, 0)

It should set checked state for the first row in your ListView.

If it will work, you can easily accomodate it to set checked state to desired rows ...

Hi i got the code to run but it does not tick the control. I tried 0,1 and 2 to be sure.

Is there another way to do this? As mentioned before, in use you can only use the mouse with a left click or double click. No Keyboard shortcut exists.

Thanks

Neil

Link to comment
Share on other sites

i have set windows Ease of use to use the + key on the numeric keypad as a double click so we could just navigate to each line using {down} and then setting or unsetting? Is this a possible method?

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

×
×
  • Create New...