Jump to content

controlclick problem


beiqi
 Share

Recommended Posts

Hallo!

I need some help.

Till now I always think if one uses ID for controlfocus & controlclick more secure than Classname such as "Buttonx". But I found sometimes, not always, that controlclick with ID does not work, although I have used controlfocus before the click action!

I have this Problem now with FileSaveDialoge, the standard windows stuff.

Can someone give a hint if i did that wrongly!

thanks in advance!

Boostpy

Link to comment
Share on other sites

Hallo!

I need some help.

Till now I always think if one uses ID for controlfocus & controlclick more secure than Classname such as "Buttonx". But I found sometimes, not always, that controlclick with ID does not work, although I have used controlfocus before the click action!

I have this Problem now with FileSaveDialoge, the standard windows stuff.

Can someone give a hint if i did that wrongly!

thanks in advance!

Boostpy

the control functions require default microsoft controls, if the dialog you're trying to access does not have standard controls, then no-go. as far as tellling if you're doing something incorrectly, we'd need to see some code to do that... when you do post code, please be sure to use the [ code ] and [ /code ] tags, without spaces..
Link to comment
Share on other sites

Russian Roulette Anyone?

:P I could not find a gun, will that do.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

the control functions require default microsoft controls, if the dialog you're trying to access does not have standard controls, then no-go. as far as tellling if you're doing something incorrectly, we'd need to see some code to do that... when you do post code, please be sure to use the [ code ] and [ /code ] tags, without spaces..

Hello!

Thanks for your reply. Maybe I have not described clearly because of my bad english. I try again:

It is open file dialogue under windows XP, the button for saving has the name "Button2" and id = 1

I do need change the id = 1 to "Button2" as the third parameter, It works, otherwise not.

I am sorry that I do not post the code here, because I use a german OS and Python-Wrapper.

Thanks again and welcome for any hints.

Boostpy

Link to comment
Share on other sites

Hello!

I have found the problem:

unter save file dialogue there are two controls with the same ID

the following is from AutoItInfo (i have made some comment, too)

Control ID: 1

ClassNameNN: SysListView321

Text: FolderView (comment, under english OS, there is no text, here you can change your directory oder choose a file)

Control ID: 1

ClassNameNN: Button2

Text: &Speichern ( save in English!)

IST that a bug unter AutoIt under XP oder the DLL of AutoIt ( i use the latest stable version3.x)

Link to comment
Share on other sites

  • Moderators

So are you trying to click the list view or the Button?

If it's the button:

ControlClick("Title Of Window", "&Speichern", "Button2") should work. If your primary mouse is set to Right, you may want to do this: ControlClick("Title Of Window", "&Speichern", "Button2", "Right", 1) .

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

So are you trying to click the list view or the Button?

If it's the button:

ControlClick("Title Of Window", "&Speichern", "Button2") should work. If your primary mouse is set to Right, you may want to do this: ControlClick("Title Of Window", "&Speichern", "Button2", "Right", 1) .

Hello!

Thanks for post. It works with ControlClick("title of windows", "", "Button2"), too!, not for with ID, I am sure, ID is unique, not Buttonx!

I would like to know if that is bug of Windows XP or from AutoIt.

Link to comment
Share on other sites

Why isn't Buttonx unique?

Here Buttonx stands for Button2 (to save) Button4( to cancel)

Wenn you use the AutoItInfo to check the application notepad.exe during the save action,

you can get the result, too.

I think that is a bug out of AutoIt because I use another tool get the following infos:

[135534, '', 'SHELLDLL_DefView', [[135536, 'FolderView', 'SysListView32']]],

[200994, 'Datei&name:', 'Static'],

[266402, 'ComboBoxEx32', [[266398, 'ComboBox', [[135470, '', 'Edit']]]]],

[[]],

[135472, 'Datei&typ:', 'Static'],

[135474, '', 'ComboBox'],

[135478, 'Sch&reibgesch\xfctzt \xf6ffnen', 'Button'],

[135482, '&Speichern', 'Button'],

[135484, 'Abbrechen', 'Button'],

One can see the 'SysListView32' and 'Button' have different IDs

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