Jump to content

Having Problems to press certain buttons - (Moved)


Recommended Posts

Hi!
I was trying to automate photo presentation program. But here's the problem. Simple "             Send("{right}")             " doesn't work, neither does "              Send("{right down}")                Sleep(10)                  Send("{right up}")                      ". The photo programm works in strange environment and I don't really know what to do.

P.S Window is active when i run bot, also it presses left/right on other programs.

Link to comment
Share on other sites

  • Moderators

What is the photo presentation program you're using? If you use the AutoIt Window Info tool (in the same folder where you installed AutoIt) what information does it show for the application window?

"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

Windows Info Tool shows just that:
 

Spoiler

 

>>>> Window <<<<
Title:    PhotoView
Class:    TPhotoViewMainF
Position:    0, 0
Size:    1920, 1080
Style:    0x160B0000
ExStyle:    0x00010000
Handle:    0x00000000000205D6

>>>> Control <<<<
Class:    
Instance:    
ClassnameNN:    
Name:    
Advanced (Class):    
ID:    
Text:    
Position:    
Size:    
ControlClick Coords:    
Style:    
ExStyle:    
Handle:    

>>>> Mouse <<<<
Position:    908, 535
Cursor ID:    0
Color:    0x51504E

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<


 

(copied from Summary tab)

Link to comment
Share on other sites

15 hours ago, junkew said:

Try controlsend and otherwise try tools mentioned in faq 31. Try allways activate on your window or setfocus. Tell what simplespy or inspect.exe returns.

ControlSend doesn't work either. None of tools mentioned in faq31 worked or I did something wrong (not sure, I'm fresh with AutoIt). I have ActivateWindow in my code.

I have run simplespy, that's what it gave

Spoiler

    https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/?do=findComment&comment=1156373
At least we have an element title: [Program Manager] class: [Progman]

Having the following values for all properties:
Title is: <Program Manager>    Class   := <Progman>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    0;0;3200;1080
*** Parent Information top down ***


;~ *** Standard code maintainable ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)


_UIA_setVar("ProgramManager.mainwindow","title:=Program Manager;classname:=Progman")

;~ Actions split away from logical/technical definition above can come from configfiles


_UIA_action("ProgramManager.mainwindow","setfocus")


;~ *** Standard code Flexible***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_setVar("ProgramManager.mainwindow","title:=Program Manager;classname:=Progman")
_UIA_action("ProgramManager.mainwindow","setfocus")


*** Detailed properties of the highlighted element ***
UIA_title:= <Program Manager>
UIA_text:= <Program Manager>
UIA_regexptitle:= <Program Manager>
UIA_class:= <Progman>
UIA_regexpclass:= <Progman>
UIA_iaccessiblechildId:= <0>
UIA_handle:= <131366>
UIA_RuntimeId:= <42;131366>
UIA_BoundingRectangle:= <0;0;3200;1080>
UIA_ProcessId:= <8600>
UIA_ControlType:= <50033>
UIA_LocalizedControlType:= <okienko>
UIA_Name:= <Program Manager>
UIA_HasKeyboardFocus:= <False>
UIA_IsKeyboardFocusable:= <True>
UIA_IsEnabled:= <True>
UIA_ClassName:= <Progman>
UIA_Culture:= <0>
UIA_IsControlElement:= <True>
UIA_IsContentElement:= <True>
UIA_IsPassword:= <False>
UIA_NativeWindowHandle:= <131366>
UIA_IsOffscreen:= <False>
UIA_Orientation:= <0>
UIA_FrameworkId:= <Win32>
UIA_IsRequiredForForm:= <False>
UIA_IsDockPatternAvailable:= <False>
UIA_IsExpandCollapsePatternAvailable:= <False>
UIA_IsGridItemPatternAvailable:= <False>
UIA_IsGridPatternAvailable:= <False>
UIA_IsInvokePatternAvailable:= <False>
UIA_IsMultipleViewPatternAvailable:= <False>
UIA_IsRangeValuePatternAvailable:= <False>
UIA_IsScrollPatternAvailable:= <False>
UIA_IsScrollItemPatternAvailable:= <False>
UIA_IsSelectionItemPatternAvailable:= <False>
UIA_IsSelectionPatternAvailable:= <False>
UIA_IsTablePatternAvailable:= <False>
UIA_IsTableItemPatternAvailable:= <False>
UIA_IsTextPatternAvailable:= <False>
UIA_IsTogglePatternAvailable:= <False>
UIA_IsTransformPatternAvailable:= <False>
UIA_IsValuePatternAvailable:= <False>
UIA_IsWindowPatternAvailable:= <False>
UIA_ValueIsReadOnly:= <True>
UIA_RangeValueValue:= <0>
UIA_RangeValueIsReadOnly:= <True>
UIA_RangeValueMinimum:= <0>
UIA_RangeValueMaximum:= <0>
UIA_RangeValueLargeChange:= <0>
UIA_RangeValueSmallChange:= <0>
UIA_ScrollHorizontalScrollPercent:= <0>
UIA_ScrollHorizontalViewSize:= <100>
UIA_ScrollVerticalScrollPercent:= <0>
UIA_ScrollVerticalViewSize:= <100>
UIA_ScrollHorizontallyScrollable:= <False>
UIA_ScrollVerticallyScrollable:= <False>
UIA_SelectionCanSelectMultiple:= <False>
UIA_SelectionIsSelectionRequired:= <False>
UIA_GridRowCount:= <0>
UIA_GridColumnCount:= <0>
UIA_GridItemRow:= <0>
UIA_GridItemColumn:= <0>
UIA_GridItemRowSpan:= <1>
UIA_GridItemColumnSpan:= <1>
UIA_DockDockPosition:= <5>
UIA_ExpandCollapseExpandCollapseState:= <3>
UIA_MultipleViewCurrentView:= <0>
UIA_WindowCanMaximize:= <False>
UIA_WindowCanMinimize:= <False>
UIA_WindowWindowVisualState:= <0>
UIA_WindowWindowInteractionState:= <0>
UIA_WindowIsModal:= <False>
UIA_WindowIsTopmost:= <False>
UIA_SelectionItemIsSelected:= <False>
UIA_TableRowOrColumnMajor:= <2>
UIA_ToggleToggleState:= <2>
UIA_TransformCanMove:= <False>
UIA_TransformCanResize:= <False>
UIA_TransformCanRotate:= <False>
UIA_IsLegacyIAccessiblePatternAvailable:= <True>
UIA_LegacyIAccessibleChildId:= <0>
UIA_LegacyIAccessibleName:= <Program Manager>
UIA_LegacyIAccessibleRole:= <10>
UIA_LegacyIAccessibleState:= <1048576>
UIA_IsDataValidForForm:= <False>
UIA_ProviderDescription:= <[pid:5212,providerId:0x20126 Main:Nested [pid:8600,providerId:0x20126 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:UIAutomationCore.DLL); Main:Microsoft: MSAA Proxy (unmanaged:UIAutomationCore.DLL)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]>
UIA_IsItemContainerPatternAvailable:= <False>
UIA_IsVirtualizedItemPatternAvailable:= <False>
UIA_IsSynchronizedInputPatternAvailable:= <False>

 

 

Edited by GabenRulez
Link to comment
Share on other sites

20 hours ago, JLogan3o13 said:

What is the photo presentation program you're using? If you use the AutoIt Window Info tool (in the same folder where you installed AutoIt) what information does it show for the application window?

The program is made by a student and I have to use it (order from professor). I have no idea how and what he used to make it. I also have no contact info to him, he already graduated.

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