vb螢幕放大器

vb螢幕放大器模仿WIN自帶的放大器,用了幾個很簡單的API,適合API初學者!

vb螢幕放大器

模仿WIN自帶的放大器,用了幾個很簡單API,適合API初學者!

功能:

1.螢幕頂層視窗
2.抓坐標
3.場景

'--------新建form貼上以下所有代碼,加一個Timer1------------

Option Explicit
Private Type POINTAPI
x As Long
y As Long
End Type
Const Srccopy = &HCC0020
Const Swp_nomove = &H2
Const Swp_nosize = &H1
Const Flags = Swp_nomove Or Swp_nosize
Const hwnd_topmost = -1
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 Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Dim pos As POINTAPI
Private Sub Form_Load()
Me.Left = 0
Me.Top = 0
Me.Height = 3330
Me.Width = 3090
SetWindowPos hwnd, hwnd_topmost, 0, 0, 0, 0, Flags
End Sub
Private Sub start()
Dim sx As Integer
Dim sy As Integer
GetCursorPos pos
sx = IIf(pos.x < 50 Or pos.x > 590, IIf(pos.x < 50, 0, 540), pos.x - 50)
sy = IIf(pos.y < 50 Or pos.y > 430, IIf(pos.y < 50, 0, 380), pos.y - 50)
Caption = "坐標" & sx & "," & sy & " Wlclass"
StretchBlt hdc, 0, 0, 200, 200, GetDC(0), sx, sy, 100, 100, Srccopy
End Sub
Private Sub Timer1_Timer()
start
End Sub

相關詞條

相關搜尋

熱門詞條

聯絡我們