spyrorocks Posted September 17, 2006 Posted September 17, 2006 (edited) 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 September 17, 2006 by spyrorocks guestscripter 1 [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center]
Moderators SmOke_N Posted September 17, 2006 Moderators Posted September 17, 2006 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.
Valuater Posted September 17, 2006 Author Posted September 17, 2006 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)
spyrorocks Posted September 17, 2006 Posted September 17, 2006 @Smoke Doesent matter if they know what needs to be killed, task manager wont let them. Other 3rd party task manager type things will though. @Valuater thanks [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center]
ConsultingJoe Posted September 19, 2006 Posted September 19, 2006 (edited) ;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 September 19, 2006 by zerocool60544 Check out ConsultingJoe.com
Valuater Posted September 27, 2006 Author Posted September 27, 2006 ; Read the last line of a text file ; author - SmOke_N $aSplit = StringSplit(StringStripCR(FileRead('FileLocation.Name')), @LF) MsgBox(64, 'Last Line', $aSplit[$aSplit[0]]) 8)
Valuater Posted September 27, 2006 Author Posted September 27, 2006 (edited) ; 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 November 27, 2010 by Valuater
ConsultingJoe Posted September 27, 2006 Posted September 27, 2006 nice, I have done something like that before for embedding windows media player Check out ConsultingJoe.com
Valuater Posted September 28, 2006 Author Posted September 28, 2006 (edited) ; 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) EndFuncExample of use8) Edited September 28, 2006 by Valuater
ConsultingJoe Posted September 28, 2006 Posted September 28, 2006 do you have an example of how this works? Check out ConsultingJoe.com
Valuater Posted September 28, 2006 Author Posted September 28, 2006 do you have an example of how this works?here....http://www.autoitscript.com/forum/index.ph...ost&p=556088)
Fossil Rock Posted September 28, 2006 Posted September 28, 2006 ; 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!
Valuater Posted September 29, 2006 Author Posted September 29, 2006 ; 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)
Moderators SmOke_N Posted September 29, 2006 Moderators Posted September 29, 2006 (edited) 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 September 29, 2006 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.
Fossil Rock Posted September 29, 2006 Posted September 29, 2006 (edited) 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 September 29, 2006 by Fossil Rock Agreement is not necessary - thinking for one's self is!
Moderators SmOke_N Posted September 29, 2006 Moderators Posted September 29, 2006 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.
Fossil Rock Posted September 29, 2006 Posted September 29, 2006 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!
Valuater Posted September 29, 2006 Author Posted September 29, 2006 (edited) I most certainly wrote it wrong there, I should fix it (If I remember).i am confused... ( just normal for me... lol )8) Edited September 29, 2006 by Valuater
Valuater Posted September 30, 2006 Author Posted September 30, 2006 ; 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 o脻梅 脴g颅j脳娄楼酶楼zv娄y漏脻r路碌猫颅颅毛庐酶搂+_垄禄卢y芦颅垄+脴)=脕脨 脜脮陆脨铆5脮脥脩卤脡Y脡脤脜脮陆脨矛掳脛陇()}5楼赂 陇()脮鹿}5楼赂 陇(1陆掳脌脤脴铆脥}脩碌脌么} 脡脩Q碌脕楼卤9碌 陇((1陆掳脌脤脴铆隆}脩碌脌么楼卤=脕赂 脌脤脴铆脥}脩碌脌掳脛陇(楼卤]脡楼脩 脌脤脴铆隆}脩碌脌掳脜脮陆脨铆!卤卤陆脺]陆脡卤脤脤矛脤脤矛脤脤矛脜脮陆脨矛陇(楼卤 卤陆脥 脌脤脴铆隆}脩碌脌陇(脌脤脴铆隆}脩碌脌么楼卤=脕赂 脌脤脴铆脥}脩碌脌掳脌陇(5脥 陆脿 脌掳脜脮陆脨铆Q碌脌楼卤U脥脜脮陆脨矛掳楼卤I 脌脤脴铆隆}脩碌脌陇陇(楼卤 卤陆脥 脌脤脴铆隆}脩碌脌陇(楼卤卤脩 脌脤脴铆脥}脩碌脌陇)鹿脮鹿矛么么脨铆}5楼赂((矛么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么(矛(矛脥脡楼脕脩楼陆赂猫} 脡脩Q碌脕楼卤9碌(矛A脡碌脩脠隆脤陇猫卤陆脩楼陆赂麓脻隆脡脩录脡脩脩隆脩碌脌楼卤(矛脕脩 么脮脥脩陆麓脕脩 脩录脡脩脩碌脌楼卤楼赂(矛I脜脮楼脡碌鹿脨猫(矛I脩脮脡赂Y卤脮隆脤陇猫I脩脮脡鹿脤脡鹿陆碌卤盲鹿脡脩脩碌脕陆脡脡盲楼卤鹿碌(矛%脡脡陆脠脩隆赂脡脡陆脠楼脤脥脨鹿碌脕脩盲脥脩脡楼鹿楼脤脡脩脮脡鹿(矛U脥脠 卤卤Q楼脌猫} 脡脩Q碌脕楼卤9碌隆m卤陆脩楼陆鹿l卤脕脩隆ut陇 脡脩脤脩碌脌楼卤(矛脮脩隆陆脠隆脤陇猫脡盲脡陆脥脨(矛9陆脩隆脤陇猫(矛脌么]楼鹿陆脻脤脩碌脌陆卤脠陆脠]楼鹿陆脻脤陆卤脠楼脩碌脌陆卤脠陆脥赂脤盲铆脨谩楼脥脨(矛脛么M氓脥脩麓陆卤脠隆鹿陆脨脡陆碌碌鹿陇(矛脠么脕脩 脩录脩隆脩碌脕陆脡脡盲楼卤脤陆卤脠(矛脤么 脮脥脩陆麓脕脩 隆碌脮脥脨脕脥脤脕脩 脻楼脩 脩隆楼脤脵卤脮陇(矛么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么么)脮鹿} 脡脩Q碌脕楼卤9碌 脌脤脴铆楼} 脡脩]隆脡么脠掳脌脤脴铆脥}A脩 么脤盲矛脤盲矛陇(1陆掳脌脤脴铆脥录么=漏 脡脩 脜脮陆脨铆M脡楼脕脩楼鹿鹿楼卤M氓脥脩碌=漏脨脜脮陆脨矛陇(1陆掳脌脤脴铆脩陆卤脠掳脌脤脴铆脩鹿碌(1陆掳鹿脮麓脌脤脴铆]楼鹿陆脻脥陆卤脠掳脌脤脴铆M氓脥脩碌陆卤脠掳脌脤脴铆Q碌脕陆脡脡氓陆卤脠掳脌脤脴铆 脮脥脩陆碌陆卤脠(M脻楼脩 脌脤脴铆楼} 脡脩]隆脡( 脥脌脤脴铆]楼鹿陆脻脥陆卤脠(%楼卤谩楼脥脩脤隆]楼鹿陆脻脥楼脠碌脌矛脜脮陆脨矛%碌脌脜脮陆脨矛陇Q隆赂(脌脤脴铆脩陆卤脠么]楼鹿陆脻脥楼脠碌脌矛脜脮陆脨矛%碌脌脜脮陆脨矛(卤脥(脌脤脴铆脩陆卤脠么]楼鹿陆脻脥楼脠(鹿%( 脥脌脤脴铆M氓脥脩碌陆卤脠矛鹿陆脨脻楼卤盲脮脥掳陆赂脤盲铆脨脡陆碌碌鹿脮脥楼鹿脩隆楼脤卤陆脩楼陆赂(脌脤脴铆脩陆卤脠么M氓脥脩碌楼脠( 脥脌脤脴铆Q碌脕陆脡脡氓陆卤脠(脌脤脴铆脩陆卤脠么Q碌脕楼脠( 脥脌脤脴铆 脮脥脩陆碌陆卤脠(%9脮碌A脡碌脤卤脨矛脠Q隆赂I脩脮脡赂M脩脡脡陆脠 脛掳脛掳脜脮陆脨矛脜脮陆脨矛陇(脌脤脴铆脥}A脩 么M脩脡楼鹿I脕卤 脌脤脴铆脥}A脩 掳脜脮陆脨矛录脜脮陆脨矛掳脜脮陆脨矛脜脮陆脨矛陇(%M脩脡楼鹿I楼隆脨 脌脤脴铆脥}A脩 掳脛陇么脜脮陆脨矛脜脮陆脨矛Q隆赂脌脤脴铆脥}A脩 么M脩脡楼鹿Q脡楼碌I楼隆脨 脌脤脴铆脥}A脩 掳脛陇(脌脤脴铆脩陆卤脠么脌脤脴铆脥}A脩 ( 脥卤脥(I脩脮脡赂M脩脡脡陆脠 脛掳脛掳脜脮陆脨矛脜脮陆脨矛陇(鹿M脻楼脩 (脌脤脴铆脩鹿碌么脌脤脴铆脩陆卤脠碌脌矛脜脮陆脨矛脜脮陆脨矛碌脌矛脌脤脴铆脥录鹿脩Q碌脕9碌 陇(1陆掳脌脤脴铆隆}楼卤么楼卤=脕赂 脌脤脴铆脩鹿碌掳脛陇(%脌脤脴铆隆}楼卤么麓脛Q隆赂I脩脮脡赂M脩脡脡陆脠 脛掳脛掳脜脮陆脨矛脜脮陆脨矛陇(楼卤 卤陆脥 脌脤脴铆隆}楼卤陇(I脩脮脡赂脌脤脴铆脩鹿碌)鹿脮鹿矛么么脨铆} 脡脩Q碌脕楼卤9碌(
ConsultingJoe Posted October 8, 2006 Posted October 8, 2006 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 Check out ConsultingJoe.com
Recommended Posts