Jump to content

Select with mouse on item en click


Triki
 Share

Recommended Posts

I'm trying to manipulate an application with an integrated ListView named SysListView321.

I can select an item with Autoit

ControlListView($Wnd,"","SysListView321","Select",15,0)

...but...

The only way to confirm the selection of the selected item is to point it with the mouse pointer and click the left button.

I'm already looking for days to find a way to automate this but can't find any solution.

I'm using Autoit and C#. Is there somebody who knows how to do this manipulation automatically?

Link to comment
Share on other sites

Link to comment
Share on other sites

19 hours ago, Nine said:

Read help file about : _GUICtrlListView_ClickItem

In fact the whole UDF should greatly enhance your capabilities to interact with this type of control.

Thank you for this information.
I have tried this already but the application is really poorly constructed or overprotected.
You can select an item via script but you have to click on it with the mouse to transfer it to a label.
Per label you can add a number in a textbox 'Edit1' and then click on a button to save it.
The manipulation to click on the item is the trap that I do not get around.

Link to comment
Share on other sites

25 minutes ago, Nine said:

Show a snippet of the code you got that causing you the issue.  From what application is that ListView from ?

I do not have access to the code of the application.
The application is provided by an international company and does not release its source codes.
Therefore, I am also dependent on Autoit for some manipulations.

My code is very simple

Local $Wnd = WinActive("ESZ toewijzen")

ControleListView($Wnd,"","SysListView321","Select",15,0) ;Works

_GUICtrlListView_ClickItem("SysListView321",15,"Left",False,1) ;Dont works
OR
_GUICtrlListView_ClickItem($Wnd;15,"Left",False,1) ;Dont works

Mouse down and Controle_Mouseclick also don't works.

Edited by Triki
Link to comment
Share on other sites

Your statements are wrongly formatted :

_GUICtrlListView_ClickItem("SysListView321",15,"Left",False,1) ;Dont works
OR
_GUICtrlListView_ClickItem($Wnd;15,"Left",False,1) ;Dont works

You need to get the handle of the control, something like this should work :

Local $hWnd = WinActivate("ESZ toewijzen")
WinWaitActive($hWnd)
Local $hCtrl = ControlGetHandle($hWnd, "", "SysListView321")
_GUICtrlListView_ClickItem($hCtrl, 15)

I cannot more strongly recommend that you put error handling after each statement to ensure everything is going as expected (not done on my snippet).

Link to comment
Share on other sites

HELP !!! New problem

I tried to integrate the Autoit script into my C# project but
you apparently can't use UDF functions with the AutoitX3lib DLL, only the native functions included in it.

In another topic of this forum I read:
If you REALLY want to use _GUICtrlListView_ClickItem, open the GUIListView.au3 file, find the function and see how it is done there. Note that that function uses MouseClicks.

I have done that but I can' t get that puzzle done to convert to c#

@Nine Can you help me ... again?

Link to comment
Share on other sites

  • Developers
16 minutes ago, Triki said:

you apparently can't use UDF functions with the AutoitX3lib DLL, only the native functions included in it.

Correct and should make sense ..right as you are now running the interpreter AutoIt3.exe, but make internal AutoIt functions available in your program.

18 minutes ago, Triki said:

I have done that but I can' t get that puzzle done to convert to c#

Then don't use c# but AutoIt3.exe? ;)
Seriously, we assume that, when you use another programming languages, you are able to program any user functions yourself.

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

26 minutes ago, Jos said:

Correct and should make sense ..right as you are now running the interpreter AutoIt3.exe, but make internal AutoIt functions available in your program.

Then don't use c# but AutoIt3.exe? ;)
Seriously, we assume that, when you use another programming languages, you are able to program any user functions yourself.

 

Thanks Jos but with that answer I can't do much. 😉
I use Autoit to perform certain functions that c# can' t.
I suppose the same is true the other way around.

Furthermore, I am not a professional programmer in the sense of writing programs myself.
So this is agony for me and if someone like Nine can help me, then I' m very grateful because it will save me hours, days of searching.

Link to comment
Share on other sites

@Triki  Unfortunately, I do not have C#.  I did have programmed in C# in the far past, but I do not intend to restart doing so now.  Sorry.  If you need further help in AutoIt, I will be glad to give a hand.

Link to comment
Share on other sites

  • Developers
9 minutes ago, Triki said:

Thanks Jos but with that answer I can't do much. 😉

Understand....

9 minutes ago, Triki said:

Furthermore, I am not a professional programmer in the sense of writing programs myself.

Hence my comments. ;)  ...  and I honestly believe you should do the effort of learning and not ask c# questions in our AutoIt3 forum, or else hire a professional programmer.
This is an AutoIt3 scripting forum, and yes, we do not mind questions about the AutoIt3x module, but that is something different than asking us to code the C# for you.

Just my humble opinion, but when others feel they need to do this for you than by all means....

 

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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