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順序設計有所協助。