I'm quite new to this and have been fumbling my way through creating an excel document that communicates with one of our external applications.
I've been through a tutorial of using FindWindowEX to find the specific buttons/boxes of this application and have managed to successfully insert text into one of the forms.
I hit a roadblock when trying to "click" a button, and i think the problem is that the application i'm trying to communicate with doesnt have unique class names.
From the picture you can see that almost everything is called "WindowsForms10.Window.8.app.0.2004eee"
Which means that i can insert text into the very first and only text box but can't dive any deeper to get hold of the buttons which i need to "click" in order to search.
Current code is as follows: I don't need to open the application as it is always up from startup.
Sub Runapplication()
DoEvents
Hwindow2 = FindWindow(vbNullString, "General Account Enquiry")
'Account Number
Account_Number = FindWindowEx(Hwindow2, 0&, "WindowsForms10.EDIT.app.0.2004eee", vbNullString)
Accountnumber = ThisWorkbook.Sheets("Sheet1").Range("A1")
Call SendMessageByString(Account_Number, WM_SETTEXT, 0, Accountnumber)
DoEvents
Account1 = FindWindow(vbNullString, "csEditAccount")
Account = FindWindowEx(Hwindow2, 0&, "WindowsForms10.Window.8.app.0.2004eee", vbNullString)
'Call EnableWindow(Account, True)
Call SendMessage(Account, WM_LBUTTONDOWN, 0, ByVal 0&)
End Sub
I have all the constants/declrations
Public Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare PtrSafe Function CloseWindow Lib "user32" (ByVal hWnd As Long) As Long
Public Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Public Declare PtrSafe Function SendMessageByString Lib "user32" Alias "SendMessageA" ( _
ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As String) As Long
Public Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Declare PtrSafe Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare PtrSafe Function EnableWindow Lib "USER32.dll" ( _
ByVal hWnd As Long, _
ByVal fEnable As Long) As Long
Public Const SW_NORMAL As Long = 1
Public Const WM_CLOSE As Long = &H10
Public Const BM_CLICK As Long = &HF5
Public Const WM_KEYUP As Long = &H101
Public Const WM_SETTEXT = &HC
Public Const LB_FINDSTRING = &H18F
Public Const WM_LBUTTONDOWN = &H201
Any help would be greatly appreciated, i almost went insane yesterday scouring the internet trying to find an answer to this problem,
Thank you!

Get Acct...with an HWND of000107A0, for instance.IAccessible? You can execute an IAccessible.