-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDontTouchMe.au3
131 lines (105 loc) · 3.62 KB
/
DontTouchMe.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#include <BlockInputEx.au3>
#include <GUIConstantsEx.au3>
#include <FontConstants.au3>
HotKeySet("{F9}", "_Terminate")
Global $Notepad_Open = "0"
Global $hNotepad_Wnd
Local $Counter
$strComputer = "."
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
_BlockInputEx(1, "", "")
Func _Terminate()
Exit
EndFunc
Func _OpenNotepad()
If $Notepad_Open = "0" Then
Run("C:\Program Files\Notepad++\notepad++.exe", "", @SW_MAXIMIZE)
WinWait("[CLASS:Notepad++]","",5)
Sleep(1000)
Send("{F12}")
;~ ControlSetText($hNotepad_Wnd, "", "", _
;~ "Now try to input some keys in here..." & @CRLF & _
;~ "Well, that's the idea, you can't, don't you?" & @CRLF & @CRLF & ":)")
$Notepad_Open = "1"
EndIf
EndFunc
Func _scrollDown()
If $Notepad_Open = "1" Then
If $Counter = 25 Then
MouseWheel("down",1)
$Counter = 0
Else
$Counter = $Counter + 1
EndIf
EndIf
EndFunc
Func _checkUSB()
If $Counter = 25 Then
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity where DeviceID like 'USB\\%'")
If IsObj($colItems) then
For $objItem In $colItems
If $objItem.Caption == "D-Link DWA-131 Wireless N Nano USB Adapter" Then
_Terminate()
EndIf
Next
Endif
$Counter = 0
Else
$Counter = $Counter + 1
EndIf
EndFunc
Func _CreateGUI()
Local $hGUI = GUICreate("Boo!",@DesktopWidth,@DesktopHeight,0,0,$WS_POPUP)
Local $idOK = GUICtrlCreateButton("Boo!", 310, 370, 85, 25)
GUISetBkColor(0x000000)
GUICtrlCreateLabel("AUAUAUAUAUUAUAUAUAUAUAU 1 Cell 1", 0, 0, @DesktopWidth,@DesktopHeight)
GUICtrlSetColor(-1, 0x00FF40) ; will change text color for specified control
Local Const $sFont = "Consolas"
GUICtrlCreateLabel("AUAUAUAUAUUAUAUAUAUAUAU 1 Cell 1", 70, 80, @DesktopWidth,@DesktopHeight)
GUICtrlSetFont(-1, 20, $FW_NORMAL, $GUI_FONTUNDER, $sFont,5) ; Set the font of the previous control.
GUICtrlSetColor(-1, 0x00FF40) ; will change text color for specified control
GUICtrlCreateLabel("AUAUAUAUAUUAUAUAUAUAUAU 1 Cell 1", 200, 200, @DesktopWidth,@DesktopHeight)
GUICtrlSetFont(-1, 12, $FW_NORMAL, $GUI_FONTITALIC, $sFont,5) ; Set the font of the controlID stored in $iLabel2.
GUICtrlSetColor(-1, 0x00FF40) ; will change text color for specified control
GUICtrlCreateLabel("AUAUAUAUAUUAUAUAUAUAUAU 1 Cell 1",500, 500, @DesktopWidth,@DesktopHeight)
GUICtrlSetFont(-1, 9, $FW_NORMAL, $GUI_FONTSTRIKE, $sFont,5) ; Set the font of the controlID stored in $iLabel3.
GUICtrlSetColor(-1, 0x00FF40) ; will change text color for specified control
GUISetState(@SW_SHOW, $hGUI)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $idOK
ExitLoop
EndSwitch
WEnd
GUIDelete($hGUI)
EndFunc
;_CreateGUI()
_main()
Func _main()
;~ _MouseTrap( 0, 0, 1, 1 )
BlockInput(1)
while 1
if _IsPressed(01) Then
_OpenNotepad()
If $Notepad_Open = "1" Then
BlockInput(1)
_MouseTrap( 0, 0, 0, 0 )
EndIf
endif
If ProcessExists( "taskmgr.exe" ) Then
ProcessClose( "taskmgr.exe" )
BlockInput(1)
_MouseTrap( 0, 0, 0, 0 )
EndIf
_scrollDown()
_checkUSB()
sleep(1)
Wend
EndFunc
;~ _BlockInputEx(3, "", _
;~ "{ALT}|{DEL}|{HOME}|{ESCAPE}|{ESC}|{BREAK}|{PAUSE}|{BREAK}|" & _
;~ "{APPSKEY}|{LALT}|{RALT}|{LCTRL}|{RCTRL}|{LSHIFT}|{RSHIFT}|" & _
;~ "{SLEEP}|{ALTDOWN}|{SHIFTDOWN}|{CTRLDOWN}|{LWINDOWN}|{LSHIFT}|" & _
;~ "{SLEEP}|{ALTDOWN}|{SHIFTDOWN}|{CTRLDOWN}|{LWINDOWN}|{RWINDOWN}|" & _
;~ "{TAB}|{LWIN}|{RWIN}|{BACKSPACE}|{UP}|{DOWN}|{LEFT}|{RIGHT}" _
;~ )