Jump to content



Photo

Autoit Wrappers


  • This topic is locked This topic is locked
384 replies to this topic

#41 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 20 April 2006 - 05:24 PM

Plain Text         
; add user accounts ; Author - MHz _NetUser('Jack', 'pw_abc') _NetUser('Jill', 'pw_def') Func _NetUser($name, $password = '', $groupname = 'Administrators', $autologon = 0) ; Creates user accounts. Only 1 user can have autologon, if set.     Local $key     If Not FileExists(EnvGet('AllUsersProfile') & '\..\' & $name) Then         RunWait(@ComSpec & ' /c ' & _                 'Net User ' & $name & ' ' & $password & ' /add &&' & _                 'Net LocalGroup ' & $groupname & ' ' & $name & ' /add &' & _                 'Net Accounts /MaxPwAge:UnLimited', '', @SW_HIDE)         If $autologon Then             $key = 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'             RegWrite($key, 'DefaultUserName', 'Reg_sz', $name)             RegWrite($key, 'DefaultPassword', 'Reg_sz', $password)             RegWrite($key, 'AutoAdminLogon', 'Reg_sz', 1)         EndIf     EndIf EndFunc


8)

Posted Image

Clic The Pic!!!






#42 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 03 May 2006 - 12:10 AM

Plain Text         
; Get ALL controls Info ; Author - CyberSlug ( dusted-off old code ) $title = "Calculator" Run("calc.exe") WinWait($title) MsgBox( 0x0,"Info", _getClasses($title) ) Exit ; This function returns an @LF-separted list of controls on the specified window Func _getClasses($title) ;Get array of each control     Local  $buttonCount = 0, $editCount = 0, $staticCount = 0, $i     Local $classes = StringSplit(  WinGetClassList($title) , @LF)     Local  $classIDs[$classes[0]+1]     $classIDs[0] = $classes[0]     For $i = 1 to $classes[0]       Select       Case $classes[$i] = "Button"          $buttonCount = $buttonCount + 1          $classIDs[$i] = $classes[$i] & $buttonCount       Case $classes[$i] = "Edit"          $editCount = $editCount + 1          $classIDs[$i] = $classes[$i] & $editCount          $classes[$i] = "Input"       Case $classes[$i] = "Static"          $staticCount = $staticCount + 1          $classIDs[$i] = $classes[$i] & $staticCount          $classes[$i] = "Label"      Case Else          If $classes[$i] <> "" Then $classIDs[$i] = $classes[$i] & "?"       EndSelect     Next ;Display the results     Local $output = ""     For $i = 1 to $classIDs[0]         $output = $output & $classIDs[$i] & @LF     Next     Return $output EndFunc


8)

Posted Image

Clic The Pic!!!


#43 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 03 May 2006 - 07:29 AM

; timer to "thousandths" of a second ; Author - Holger While 1     ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec())     Sleep(1) WEnd Exit Func _MSec()     Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')     DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))     $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8))         $stSystemTime = 0         Return $sMilliSeconds EndFunc


8)

Edited by Valuater, 03 May 2006 - 07:52 AM.

Posted Image

Clic The Pic!!!


#44 jftuga

jftuga

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 315 posts

Posted 16 May 2006 - 01:24 PM

; Move Message Box ; Author - herewasplato _MoveMsgBox(0, "testTitle", "testText", 0, 10) Func _MoveMsgBox($MBFlag, $MBTitle, $MBText, $x, $y)     Local $file = FileOpen(EnvGet("temp") & "\MoveMB.au3", 2)     If $file = -1 Then Return;if error, give up on the move         Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')'     Local $line2 = 'WinWait("' & $MBTitle & '", "' & $MBText & '")'     Local $line3 = 'WinMove("' & $MBTitle & '", "' & $MBText & '"' & ', ' & $x & ', ' & $y & ')'     FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)     FileClose($file)         Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\MoveMB.au3")         MsgBox($MBFlag, $MBTitle, $MBText)         FileDelete(EnvGet("temp") & "\MoveMB.au3") EndFunc;==>_MoveMsgBox

A small improvement:
local $result = MsgBox($MBFlag, $MBTitle, $MBText)
and then have the last line of the function return $result.

-John

Edited by jftuga, 16 May 2006 - 03:28 PM.


#45 JoshDB

JoshDB

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 251 posts

Posted 17 May 2006 - 01:32 AM

You guys are crazy...

:)
Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

#46 ConsultingJoe

ConsultingJoe

    ConsultingJoe.com

  • Active Members
  • PipPipPipPipPipPip
  • 1,667 posts

Posted 17 May 2006 - 04:36 AM

Great job guys. these should be all included UDFs and this should be a sticky
Thanks

#47 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,729 posts

Posted 17 May 2006 - 01:59 PM

A small improvement:

local $result = MsgBox($MBFlag, $MBTitle, $MBText)
and then have the last line of the function return $result.

-John

I knew I had seen this post somewhere, I updated it even more differently lol... take a look: http://www.autoitscript.com/forum/index.ph...ndpost&p=185158

Of course, I don't know if you would call it an "improvement" :)

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.


#48 JoshDB

JoshDB

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 251 posts

Posted 17 May 2006 - 04:52 PM

This should be stickied.

Check this out:

http://www.autoitscript.com/forum/index.php?showtopic=26274
Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

#49 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 19 May 2006 - 06:30 PM

Plain Text         
; Windows - copy with progress ; Author - JdeB ;~ 4 Do not display a progress dialog box.   ;~ 8 Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.   ;~ 16 Respond with "Yes to All" for any dialog box that is displayed.   ;~ 64 Preserve undo information, if possible. ;~ 128 Perform the operation on files only if a wildcard file name (*.*) is specified.   ;~ 256 Display a progress dialog box but do not show the file names.   ;~ 512 Do not confirm the creation of a new directory if the operation requires one to be created.   ;~ 1024 Do not display a user interface if an error occurs.   ;~ 2048 Version 4.71. Do not copy the security attributes of the file. ;~ 4096 Only operate in the local directory. Don't operate recursively into subdirectories. ;~ 8192 Version 5.0. Do not copy connected files as a group. Only copy the specified files.   _FileCopy("C:\Installed Apps\Patches\WindowsXP-KB835935-SP2-ENU.exe","C:\temp") Func _FileCopy($fromFile,$tofile)     Local $FOF_RESPOND_YES = 16     Local $FOF_SIMPLEPROGRESS = 256     $winShell = ObjCreate("shell.application")     $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES) EndFunc



MSDN Documentation

http://msdn.microsoft.com/en-us/library/ms723207(VS.85).aspx


; to copy a directory
; the destination directory must exist

_FileCopy("C:\Installed Apps\Patches\*.*","C:\temp\test")


8)

Edited by Valuater, 07 November 2008 - 02:53 AM.

Posted Image

Clic The Pic!!!


#50 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 19 May 2006 - 06:45 PM

@Valuater

VERY NICE !!

And I thought I had seen all the COM objects :)

#51 nocow

nocow

    Seeker

  • Active Members
  • 26 posts

Posted 19 May 2006 - 09:55 PM

If any finds the source you will have free contents running all over. Also if you make the the encrypt password to some like the username then it will work diffence on each computer and nobody can just "Copy/past" the regedit and get free contents
Hope it help :)

Regards

#52 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,729 posts

Posted 19 May 2006 - 10:13 PM

If any finds the source you will have free contents running all over. Also if you make the the encrypt password to some like the username then it will work diffence on each computer and nobody can just "Copy/past" the regedit and get free contents
Hope it help :D

Regards

That doesn't point to any thread here (with a quote) and IMHO makes absolutely no sense :) :(

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.


#53 JoshDB

JoshDB

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 251 posts

Posted 19 May 2006 - 11:16 PM

I think he's talking about my post...
Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

#54 Neoborn

Neoborn

    Polymath

  • Active Members
  • PipPipPipPip
  • 249 posts

Posted 19 May 2006 - 11:48 PM

That doesn't point to any thread here (with a quote) and IMHO makes absolutely no sense :) :D


I love roast chicken! :(
~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoITPosted Image

#55 JoshDB

JoshDB

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 251 posts

Posted 20 May 2006 - 12:11 AM

I love roast chicken! :)


Roast Llllllllllama is for me :(
Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

#56 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 21 May 2006 - 08:06 AM

** new

; finding a "hung" process ; author gafrost $v_ret = DllCall("user32.dll","int","IsHungAppWindow", "hwnd", $hwnd) If $v_ret[0] Then MsgBox(0,"HungApp", "Application is Hung")   ;.... need to know the handle ( $hwnd )



Plain Text         
; finding if an application is hung ; neogia If _NotResponding("TITLE HERE", "TEXT HERE[OPTIONAL]", 1) Then; The last parameter indicates whether you want to close the hung app or not.     MsgBox(0,"", "Hung Application, closing app now.") Else     MsgBox(0,"", "Application running as intended.") EndIf Func _NotResponding($title, $text, $closeIfHung = 0)     $hWnd = WinGetHandle($title, $text)     If $hWnd == "" Then         MsgBox(0,"Error","Could not find window")         Exit     EndIf     $retArr = DllCall("user32.dll", "int", "IsHungAppWindow", "hwnd", $hWnd)     If @error == 0 Then         If $retArr[0] == 1 Then             If $closeIfHung Then                 ProcessClose(WinGetProcess($title, $text))             EndIf             Return 1         EndIf     Else         Return 0     EndIf EndFunc


8)

Edited by Valuater, 08 September 2006 - 02:49 AM.

Posted Image

Clic The Pic!!!


#57 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 21 May 2006 - 08:14 AM

; terminate a script right [i]before[/i] a user shuts ; VicTT Global $WM_QUERYENDSESSION = 0x0011 Func InterceptShutdown($hWnd, $msg, $w, $l)     MsgBox(0, "", "Shutting down") EndFunc  ;==>InterceptShutdown GUIRegisterMsg($WM_QUERYENDSESSION, "InterceptShutdown") While 1     Sleep(10) WEnd

8)

Posted Image

Clic The Pic!!!


#58 BigDod

BigDod

    The Mayor of Mirth

  • Jokers
  • 8,166 posts

Posted 27 May 2006 - 06:07 PM

I think that This one by GaFrost should be added.

Time you enjoyed wasting is not wasted time ......T.S. ElliotSuspense is worse than disappointment................Robert BurnsGod help the man who won't help himself, because no-one else will...........My Grandmother

Get Beta versions Here Get latest SciTE editor HereAutoIt 1-2-3 by Valuater - A great starting point.Posted Image Posted Image

#59 JoshDB

JoshDB

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 251 posts

Posted 28 May 2006 - 01:44 AM

I use that one all the time :)
Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

#60 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 01 June 2006 - 04:30 PM

; Round GUI Corners
; Author - gafrost

Test Script
#include <GuiConstants.au3> $my_gui = GuiCreate("MyGUI", 392, 323) _GuiRoundCorners($my_gui, 0, 0, 50, 50) GuiSetState() While 1     $msg = GuiGetMsg()     Select     Case $msg = $GUI_EVENT_CLOSE         ExitLoop     Case Else    ;;;     EndSelect WEnd Exit


Function to round the corners of a window:

Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)    Dim $pos, $ret, $ret2    $pos = WinGetPos($h_win)     $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long",  $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3,  "long", $i_y3)    If $ret[0] Then       $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)       If $ret2[0] Then          Return 1       Else          Return 0       EndIf    Else       Return 0    EndIf EndFunc ;==>_GuiRoundCorners


8)

Posted Image

Clic The Pic!!!





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users