比如说一些游戏或360等杀毒软件屏蔽 点击函数……
API也是一个函数而已,如果API被屏幕了就不能用了,那么如果在程序里自己写一个这样的函数,是不是就可以无法被屏蔽了?那么怎么写这样的一个函数呢?用vb! 如果vb写出不的话,用vc写成DLL也可以。
解决方案 »
- 下面的数据能在treeview中显示吗???
- 如何实现vb MDI窗体的背景图片随窗口尺寸的变化而变化?
- 请将我的代码做一下修改(关于用textbox读取excel值)
- 我做的支票打印软件 大家多提宝贵意见。
- ●◎○VB写LOG文件,满5行以后从第一行开始覆盖写入,其余保留的问题,请高手相助!!○◎●
- chr(29)chr(30)chr(31)这些是什么字符?print 和 picture1.print显示还不一样?
- 找不到某些API所要用的常数,APIVIEW里未列,MSDN里也查不到,
- 关于Winsock接收问题
- 有关于图像处理的一些问题,有一定难度!!!,各位高手给提提建议!!!!
- 怎样选中treeview(vb)中一个node的chekbox,让这个node下的所有子node也选中?
- vb listbox怎么能删除想要删除的数据
- 如何实现VB重多条件判定,谢谢!
'Example by Daniel Kaufmann ([email protected])'Paste this code in a Form
'with a Menu named menu1 which has a menuitem named menu2Private Type POINTAPI
x As Long
y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End TypePrivate Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetMenuItemRect Lib "user32" (ByVal hwnd As Long, ByVal hMenu As Long, ByVal uItem As Long, lprcItem As RECT) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As LongPrivate Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move
Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move
Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
Private Const MOUSEEVENTF_MIDDLEUP = &H40
Private Const MOUSEEVENTF_RIGHTDOWN = &H8
Private Const MOUSEEVENTF_RIGHTUP = &H10Private 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 Declare Function GetMessageExtraInfo Lib "user32" () As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Const SM_CXSCREEN = 0 'X Size of screen
Const SM_CYSCREEN = 1 'Y Size of ScreenPrivate Sub Form_KeyPress(KeyAscii As Integer)
Dim mWnd As Long
mWnd = Me.hwnd
Dim hMenu As Long, hSubMenu As Long hMenu = GetMenu(mWnd) 'Get the Menu of the Window(MenuBar)
ClickMenuItem mWnd, hMenu, 0 'Click on the first SubMenu
hSubMenu = GetSubMenu(hMenu, 0) 'Get its submenu
ClickMenuItem mWnd, hSubMenu, 0 'Click on the first MenuItem of the Submenu
End Sub
Private Sub ScreenToAbsolute(lpPoint As POINTAPI)
lpPoint.x = lpPoint.x * (&HFFFF& / GetSystemMetrics(SM_CXSCREEN))
lpPoint.y = lpPoint.y * (&HFFFF& / GetSystemMetrics(SM_CYSCREEN))
End SubPrivate Sub Click(p As POINTAPI)
'p.X and p.Y in absolute coordinates
'Put the mouse on the pointmouse_event MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_MOVE, p.x, p.y, 0, GetMessageExtraInfo()
'Mouse Down
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, GetMessageExtraInfo()
'Mouse Up
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, GetMessageExtraInfo()
End SubPrivate Sub ClickMenuItem(ByVal mWnd As Long, ByVal hMenu As Long, ByVal Pos As Long)
Dim ret As Long
Dim r As RECT, p As POINTAPI
ret = GetMenuItemRect(mWnd, hMenu, Pos, r)
If ret = 0 Then Exit Sub
p.x = (r.Left + r.Right) / 2
p.y = (r.Top + r.Bottom) / 2
ScreenToAbsolute p
'Click on p
Click p
End SubPrivate Sub Form_Load()
Dim mWnd As Long, p As POINTAPI
mWnd = Me.hwnd
Dim hMenu As Long, hSubMenu As Long
hMenu = GetMenu(mWnd) 'Get the Menu of the Window(MenuBar)
ClickMenuItem mWnd, hMenu, 0 'Click on the first SubMenu
hSubMenu = GetSubMenu(hMenu, 0) 'Get its submenu
ClickMenuItem mWnd, hSubMenu, 0 'Click on the first MenuItem of the Submenu
p.x = &HFFFF& / 2
p.y = &HFFFF& / 2
Click p
Me.AutoRedraw = True
Me.BackColor = vbWhite
Print "Press any key"
End SubPrivate Sub menu2_Click()
MsgBox "Click"
End Sub
这样这个函数就是自己程序内部代码,应该就屏蔽不了了吧
你这要看它是如何屏蔽的
Private Sub ScreenToAbsolute(lpPoint As POINTAPI)
lpPoint.x = lpPoint.x * (&HFFFF& / GetSystemMetrics(SM_CXSCREEN))
lpPoint.y = lpPoint.y * (&HFFFF& / GetSystemMetrics(SM_CYSCREEN))
End Sub
这个是转换什么坐标的?啥意思?