Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GUIConstantsEx.au3>
- #include <GUIToolTip.au3>
- #include <MsgBoxConstants.au3>
- #include <WinAPIGdiDC.au3>
- #include <FontConstants.au3>
- #include <SendMessage.au3>
- #include <WindowsConstants.au3>
- HotKeySet("^{NUMPADMULT}", "DerrubarConexao") ; Shift-Alt-d
- HotKeySet("^{NUMPADSUB}", "DerrubarSessao") ; Shift-Alt-d
- HotKeySet("^{NUMPAD0}", "Sair") ; Shift-Alt-d
- While 1
- Sleep(100)
- WEnd
- Func DerrubarSessao()
- ConsoleWrite('Suspendendo Gta5' & @CRLF)
- _ProcessSuspend('gta5.exe')
- Sleep(10000)
- ;~ For $g = 0 To 7
- ;~ $cd = $g - 8
- ;~ ConsoleWrite('Retomando a Gta em: ' & $cd & @CRLF)
- ;~ Sleep(1000)
- ;~ Next
- ConsoleWrite('Retomand Gta5 da suspenção' & @CRLF)
- _ProcessResume('gta5.exe')
- EndFunc
- Func DerrubarConexao()
- ConsoleWrite('Iniciando Derrubar Conexão' & @CRLF)
- _DosRun('netsh interface set interface name="Ethernet" admin=disabled')
- ConsoleWrite('3' & @CRLF)
- Sleep(10000)
- ConsoleWrite('Retomando Conexão' & @CRLF)
- _DosRun('netsh interface set interface name="Ethernet" admin=enable')
- EndFunc
- Func Sair()
- _ProcessResume('gta5.exe')
- _DosRun('netsh interface set interface name="Ethernet" admin=enable')
- Exit
- EndFunc
- ;~ jguinch mod for me
- ;~ https://www.autoitscript.com/forum/topic/179865-how-to-change-tooitip-font-size/
- Func BigToolTip($btt_MSG,$btt_Temp,$btt_Left,$btt_Top,$btt_Size=False)
- Local $hToolTip = _GUIToolTip_Create(0), $hDC = _WinAPI_GetDC(0)
- Local $hFont = _WinAPI_CreateFont($btt_Size, 0, 0, 0, 800, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Tahoma')
- Local $hOldFont = _WinAPI_SelectObject($hDC, $hFont)
- _SendMessage($hToolTip, $WM_SETFONT, $hFont, True)
- _GUIToolTip_AddTool($hToolTip, 0, $btt_MSG, 0, 0, 0, 0, 0, BitOR($TTF_TRACK, $TTF_ABSOLUTE)) ; <<<<<<<<<<<<<<<
- _GUIToolTip_TrackPosition($hToolTip, $btt_Left, $btt_Top)
- _GUIToolTip_TrackActivate($hToolTip, True, 0, 0)
- Sleep($btt_Temp)
- _GUIToolTip_Destroy($hToolTip)
- EndFunc
- ;~ VIP
- ;~ https://www.autoitscript.com/forum/topic/111184-need-to-execute-cmd-commands/
- Func _DosRun($sCommand)
- Local $nResult = Run('"' & @ComSpec & '" /c ' & $sCommand, @SystemDir, @SW_HIDE, 6)
- ProcessWaitClose($nResult)
- Return StdoutRead($nResult)
- EndFunc ;==>_DosRun
- ;~ The Kandie Man
- ;~ https://www.autoitscript.com/forum/topic/32975-process-suspendprocess-resume-udf/
- Func _ProcessSuspend($process)
- $processid = ProcessExists($process)
- If $processid Then
- $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid)
- $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0])
- DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle)
- If IsArray($i_sucess) Then
- Return 1
- Else
- SetError(1)
- Return 0
- Endif
- Else
- SetError(2)
- Return 0
- Endif
- EndFunc
- Func _ProcessResume($process)
- $processid = ProcessExists($process)
- If $processid Then
- $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid)
- $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0])
- DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle)
- If IsArray($i_sucess) Then
- Return 1
- Else
- SetError(1)
- Return 0
- Endif
- Else
- SetError(2)
- Return 0
- Endif
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement