Jump to content

real Keyboard-Events / witch methods exist?


Recommended Posts

 I tried to automate the "PC Files list"-control in Recuva (file-recovery tool).

Some controls resist Automation with native autoit-methods. My question is about the different ways, controls read Keyboard-/mouse-Events. I have read about "sendinput", about different "layers",on witch  some controls read the Input, about DirectX, and so on.

Can somebody please describe ways, different from the methods used in autoit, to automate such resistent controls, to send keybard-Events in a way, that works for such controls?

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Link to comment
Share on other sites

please be more specific. But read IUIAutomation thread in examples section.

But so far I can handle all controls with AutoIT and keyboard events.

The worst case I have found to do 

a. Mousemove to location of the control

b. then do sendkeys

and another approach is by putting stuff on clipboard and sending a mouse move to the control, click and then paste command

Link to comment
Share on other sites

"PC Files list"-control  looks like listview with style $LVS_EX_CHECKBOXES. With Send / ControlSend / ControlSetText ("{Space}"), ControlCommand ("Uncheck"), ControlClick or MouseClick switching the Checkbox enabled / disabled does not work.

I have read about some controls do not read the windows-messages-stream but read the underlaying stream of Keyboard-data, if i understand this correctly. Games (not related for me atm.) may work with DirectX. I want to understand the difference between autoit--Keyboard-Events and a real keyevent from a real keyboard. Why some controls only do work with real Keyboard-Events, but resist the autoit-Events?

Edited by Raik

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

Link to comment
Share on other sites

I installed recuva and I can recognize with simplespy the controls

with a click on the right location I activate the filelist item

with a send("{SPACE}")  it toggles on/off as also happens with .invoke action 

au3inf is indeed seeing less compared to the simplespy

with inspect.exe I see the same objects recognized and with iaccessible pattern a little more information can be seen.

But anyway in the end it are hard to handle controls as if you want to see enabled/disabled checkbox you have to take snapshot of the lineitem and then look in the first few binary bytes if its enabled / disabled

with uiawrappers you could do _UIA_Action($lineItem,"screenshot") but I have not enough time to make a working demo (maybe in future I will add it in the examples of the whole uiawrappers.udf)

 

This link can tell you more on keyboards https://msdn.microsoft.com/en-us/library/windows/desktop/ms646267(v=vs.85).aspx

 

Edited by junkew
Link to comment
Share on other sites

I had clicked a item of the control, switched over to my sourcecode-Editor (Notepad++), run the script (F6), witch sets Focus on the recuva-window, and to the control inside, but send("{SPACE}") does nothing. :-(

If a checkbox is enabled, i check by PixelGetColor. (R=G=B = gray = not selected)

I tried sendmessage with wm_keydown / wm_keyup and wm_syskeydown / wm_syskeyup, does'nt work too.

Anyway controlfocus does not work, returns 0.

AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)

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