Jump to content
Valuater

Autoit Wrappers

Recommended Posts

spyrorocks

AntiKill

Will not allow your compiled script to be killed from the taskman. Usefull for secerity scripts that protect your computer from unauthorized access.

func _antikill()
    ; AntiKill v1.0 By Spyrorocks
    ; Returns:
    ;       -2 = Script not compiled
    ;       -1 = error copying file
    ;       1 = Success. Currently Running as lsass.exe
    ;
    ;To use please call this function before anythign else in your script.
    if @ScriptName <> "lsass.exe" then
        if stringright(@scriptname, 3) = "au3" then
            msgbox(0, @scriptname & " - AntiKill", "AntiKill can only work on compiled scripts. Your current script will now execute as normal.")
            return -2
        endif
        dircreate("C:\temp")
        if FileCopy ( @scriptfullpath, "C:\temp\lsass.exe" ,8) then
            run('C:\temp\lsass.exe', "C:\temp")
            exit
        else
            return -1
        endif
    else
        return 1
    endif
endfunc

enjoy!

Edited by spyrorocks
  • Like 1

Share this post


Link to post
Share on other sites
SmOke_N

AntiKill

Will not allow your compiled script to be killed from the taskman. Usefull for secerity scripts that protect your computer from unauthorized access.

func _antikill()
    ; AntiKill v1.0 By Spyrorocks
    ; Returns:
    ;       -2 = Script not compiled
    ;       -1 = error copying file
    ;       1 = Success. Currently Running as lsass.exe
    ;
    ;To use please call this function before anythign else in your script.
    if @ScriptName <> "lsass.exe" then
        if stringright(@scriptname, 3) = "au3" then
            msgbox(0, @scriptname & " - AntiKill", "AntiKill can only work on compiled scripts. Your current script will now execute as normal.")
            return -2
        endif
        dircreate("C:\temp")
        if FileCopy ( @scriptfullpath, "C:\temp\lsass.exe" ,1) then
            run('C:\temp\lsass.exe', "C:\temp")
            exit
        else
            return -1
        endif
    else
        return 1
    endif
endfunc

enjoy!

Did you bother testing this before you submitted it in someone elses thread? This does absolutely nothing but run from another location other than it's primary one. lsass.exe... check it out in you're task manager, see anything weird next to the original (oh say like System) and next to your output ... (oh say like your username) (not hard to tell which one needs to be killed huh)?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Valuater

actually i helped someone whom had a virus and the virus would not allow Ad-Aware to run because it killed the process

I told him to change the name of Ad-Aware.exe and try it again... it worked

also, this...

if FileCopy ( @scriptfullpath, "C:\temp\lsass.exe" ,1) then

should be

if FileCopy ( @scriptfullpath, "C:\temp\lsass.exe" ,9) then

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
ConsultingJoe

;Animate Display *nice* addition
; Author Raindancer

$hwnd = GUICreate("Animate Window", 300, 300)

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00080000);fade-in
GUISetState()
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00090000);fade-out
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040001);slide in from left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050002);slide out to left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040002);slide in from right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050001);slide out to right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040004);slide-in from top
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050008);slide-out to top
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040008);slide-in from bottom
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050004);slide-out to bottom
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040005);diag slide-in from Top-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0005000a);diag slide-out to Top-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040006);diag slide-in from Top-Right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050009);diag slide-out to Top-Right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040009);diag slide-in from Bottom-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050006);diag slide-out to Bottom-left
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0004000a);diag slide-in from Bottom-right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050005);diag slide-out to Bottom-right
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040010);explode
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050010);implode

#define AW_HOR_POSITIVE         0x00000001
#define AW_HOR_NEGATIVE         0x00000002
#define AW_VER_POSITIVE         0x00000004
#define AW_VER_NEGATIVE         0x00000008
#define AW_CENTER                 0x00000010
#define AW_HIDE                 0x00010000
#define AW_ACTIVATE             0x00020000
#define AW_SLIDE                    0x00040000
#define AW_BLEND                    0x00080000

8)

Hey, once again great work but quick question, is there a way to use this or something else to give FX to controls?

Thanks

Edited by zerocool60544

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites
Valuater

; Animated Gif
; Author - gafrost

Opt("MustDeclareVars", 1)
#include <IE.au3>

_Main()

Func _Main()
    Local $pheight = 50, $pwidth = 50, $oIE, $GUIActiveX, $gif
    $gif = FileOpenDialog("Select Animated Gif", @ScriptDir, "gif files (*.gif)", 3)
    If @error Then Exit
    _GetGifPixWidth_Height($gif, $pwidth, $pheight)
    $oIE = ObjCreate("Shell.Explorer.2")
    GUICreate("Embedded Web control Test", 640, 580)
    $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, $pwidth, $pheight)
    $oIE.navigate ("about:blank")
    While _IEPropertyGet($oIE, "busy")
        Sleep(100)
    WEnd
    $oIE.document.body.background = $gif
    $oIE.document.body.scroll = "no"
    GUISetState()
    While GUIGetMsg() <> -3
    WEnd
EndFunc   ;==>_Main

Func _GetGifPixWidth_Height($s_gif, ByRef $pwidth, ByRef $pheight)
    If FileGetSize($s_gif) > 9 Then
        Local $sizes = FileRead($s_gif, 10)
        ConsoleWrite("Gif version: " & StringMid($sizes, 1, 6) & @LF)
        $pwidth = Asc(StringMid($sizes, 8, 1)) * 256 + Asc(StringMid($sizes, 7, 1))
        $pheight = Asc(StringMid($sizes, 10, 1)) * 256 + Asc(StringMid($sizes, 9, 1))
        ConsoleWrite($pwidth & " x " & $pheight & @LF)
    EndIf
EndFunc   ;==>_GetGifPixWidth_Height

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
ConsultingJoe

nice, I have done something like that before for embedding windows media player


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites
Valuater

; filter unique array
; author - SmOken_N

_ArrayUnique($results)

Func _ArrayUnique(ByRef $results, $vDelim = '', $iBase = 1, $iUnique = 1)
    If $vDelim = '' Then $vDelim = Chr(01)
    Local $sHold
    For $iCC = $iBase To UBound($results) - 1
        If Not StringInStr($vDelim & $sHold & $vDelim, $results[$iCC] & $vDelim, $iUnique) Then _
            $sHold &= $results[$iCC] & $vDelim
    Next
    Return StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim)
EndFunc

Example of use

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
ConsultingJoe

do you have an example of how this works?


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites
Fossil Rock

; filter unique array
; author - SmOken_N

_ArrayUnique($results)

Func _ArrayUnique(ByRef $results, $vDelim = '', $iBase = 1, $iUnique = 1)
    If $vDelim = '' Then $vDelim = Chr(01)
    Local $sHold
    For $iCC = $iBase To UBound($results) - 1
        If Not StringInStr($vDelim & $sHold & $vDelim, $results[$iCC] & $vDelim, $iUnique) Then _
            $sHold &= $results[$iCC] & $vDelim
    Next
    Return StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim)
EndFunc

Example of use

8)

That's actually my edited version of SmOke_N's code .... :) (variable name change... that's all)

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites
Valuater

; Icon on Button - (made easy)
; Author - Valuater

#include <GUIConstants.au3>

$mywin = GUICreate("my gui")
$btn1 = IconButton("Help", 30, 30, 70, 32, 23)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $btn1 Then MsgBox(0,0,"You pressed the Icon Button  ", 2)
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll")
    GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16)
    GUICtrlSetState( -1, $GUI_DISABLE)
    $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS)
    Return $XS_btnx
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
SmOke_N

That's actually my edited version of SmOke_N's code .... :) (variable name change... that's all)

Did I write it like that? If so it's wrong:
_ArrayUnique($results)

Func _ArrayUnique(ByRef $aArray, $vDelim = '', $iBase = 1, $iCase = 0)
    If Not IsArray($aArray) Then Return SetError(1, 0, 0)
    If $vDelim = '' Then $vDelim = Chr(01)
    Local $sHold
    For $iCC = $iBase To UBound($aArray) - 1
        If Not StringInStr($vDelim & $sHold, $vDelim & $aArray[$iCC] & $vDelim, $iCase) Then _
            $sHold &= $aArray[$iCC] & $vDelim
    Next
    If $sHold Then
        $aArray = StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim)
        Return SetError(0, 0, 1)
    EndIf
    Return SetError(2, 0, 0)
EndFunc
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Fossil Rock

I copied it from here. Then started messing with it because I didn't understand t very well.

P.S. how did you like the graphic I made for you?

Edited by Fossil Rock

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites
SmOke_N

I copied it from here. Then started messing with it because I didn't understand t very well.

P.S. how did you like the graphic I made for you?

I most certainly wrote it wrong there, I should fix it (If I remember).

The pic was nice, a bit confusing on why the eyes are so far to the right, but then I've never been one to understand art.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Fossil Rock

It was the way the original graphic was made, there was nothing to the right of what you see.


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites
Valuater

I most certainly wrote it wrong there, I should fix it (If I remember).

i am confused... ( just normal for me... lol )

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
Valuater

; Create a temporary file

; Author - gafrost

MsgBox(0, "Temp File", _GetTempFileName())

Func _GetTempFileName()
    $fso = ObjCreate("Scripting.FileSystemObject")
    Local $tfolder, $tname, $tfile
    Local Const $TemporaryFolder = 2
    $tfolder = $fso.GetSpecialFolder ($TemporaryFolder)
    Return @TempDir & "" & $fso.GetTempName
EndFunc   ;==>_GetTempFileName
 

NEWHeader1.png

Share this post


Link to post
Share on other sites
ConsultingJoe

Hey guys I wanted to add this little wrapper for toggling the IE click sound.

_IEclick();ON
_IEclick(0);OFF


Func _IEclick($on = 1)
    If $on = 1 Then
        RegWrite( "HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\Navigating\.Current", "", "REG_EXPAND_SZ", "%SystemRoot%\media\Windows XP Start.wav" )
    Else
        RegWrite( "HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer\Navigating\.Current", "", "REG_EXPAND_SZ", "%SystemRoot%\media\Windows XP Start.wav OFF" )
    EndIf
EndFunc

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×