Category: Windows 2000/XP
Type: Snippets
Difficulty: Beginning
Version Compatibility: Visual Basic 6
More information: Automatically dismisses messages sent with "NET SEND" or a program that uses NETAPI.DLL for the same purpose without using API calls (just uses AppActivate and SendKeys).
This code has been viewed 44852 times.
Instructions: Copy the declarations and code below and paste directly into your VB project.
Declarations:
'NET SEND COUNTER-MEASURE CODE BY DAPROBER. USE AT YOUR OWN RISK 'IF YOU DO DECIDE TO USE IT, JUST MENTION ME SOMEWHERE VISIBLE (LIKE THE ABOUT BOX)... 'Notes: Place inside a timer that has the interval set to 10. ' The name I used is tmrNSCM. ' Use val(tmrNSCM.Tag) to see how many messages have been dismissed |
Code:
Private Sub tmrNSCM_Timer() On Error Goto foo DoEvents AppActivate "Messenger Service", 0 DoEvents SendKeys " ", 1 DoEvents tmrNSCM.Tag=str(val(tmrNSCM.Tag)+1) foo: End Sub |
No comments:
Post a Comment