ADVERTISEMENT
返回
  • 浏览过的版块

1
ADVERTISEMENT
Huaren
等级大校
威望12
贴子10169
魅力12078
注册时间2007-03-07

ccang1234

查看全部

被公司电脑上变态的监控软件(sapience buddy)气疯了,求支招

40488

103

2022-05-17 21:57:45

回复 1楼Grace302的帖子

二话不说,直接上代码。


考虑到楼主的电脑无法安装任何其他软件,那么只能用一般都有的Excel,


1.在EXCEL里,enable 开发者模式,然后加入一个按钮,然后这个按钮的代码如下:


Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal Y As Long) 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 Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Private Const MOUSEEVENTF_LEFTDOWN = &H2

Private Const MOUSEEVENTF_LEFTUP = &H4


Private working As Boolean




Sub keep_screen_live_Click()


  Set working = True

  Do While working

   

    Call ClickMyScreen

    MsgBox "clicking"

    Sleep 60000

     

     

  Loop

End Sub


Private Sub ClickMyScreen()


  mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0

  Sleep 50

  mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

  Sleep 100


End Sub


然后保存成 macro的excel,点击开始按钮,就会自动60秒点一次屏幕了。


6323733






Helen_Wood 发表于 2022-05-17 00:29

厉害

初始化编辑器...

到底了