vb 编写的qq查询交谈工具源码
2009年12月21日
Option Explicit
Private Declare 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
Private Const SW_SHOW = 5
Dim qq As Long, qqzai As String, qqli As String
Private Sub Command1_Click()
qq = Val(Text1.Text) '从文本框中获取要查询的号码
If Len(Text1) ShellExecute Me.hwnd, "open", UrL, "", App.Path, SW_SHOW
End Sub
Private Sub Form_Load()
Me.Show
Label1.FontItalic = True
Image1.Visible = False
Image2.Visible = False
Text1.SetFocus
Text1.SelLength = Len(Text1.Text) '将文本框的内容全部选择
Web.Visible = False
End Sub
Private Sub Image3_Click()
End Sub
Private Sub Text1_Click()
Text1.Text = ""
Image1.Visible = False '重新查询时QQ状态图标隐藏
Image2.Visible = False
Form1.Caption = "QQ查询状态"
End Sub
Private Sub Web_TitleChange(ByVal Text As String)
qqzai = "http://wpslogo.qq.com/qq_online.gif" 'QQ在线状态的地址
qqli = "http://wpslogo.qq.com/qq_offline.gif" 'QQ离线状态的地址
If Web.LocationURL = qqzai Then
'如果地址返回的是QQ在线状态的地址,那么执行下面的语句
'LocationURL返回WebBrowser当前正在显示的资源的URL ,
'也就是已经工作完成后的URL
Image1.Visible = True '显示QQ在线状态亮图标
Image2.Visible = False
Form1.Caption = "QQ查询状态〉〉〉该QQ目前在线"
ElseIf Web.LocationURL = qqli Then
'如果返回的是QQ离线状态的地址,那么QQ离线的图标被显示出来
Image2.Visible = True
Image1.Visible = False
Form1.Caption = "QQ查询状态〉〉〉该QQ目前不在线"
End If
End Sub
2009年12月21日
Option Explicit
Private Declare 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
Private Const SW_SHOW = 5
Dim qq As Long, qqzai As String, qqli As String
Private Sub Command1_Click()
qq = Val(Text1.Text) '从文本框中获取要查询的号码
If Len(Text1) ShellExecute Me.hwnd, "open", UrL, "", App.Path, SW_SHOW
End Sub
Private Sub Form_Load()
Me.Show
Label1.FontItalic = True
Image1.Visible = False
Image2.Visible = False
Text1.SetFocus
Text1.SelLength = Len(Text1.Text) '将文本框的内容全部选择
Web.Visible = False
End Sub
Private Sub Image3_Click()
End Sub
Private Sub Text1_Click()
Text1.Text = ""
Image1.Visible = False '重新查询时QQ状态图标隐藏
Image2.Visible = False
Form1.Caption = "QQ查询状态"
End Sub
Private Sub Web_TitleChange(ByVal Text As String)
qqzai = "http://wpslogo.qq.com/qq_online.gif" 'QQ在线状态的地址
qqli = "http://wpslogo.qq.com/qq_offline.gif" 'QQ离线状态的地址
If Web.LocationURL = qqzai Then
'如果地址返回的是QQ在线状态的地址,那么执行下面的语句
'LocationURL返回WebBrowser当前正在显示的资源的URL ,
'也就是已经工作完成后的URL
Image1.Visible = True '显示QQ在线状态亮图标
Image2.Visible = False
Form1.Caption = "QQ查询状态〉〉〉该QQ目前在线"
ElseIf Web.LocationURL = qqli Then
'如果返回的是QQ离线状态的地址,那么QQ离线的图标被显示出来
Image2.Visible = True
Image1.Visible = False
Form1.Caption = "QQ查询状态〉〉〉该QQ目前不在线"
End If
End Sub