Is this the way how to click the "OK" or any button from another application?

Thanks for helping!!!

Code:
Option Explicit
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function Findwindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wparam As Long, lparam As Any) As Long
'Private Declare Function SendMessageByNum Lib "user32" Alias "SendMessageA" (ByVal hWnd%, ByVal wMsg%, ByVal wparam%, ByVal lparam&)
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202

Private Sub Timer1_Timer()
  Dim lng_Dialog As Long
  Dim lng_Button As Long
  lng_Dialog = Findwindow("#32770", vbNullString)
  lng_Button = FindWindowEx(lng_Dialog, 0&, "Button", vbNullString)
  Call Click(lng_Button)
End Sub

Sub Click(lng_Handle As Long)
  DoEvents
  
  Dim lng_Response As Long
  lng_Response = SendMessage(lng_Handle, WM_LBUTTONDOWN, 0, 0&)
  lng_Response = SendMessage(lng_Handle, WM_LBUTTONUP, 0, 0&)
End Sub