roomezonline
یک شنبه 30 تیر 1387, 23:59 عصر
:گیج:با این کد که امروز برای شما میزارم میتونید چک کنید که آیدی وارد شده در یاهو آنلاین شده یا خیر
timer , 2 label هم این برنامه نیز داره
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName
As String) As Long
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function GetForegroundWindow Lib "user32" () As Long
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const SW_HIDE = 0
Public 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 Sub Timer1_Timer()
On Error Resume Next
Dim Yhwnd As Long
Dim YhSendToAll As Long
Dim i As Integer
Dim hYlogin As Long
Dim hYSignIn As Long
Yhwnd = GetForegroundWindow
Dim lpClassName As String
lpClassName = Space(255)
GetClassName Yhwnd, lpClassName, Len(lpClassName)
lpClassName = Mid(lpClassName, 1, InStr(lpClassName, Chr(0)) - 1)
If lpClassName = "YahooBuddyMain" Then
hYlogin = FindWindowEx(Yhwnd, 0, "#32770", "YLoginWnd")
hYSignIn = FindWindowEx(hYlogin, 0, "Button", "&Sign In")
Label1.Caption = "Hwnd of 'YLoginWnd' : " & hYlogin
Label2.Caption = "Hwnd of '&Sign In' : " & hYSignIn
If hYSignIn <> 0 Then
Form1.Caption = "آفلاین"
Exit Sub
End If
Form1.Caption = "آنلاین"
Beep
Timer1.Enabled = False
End If
End Sub
با تشکر
مصطفی:لبخندساده:
timer , 2 label هم این برنامه نیز داره
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName
As String) As Long
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function GetForegroundWindow Lib "user32" () As Long
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const SW_HIDE = 0
Public 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 Sub Timer1_Timer()
On Error Resume Next
Dim Yhwnd As Long
Dim YhSendToAll As Long
Dim i As Integer
Dim hYlogin As Long
Dim hYSignIn As Long
Yhwnd = GetForegroundWindow
Dim lpClassName As String
lpClassName = Space(255)
GetClassName Yhwnd, lpClassName, Len(lpClassName)
lpClassName = Mid(lpClassName, 1, InStr(lpClassName, Chr(0)) - 1)
If lpClassName = "YahooBuddyMain" Then
hYlogin = FindWindowEx(Yhwnd, 0, "#32770", "YLoginWnd")
hYSignIn = FindWindowEx(hYlogin, 0, "Button", "&Sign In")
Label1.Caption = "Hwnd of 'YLoginWnd' : " & hYlogin
Label2.Caption = "Hwnd of '&Sign In' : " & hYSignIn
If hYSignIn <> 0 Then
Form1.Caption = "آفلاین"
Exit Sub
End If
Form1.Caption = "آنلاین"
Beep
Timer1.Enabled = False
End If
End Sub
با تشکر
مصطفی:لبخندساده: