ADVERTISEMENT
返回
  • 浏览过的版块

1
ADVERTISEMENT
Huaren
等级三等兵
威望--
贴子117
魅力604
注册时间2018-03-31

Helen_Wood

查看全部

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

40413

103

2022-05-17 00:29:42

回复 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





初始化编辑器...

到底了