careca

Click Item

4 posts in this topic

 

Hi, so i have this code that im working on, to automate a file association

The problem is that once i get to the window in the screenshot, i can't click on it and move on.

#include <GuiListView.au3>
Local $ext='mp4'
ShellExecute(@WindowsDir&'\system32\control.exe', '/name Microsoft.DefaultPrograms /page pageFileAssoc')
WinWaitActive("Set Associations", 'Set Associations', 3)
$hWnd = WinGetHandle("[CLASS:CabinetWClass]", "Set Associations")
Do
$Vis = ControlCommand($hWnd, "", "[CLASS:Button; INSTANCE:1]", 'IsVisible')
Until $Vis = 1
$iCount = ControlListView($hWnd, "", "SysListView321", "GetItemCount")
For $i = 0 To $iCount-1
$sText1 = ControlListView($hWnd, "", "SysListView321", "GetText", $i, 0)
$sText2 = ControlListView($hWnd, "", "SysListView321", "GetText", $i, 2)
If $sText1 = '.'&$ext Then
    ControlListView($hWnd, "", "SysListView321", "Select", $i, $i)
    ConsoleWrite('============================================================================='&@CRLF)
    ConsoleWrite('Line - '& $i &' - '&$sText1&@CRLF)
    ConsoleWrite('============================================================================='&@CRLF)
    ControlClick($hWnd, "", "[CLASS:Button; INSTANCE:1]")
EndIf
Next

Some of "inspect" info, full on the anex:

How found:  Mouse move (1151,711)
    hwnd=0x00000000003405D8 64bit class="DirectUIHWND" style=0x56000000 ex=0x0
Name:   "More apps"
ControlType:    UIA_HyperlinkControlTypeId (0xC355)
LocalizedControlType:   "link"
BoundingRectangle:  {l:1081 t:686 r:1471 b:736}
IsEnabled:  true
IsOffscreen:    false
IsKeyboardFocusable:    true
HasKeyboardFocus:   false
ProcessId:  7300
RuntimeId:  [1C84.54E14860.1A1]
AutomationId:   "OptionsButton"
FrameworkId:    "DirectUI"
ClassName:  "TouchHyperLink"
IsControlElement:   true
IsContentElement:   true
ProviderDescription:    "[pid:7300,providerId:0x0 Main(parent link):Unidentified Provider (unmanaged:DUI70.dll)]"

Can't do anything with au3info, because as soon as the window loses focus, it disappears.

Untitled.jpg

More apps.txt


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

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

BeatsPlayer - Music player.

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

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

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

 

Share this post


Link to post
Share on other sites



7 minutes ago, junkew said:

Simplespy will help you. See faq31

Used inspect, isn't it similar? The results of inspect.exe are in the more apps.txt in anex.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

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

BeatsPlayer - Music player.

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

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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

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

 

Share this post


Link to post
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