程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> Visual Basic語言 >> VB綜合教程 >> VB完成的《QQ美男找茬游戲》做弊器實例

VB完成的《QQ美男找茬游戲》做弊器實例

編輯:VB綜合教程

VB完成的《QQ美男找茬游戲》做弊器實例。本站提示廣大學習愛好者:(VB完成的《QQ美男找茬游戲》做弊器實例)文章只能為提供參考,不一定能成為您想要的結果。以下是VB完成的《QQ美男找茬游戲》做弊器實例正文


本文實例講述了VB完成的《QQ美男找茬游戲》做弊器。分享給年夜家供年夜家參考。詳細以下:

比擬無聊哈,道理很簡略,用VB速度比擬慢,然則完成很輕易。

Option Explicit
Private Type sPOINT
  x As Long
  y As Long
End Type
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST& = -1
' 將窗口置於列表頂部,並位於任何最頂部窗口的後面
Private Const SWP_NOSIZE& = &H1
' 堅持窗口年夜小
Private Const SWP_NOMOVE& = &H2
' 堅持窗口地位
Private Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
' 將窗口設為總在最前
End Sub
'把long型的RGB值分化成3個重量
Sub ColorRGB(Color As Long, C() As Integer)
  Const ByN As Integer = 256
  Const ByN2 As Long = 65536
  C(1) = (Color Mod ByN)
  C(2) = ((Color Mod ByN2) \ ByN)
  C(3) = (Color \ ByN2)
End Sub
Private Sub GetPoint()
  Dim p1(497, 447) As Long, p2(497, 447) As Long, C1(3) As Integer, C2(3) As Integer
  '數組年夜小婚配於圖片的年夜小
  Dim pic1 As sPOINT, pic2 As sPOINT
  '設置兩張圖片的屏幕地位
  pic1.x = 8
  pic1.y = 192
  pic2.x = 517
  pic2.y = 192
  Dim h As Long, hD As Long, r As Long, i As Integer, j As Integer
  hD = GetDC(0)
  '讀入兩張圖片
  For i = 0 To 497
    For j = 0 To 447
      p1(i, j) = GetPixel(hD, i + pic1.x, j + pic1.y)
      p2(i, j) = GetPixel(hD, i + pic2.x, j + pic2.y)
    Next
  Next
  '比較,標志差別
  Dim t As Boolean
  t = True
  For i = 0 To 497
    For j = 0 To 447
      Call ColorRGB(p1(i, j), C1())
      Call ColorRGB(p2(i, j), C2())
      If (Abs(C1(1) - C2(1)) > 30 Or Abs(C1(2) - C2(2)) > 30 Or Abs(C1(3) - C2(3)) > 30) Then
        t = Not t
        If t Then
          Picture1.ForeColor = &H0&
        Else
          Picture1.ForeColor = &HFF00&
        End If
      Else
        Picture1.ForeColor = p1(i, j)
      End If
      Picture1.PSet (i, j)
    Next
  Next
End Sub
Private Sub Picture1_Click()
Me.Visible = False
DoEvents
GetPoint
Me.Visible = True
End Sub

願望本文所述對年夜家的VB法式設計有所贊助。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved