۲۰-فروردین-۱۳۸۷, ۰۷:۴۳:۰۱
کد:
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim ret_val As Long
ret_val = FindWindow("OMAIN", vbNullString)
If ret_val <> 0 Then
Call OpenClipboard(ret_val)
End If
If ret_val = 0 Then
Call CloseClipboard
End If
End Sub