Problem calling another button function inside timer
Hi all i am using the following timer to close a massage box whenever it pops up in external application. But i want to call another button command after closing that massage box. I placed the call inside the if statment but it never calls command button. could you guys tell me what might be wrong? Thanks
2 Code:
Private Sub Timer1_Timer()
Dim X As Long, editx As Long
Dim button As Long
X = FindWindow("#32770", "Successful")
If X Then
SendMessage X, WM_CLOSE, 0&, 0&
Command2_Click
End If
End Sub
Private Sub Command2_Click()
......
......
msgbox " i have been called ";
.....
.....
End sub
Re: Problem calling another button function inside timer
Quote:
I placed the call inside the if statment but it never calls command button. could you guys tell me what might be wrong?
I tried it an it works just fine...
1) Does it close the window?
2) Try this
vb Code:
If X Then
MsgBox "Closing Window"
SendMessage X, WM_CLOSE, 0&, 0&
Command2_Click
End If
Do you get to see the message box "Closing Window"??? If not you know where the error is :)