vb6調用管理工具?Option ExplicitPrivate Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal y As Long) As LongPrivate Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Type POINTAPIX As Longy As LongEnd TypePrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long),接下來我們就來聊聊關于vb6調用管理工具?以下内容大家不妨參考一二希望能幫到您!
Option ExplicitPrivate Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal y As Long) As LongPrivate Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Type POINTAPIX As Longy As LongEnd TypePrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)Private Const MOUSEEVENTF_LEFTDOWN = &H2Private Const MOUSEEVENTF_LEFTUP = &H4Private Const MOUSEEVENTF_MIDDLEDOWN = &H20Private Const MOUSEEVENTF_MIDDLEUP = &H40Private Const MOUSEEVENTF_MOVE = &H1Private Const MOUSEEVENTF_ABSOLUTE = &H8000Private Const MOUSEEVENTF_RIGHTDOWN = &H8Private Const MOUSEEVENTF_RIGHTUP = &H10
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal y As Long) As LongPrivate Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As LongPrivate Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As LongPrivate Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_ADD As Long = &H6B '加号鍵Private Const VK_APPS As Long = &H5D 'Applications 鍵(相當于鼠标右鍵)Private Const VK_BACK As Long = &H8 'BackSpace 鍵Private Const VK_CAPITAL As Long = &H14 'Caps Lock 鍵(大小寫轉換鍵)Private Const VK_CANCEL As Long = &H3 'Ctrl Break 過程Private Const VK_CONTROL As Long = &H11Private Const VK_DECIMAL As Long = &H6E '小數點号鍵Private Const VK_DELETE As Long = &H2EPrivate Const VK_DIVIDE As Long = &H6F '除号鍵Private Const VK_DOWN As Long = &H28Private Const VK_END As Long = &H23Private Const VK_ESCAPE As Long = &H1BPrivate Const VK_F1 As Long = &H70Private Const VK_F10 As Long = &H79Private Const VK_F11 As Long = &H7APrivate Const VK_F12 As Long = &H7BPrivate Const VK_F2 As Long = &H71Private Const VK_F3 As Long = &H72Private Const VK_F4 As Long = &H73Private Const VK_F5 As Long = &H74Private Const VK_F6 As Long = &H75Private Const VK_F7 As Long = &H76Private Const VK_F8 As Long = &H77Private Const VK_F9 As Long = &H78Private Const VK_HOME As Long = &H24Private Const VK_INSERT As Long = &H2DPrivate Const VK_LCONTROL As Long = &HA2Private Const VK_LEFT As Long = &H25Private Const VK_LMENU As Long = &HA4 '左 Alt 鍵Private Const VK_LSHIFT As Long = &HA0Private Const VK_LWIN As Long = &H5BPrivate Const VK_MENU As Long = &H12 'Alt 鍵Private Const VK_MULTIPLY As Long = &H6A '乘号鍵Private Const VK_NEXT As Long = &H22 '下翻頁鍵Private Const VK_NUMLOCK As Long = &H90Private Const VK_NUMPAD0 As Long = &H60Private Const VK_NUMPAD1 As Long = &H61Private Const VK_NUMPAD2 As Long = &H62Private Const VK_NUMPAD3 As Long = &H63Private Const VK_NUMPAD4 As Long = &H64Private Const VK_NUMPAD5 As Long = &H65Private Const VK_NUMPAD6 As Long = &H66Private Const VK_NUMPAD7 As Long = &H67Private Const VK_NUMPAD8 As Long = &H68Private Const VK_NUMPAD9 As Long = &H69Private Const VK_PAUSE As Long = &H13Private Const VK_PRINT As Long = &H2APrivate Const VK_PRIOR As Long = &H21 '上翻頁鍵Private Const VK_RCONTROL As Long = &HA3Private Const VK_RETURN As Long = &HD '回車鍵Private Const VK_RIGHT As Long = &H27Private Const VK_RMENU As Long = &HA5 '右 Alt 鍵Private Const VK_RSHIFT As Long = &HA1Private Const VK_RWIN As Long = &H5CPrivate Const VK_SCROLL As Long = &H91 'Scroll Lock 鍵Private Const VK_SEPARATOR As Long = &H6C '小鍵盤上的回車鍵Private Const VK_SHIFT As Long = &H10Private Const VK_SLEEP As Long = &H5F '休眠鍵Private Const VK_SNAPSHOT As Long = &H2C 'Print Screen 鍵Private Const VK_SPACE As Long = &H20Private Const VK_SUBTRACT As Long = &H6D '減号鍵Private Const VK_TAB As Long = &H9Private Const VK_UP As Long = &H26Private Const VK_OEM_1 As Long = &HBA 'Windows 2000:對于 US 标準鍵盤,是“;:”鍵Private Const VK_OEM_2 As Long = &HBF 'Windows 2000:對于 US 标準鍵盤,是“/?”鍵Private Const VK_OEM_3 As Long = &HC0 'Windows 2000:對于 US 标準鍵盤,是“`~”鍵Private Const VK_OEM_4 As Long = &HDB 'Windows 2000:對于 US 标準鍵盤,是“[{”鍵Private Const VK_OEM_5 As Long = &HDC 'Windows 2000:對于 US 标準鍵盤,是“\|”鍵Private Const VK_OEM_6 As Long = &HDD 'Windows 2000:對于 US 标準鍵盤,是“]}”鍵Private Const VK_OEM_7 As Long = &HDE 'Windows 2000:對于 US 标準鍵盤,是“單/雙引号”鍵Private Const VK_OEM_COMMA As Long = &HBC 'Windows 2000:對于任何國家/地區,是“,”鍵Private Const VK_OEM_MINUS As Long = &HBD 'Windows 2000:對于任何國家/地區,是“-”鍵Private Const VK_OEM_PERIOD As Long = &HBE 'Windows 2000:對于任何國家/地區,是“.”鍵Private Const VK_OEM_PLUS As Long = &HBB 'Windows 2000:對于任何國家/地區,是“ ”鍵
Private Const KEYEVENTF_KEYUP = &H2
Dim AA As LongDim MouseCurpos As POINTAPI
Dim Pcolor As LongDim R As Long, G As Long, B As Long
Dim s As StringDim hwd As Long
Private Sub Command1_Click()SetCursorPos CLng(Text1.Text), CLng(Text2.Text)
End Sub
Private Sub Command2_Click()GetCursorPos MouseCurposText3.Text = "鼠标位置為: " CStr(MouseCurpos.X) "- -" CStr(MouseCurpos.y)Timer2.Enabled = TrueEnd Sub
Private Sub Command3_Click()Sleep 500
SetCursorPos 292, 437mouse_event MOUSEEVENTF_LEFTDOWN, 292 * 65536 / 1920, 437 * 65536 / 1080, 0, 0mouse_event MOUSEEVENTF_LEFTUP, 292 * 65536 / 1920, 437 * 65536 / 1080, 0, 0
Sleep 500
keybd_event Asc("V"), 0, 0, 0 '模拟回車Sleep 200keybd_event Asc("V"), 0, KEYEVENTF_KEYUP, 0 '撤消回車Sleep 300
keybd_event Asc("B"), 0, 0, 0 '模拟回車Sleep 200keybd_event Asc("B"), 0, KEYEVENTF_KEYUP, 0 '撤消回車Sleep 300
keybd_event Asc("F"), 0, 0, 0 '模拟回車Sleep 200keybd_event Asc("F"), 0, KEYEVENTF_KEYUP, 0 '撤消回車Sleep 300
keybd_event Asc("O"), 0, 0, 0 '模拟回車Sleep 200keybd_event Asc("O"), 0, KEYEVENTF_KEYUP, 0 '撤消回車Sleep 300
keybd_event Asc("R"), 0, 0, 0 '模拟回車Sleep 200keybd_event Asc("R"), 0, KEYEVENTF_KEYUP, 0 '撤消回車Sleep 300
keybd_event Asc("M"), 0, 0, 0 '模拟回車Sleep 200keybd_event Asc("M"), 0, KEYEVENTF_KEYUP, 0 '撤消回車Sleep 300
keybd_event Asc("8"), 0, 0, 0 '模拟回車Sleep 200keybd_event Asc("8"), 0, KEYEVENTF_KEYUP, 0 '撤消回車
' Sleep 1000'' keybd_event VK_F1, 0, 0, 0 '模拟回車' Sleep 500' keybd_event VK_F1, 0, KEYEVENTF_KEYUP, 0 '撤消回車'
End Sub
Private Sub Command4_Click()Sleep 500
SetCursorPos 291, 593
'1920 和1080 為自己電腦屏幕的最大像素
mouse_event MOUSEEVENTF_LEFTDOWN, 291 * 65536 / 1920, 593 * 65536 / 1080, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 291 * 65536 / 1920, 593 * 65536 / 1080, 0, 0
'Sleep 500
SetCursorPos 362, 593
'1920 和1080 為自己電腦屏幕的最大像素mouse_event MOUSEEVENTF_LEFTDOWN, 362 * 65536 / 1920, 593 * 65536 / 1080, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 362 * 65536 / 1920, 593 * 65536 / 1080, 0, 0''''Sleep 500
SetCursorPos 434, 593
'1920 和1080 為自己電腦屏幕的最大像素mouse_event MOUSEEVENTF_LEFTDOWN, 434 * 65536 / 1920, 593 * 65536 / 1080, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 434 * 65536 / 1920, 593 * 65536 / 1080, 0, 0
'Sleep 800
SetCursorPos 515, 593Sleep 500
'1920 和1080 為自己電腦屏幕的最大像素mouse_event MOUSEEVENTF_LEFTDOWN, 515 * 65536 / 1920, 593 * 65536 / 1080, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 515 * 65536 / 1920, 593 * 65536 / 1080, 0, 0
End Sub
Private Sub Timer2_Timer()Text3.Text = ""AA = GetDC(0)
Pcolor = GetPixel(AA, CStr(MouseCurpos.X), CStr(MouseCurpos.y))
R = Pcolor And &HFFG = (Pcolor And 65280) / 256B = (Pcolor And &HFF0000) / 65536
Text5.BackColor = Pcolor
GetCursorPos MouseCurpos
Text3.Text = "鼠标位置為: " CStr(MouseCurpos.X) "- -" CStr(MouseCurpos.y) & " RGB=>" & R & " " & G & " " & B
End Sub
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!