Hi,
Here is a sample script that demonstrates how to work with ProfUIS controls by using Text Recognition:
Sub TextRecognitionSample
' Download the http://www.prof-uis.com/download/samples/win32/All_Prof-UIS_Samples.zip archive,
' unzip it and run the ProfStudio-m.exe sample
Dim p, wMain, wMenu, strItem
Set p = Sys.Process("ProfStudio-m")
Set wMain = p.Window("Afx:400000:8*", "*")
wMain.Activate
Set wMenu = wMain.Window("ProfUIS-DockBar", "Menu bar").Window("ProfUIS-ControlBar", "Menu bar")
strItem = "File|New"
If ClickItem(wMenu, strItem) Then
Log.Message "The '" & strItem & "' menu item was successfully clicked."
End If
End Sub
Function ClickItem(wMenu, strItem)
Dim p, arrayItem, menuItemObj, wSubMenu
ClickItem = False
arrayItem = Split(strItem, "|")
If Not ClickChild(wMenu, "Text", arrayItem(0)) Then
Exit Function
End If
Set p = getProcess(wMenu)
Set wSubMenu = p.Window("Afx:400000:800*")
If Not ClickChild(wSubMenu, "Text", arrayItem(1)) Then
Exit Function
End If
ClickItem = True
Log.UnlockEvents
Log.Event "The '" & strItem & "' menu item was clicked."
End Function
Function ClickChild(wMenu, strProp, arrayItem)
Dim menuItemObj
ClickChild = False
Log.LockEvents(1)
Set menuItemObj = wMenu.FindChild(strProp, "*" & arrayItem & "*")
If Not menuItemObj.Exists Then
Log.UnlockEvents
Log.Error "The '" & arrayItem & "' menu item was not found."
Exit Function
End If
menuItemObj.Click
ClickChild = True
End Function
Function getProcess(obj)
Do While Not IsSupported(obj, "ProcessName")
Set obj = obj.Parent
Loop
Set getProcess = obj
End Function
BTW, you can vote for ProfUIS controls
here.