Valuater Posted December 22, 2005 Share Posted December 22, 2005 (edited) Page 1 - 12/21/2005***************************************************************************** = Newest * = Newer Program SecurityProtect and get Paid30 Day TrialPassword EncryptorUUID GeneratorDecompile to Desktop Delete Running ProgramNotify and Name of any New Process StartedAllow only one WindowAdd User AccountsCheck File Date to Current DateStop Program from Running Twice Detect if System is Locked *Program AnimationsSkins for your GUIGUI Hole - Great! Animated Gif GUI Animate DisplaySet Mouse Cursor StyleRound GUI CornersMove A Maximized Window Detect Window Flashing in TaskBar *Custom GUI Cursor *ControlsGet ALL Controls InformationIcon on Button with Text (made easy)Picture Buttons ( great example )Moving a Control ( in script )Control Button by HotKey If Radio or Checkbox is Checked Control XP Style for ColorsGet Key State Pressed/Released Two Tray Menus - Right & Left Click *Controling Window/GUICenter Window/GUI on ScreenCenter - File Open/Save/Folder Dialog BoxGet Active Window (Title)(Text)Get Active Window - Executable PathChange Message Box button textMove Message BoxPlace InputBox OnTopRun Program in CMD.exe Window with Changed Title.Examples of using @ComspecWindow Active/Activate by Exe Get Window Handle by PID Move any Window - Click & Drag *Check if Mouse is over a GUI *UpDatesAuto-request user to updateLocate Autoit/Beta DirectoryGet the Latest BetaMiscellaneousFile size difference before (au3) and after (exe)... Re-Start your ProgramRun any au3 File from Your ProgramGet Wave Sound VolumeReduce Memory UsageVoice Read TextVoice Read Text & Save to wav file Create a "Quick Launch" ShortcutWindows - copy with progressFinding if an Application is Hung Terminate a Script Right before a User Shuts-DownRead the Last Line of a Text FileCreate a Temporary File NameOEM to ANSI & Reverse Open Help file to a desired pageCalculate the distance between 2 pointsCharactor Generator - chars (0-9, A-Z) Get Last Error Message * Strings and ArraysFind a String within a String or ArrayRegular Expressions to find something in an ArraySort Arrays based on TRUE Numerical Order, including DecimalsReturn Min or Max number from 1 or 2 ArraysCheck(when Exit), if Text is not equal Then, prompt the user to save or not save.Identify duplicate values in arraysUnique Array Filter Remove a Line from a File String Remove a Line Remove blank lines from a FileValidate String & Validate IP Address * Controling Screen/ViewToggle Internet Images On/OffDraw a line on any Screen/ProgramToggle Monitor On/OffSwith BGR to RGB ColorMouse repel - keep mouse away from an area Time ControlsUser/System Idle timeTime to Thousandths of a secondTime Machine #1 - Start (program) in Minutes/seconds/miliseconds Time Machine #2 - Start (program) in Hours & MinutesTime Machine #3 - Start (program) on Day & Hour12 Hour Time converterRun a timed program daily add your Favorites too!!8) Edited December 1, 2008 by Valuater leme9 1 Link to comment Share on other sites More sharing options...
Valuater Posted December 22, 2005 Author Share Posted December 22, 2005 (edited) expandcollapse popup;Get Wav Sound Volume ; Author gafrost #include <GUIConstants.au3> MsgBox(0,"", _SoundGetWaveVolume()) Func _SoundGetWaveVolume() Local $WaveVol = -1, $p, $ret Const $MMSYSERR_NOERROR = 0 $p = DllStructCreate ("dword") If @error Then SetError(2) Return -2 EndIf $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p)) If ($ret[0] == $MMSYSERR_NOERROR) Then $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100) Else SetError(1) EndIf $Struct=0 Return $WaveVol EndFunc;==>_SoundGetWaveVolume run("sndvol32.exe") WinWait("") ControlSend("Volume Control", "", "msctls_trackbar322", "{PGUP}") sleep(1000) ControlSend("Volume Control", "", "msctls_trackbar322", "{PGUP}") sleep(1000) ControlSend("Volume Control", "", "msctls_trackbar322", "{PGUP}") sleep(1000) ControlSend("Volume Control", "", "msctls_trackbar322", "{PGDN}") sleep(1000) ControlSend("Volume Control", "", "msctls_trackbar322", "{PGDN}") sleep(1000) ControlSend("Volume Control", "", "msctls_trackbar322", "{PGDN}") Global Const $TBM_GETPOS = $TWM_USER Func _GUICtrlSliderGetPos($h_slider) Local $ret $ret = DllCall("user32.dll", "int", "SendMessage", "hwnd", $h_slider, "int", $TBM_GETPOS, "int", 0, "int", 0) Return $ret[0] EndFunc;==>_GUICtrlSliderGetPos $ret = DllCall("user32.dll", "int", "SendMessage", "hwnd", $h_slider, "int", $TBM_GETPOS, "int", 0, "int", 0) 8) Edited December 22, 2005 by Valuater zbatev 1 Link to comment Share on other sites More sharing options...
DaLiMan Posted December 22, 2005 Share Posted December 22, 2005 Page 1 - 12/21/2005 **************************************************************************** ******************************************************************************* ;Animate Display *nice* addition ; Author ( under research ) *********************************************************************************** I thought it was Raindancer .... http://www.autoitscript.com/forum/index.ph...indpost&p=84102 Link to comment Share on other sites More sharing options...
Valuater Posted January 7, 2006 Author Share Posted January 7, 2006 ; Center Window on Screen ; Author cdkid and Valuater Func _Middle($win, $txt) $size = WinGetClientSize($win, $txt) Local $y = (@DesktopHeight / 2) - ($size[1] / 2) Local $x = (@DesktopWidth / 2) - ($size[0] / 2) Return WinMove($win, $txt, $x, $y) EndFunc ;==>_Middle Link to comment Share on other sites More sharing options...
Valuater Posted January 7, 2006 Author Share Posted January 7, 2006 (edited) expandcollapse popup; Center - File Open/Save/Folder Dialog Box ;Author - odklizec, MHz, Danny35d If StringInStr($cmdlineraw, '/MoveWin') Then $cmdlineraw = StringSplit(StringMid($cmdlineraw, StringInStr($cmdlineraw, '/MoveWin')), ':') While 1 Select Case WinExists($cmdlineraw[2]) $size=WinGetPos ($cmdlineraw[2]) $PosX=@DesktopWidth/2 - $size[2]/2 $PosY=@DesktopHeight/2 - $size[3]/2 WinMove($cmdlineraw[2], "", $PosX, $PosY) WinActivate($cmdlineraw[2]) ExitLoop EndSelect Sleep(50) WEnd Exit EndIf $PID = _FindBrowseWin('Open file Dialog Box') $Read_File = FileOpenDialog ( "Open file Dialog Box", @ScriptDir & "\", "AutoIt Files (*.au3)",3,@ScriptFullPath) ProcessClose($PID) $PID = _FindBrowseWin('Save file Dialog Box') $Save_File = FileSaveDialog( "Save file Dialog Box", @ScriptDir, "Scripts (*.aut;*.au3)", 3) ProcessClose($PID) $PID = _FindBrowseWin('Browse for Folder') FileSelectFolder("Choose a folder with plugins..", "","4","c:\") ProcessClose($PID) Func _FindBrowseWin($sTitle) If @Compiled Then Return(Run(@ScriptFullPath & ' /MoveWin:' & $sTitle)) Else Return(Run(@AutoItExe & ' "' & @ScriptFullPath & '" /MoveWin:' & $sTitle)) EndIf EndFunc SvenP posted a COM- based method here that happens to open up centered Important Note: Rename CreateObject to ObjCreate so that the code runs under the current beta version of AutoIt. Another ... expandcollapse popup; Author /dev/null $message = "Hold down Ctrl or Shift to choose multiple files." $filename = _MoveFileOpenDialog($message,300,300) $var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.bmp)", 1 + 4 ) If @error Then MsgBox(4096,"","No File(s) chosen") Else $var = StringReplace($var, "|", @CRLF) MsgBox(4096,"","You chose " & $var) EndIf FileDelete($filename) func _MoveFileOpenDialog($title,$posx,$posy) Local $temp = EnvGet("temp") Local $filename = $temp & "\move_file_open_dialog.au3" Local $script = 'Global $title = "' & $title & '"' & @CRLF $script &= 'Global $pos_x = ' & $posx & @CRLF $script &= 'Global $pos_y = ' & $posy & @CRLF $script &= 'AdlibEnable("_Move",10)' & @CRLF $script &= 'while 1' & @CRLF $script &= ' sleep(1000)' & @CRLF $script &= 'wend' & @CRLF $script &= 'Func _Move()' & @CRLF $script &= ' if (WinActive($title)) Then' & @CRLF $script &= ' WinMove($title,"",$pos_x,$pos_y)' & @CRLF $script &= ' Exit' & @CRLF $script &= ' EndIf' & @CRLF $script &= 'EndFunc' & @CRLF FileWrite($filename,$script) ;MsgBox(0,"",$script & @CRLF & $filename) Run(@AutoItExe & " /AutoIt3ExecuteScript " & $filename) sleep(250) Return $filename EndFunc 8) Edited June 20, 2007 by Valuater Link to comment Share on other sites More sharing options...
Valuater Posted January 8, 2006 Author Share Posted January 8, 2006 ; Reduce memory usage ; Author wOuter ( mostly ) Func _ReduceMemory($i_PID = -1) If $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf Return $ai_Return[0] EndFunc;==> _ReduceMemory() GeekDrop and yutijang 2 Link to comment Share on other sites More sharing options...
Valuater Posted January 12, 2006 Author Share Posted January 12, 2006 (edited) ; find a string within a string ; Author - This-is-me Func stringbetween($str, $start, $end) $pos = StringInStr($str, $start) If Not @error Then $str = StringTrimLeft($str, $pos + StringLen($start) - 1) $pos = StringInStr($str, $end) If Not @error Then $str = StringTrimRight($str, StringLen($str) - $pos + 1) Return $str EndIf EndIf EndFunc ************************************************************************* ; find a string in an array ; Aurhor - SmOke_N Func _ReturnStringArraySearch(ByRef $n_Array, $f_FindString) For $i = 1 To UBound($n_Array) - 1 If StringInStr($n_Array[$i], $f_FindString) Then Return $n_Array[$i] Next EndFunc 8) Edited January 12, 2006 by Valuater Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 12, 2006 Moderators Share Posted January 12, 2006 (edited) Val!!... StringBetween()... I would have never hand looked at google if I hadn't been asked to help with that very subject a while back until you posted that.This-Is-Me link: http://www.autoitscript.com/forum/index.ph...indpost&p=37172Link to where we did several different ways:http://www.autoitscript.com/forum/index.ph...718&mode=linearThe one I use (w0uter):http://www.autoitscript.com/forum/index.ph...ndpost&p=136319 Edited January 13, 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. Link to comment Share on other sites More sharing options...
Valuater Posted January 13, 2006 Author Share Posted January 13, 2006 (edited) ; voice read text ; Author erifash ( and others ) _TalkOBJ("Speak this line of text") Func _TalkOBJ($s_text) Local $o_speech $o_speech = ObjCreate("SAPI.SpVoice") $o_speech.Speak ($s_text) $o_speech = "" EndFunc ;==>_TalkOBJ 8) Edited January 13, 2006 by Valuater Link to comment Share on other sites More sharing options...
WhiteCrow Posted January 14, 2006 Share Posted January 14, 2006 (edited) I use this one quite often Use regular expressions in an array.; ; use regular exp[b][/b]ressions to find something in an array ; Author: WhiteCrow (but anyone couldve made it) ; Func _FindAny($start, $End, $s_array, $reg_exp[b][/b]ression) For $Pos = $start To $End $ip_regex=StringRegExp ( $s_array[$pos], $reg_exp[b][/b]ression, 1 ) if @error=0 then If @extended=1 Then Return $Pos EndIf endif Next Return -1 EndFuncThis just returns the position, i ussualy do something with $ip_regex to Edited January 14, 2006 by WhiteCrow Link to comment Share on other sites More sharing options...
Valuater Posted January 14, 2006 Author Share Posted January 14, 2006 ; Notify and Name of any new process started ; Author Valuater Dim $list = ProcessList() AdlibEnable("chk_Process") While 1 Sleep(20) WEnd Func chk_Process() $list2 = ProcessList() If $list2[0][0] > $list[0][0] Then MsgBox(262208,"New Process", $list2[$list2[0][0]][0] & " ") $list[0][0] = $list2[0][0] Else $list[0][0] = $list2[0][0] ; if you close processes - this resets the list EndIf EndFunc 8) Link to comment Share on other sites More sharing options...
Angelia Posted January 18, 2006 Share Posted January 18, 2006 ; Reduce memory usage ; Author wOuter ( mostly ) Func _ReduceMemory($i_PID = -1) If $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf Return $ai_Return[0] EndFunc;==> _ReduceMemory() dumb question... but how does this work??? Link to comment Share on other sites More sharing options...
Valuater Posted February 6, 2006 Author Share Posted February 6, 2006 (edited) ; Locate Autoit/Beta Directory ; Author - MHz MsgBox(0, 'AutoIt Directory returned', _DirAutoIt('Beta')) Func _DirAutoIt($version = 'Prod') Switch $version Case 'Prod' Switch True Case FileExists(@ProgramFilesDir & '\AutoIt3') Return @ProgramFilesDir & '\AutoIt3' Case RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir') Return RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir') EndSwitch Case 'Beta' Switch True Case FileExists(@ProgramFilesDir & '\AutoIt3\Beta') Return @ProgramFilesDir & '\AutoIt3\Beta' Case RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir') Return RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir') EndSwitch EndSwitch If $version = 'Prod' Then $version = 'Public Release' Return FileSelectFolder('Locate AutoIt Directory (' & $version & ' version)', @HomeDrive) EndFunc thx 8) Edited February 6, 2006 by Valuater Link to comment Share on other sites More sharing options...
Valuater Posted February 6, 2006 Author Share Posted February 6, 2006 ; Get the Latest Beta ; Author - Valuater #include <INet.au3> $NBeta = _INetGetSource('http://www.autoitscript.com/autoit3/files/beta/autoit/') For $x = 500 to 104 Step -1 If StringInStr( $NBeta, "autoit-v3.1.1."& $x & "-beta-Setup.exe") Then $NBeta = "autoit-v3.1.1."& $x & "-beta-Setup.exe" ExitLoop EndIf If $x <= 105 Then MsgBox(262208, "Beta Error", "No File Found. ", 5) Return EndIf Next MsgBox(0,'',$NBeta) ; use InetGet() 8) Link to comment Share on other sites More sharing options...
ning Posted February 6, 2006 Share Posted February 6, 2006 The Animate Display thing is an absolute stroke of genius! I presume the '1000' in each call is the time to take. Thanks a lot - that's going in my slideshow program.ben Link to comment Share on other sites More sharing options...
leecole Posted February 6, 2006 Share Posted February 6, 2006 ; voice read text ; Author erifash ( and others ) _TalkOBJ("Speak this line of text") Func _TalkOBJ($s_text) Local $o_speech $o_speech = ObjCreate("SAPI.SpVoice") $o_speech.Speak ($s_text) $o_speech = "" EndFunc;==>_TalkOBJ 8)I use _Talkobj() in a lot of apps, that often attempt to speak at the same time, and I have had to use the following to avoid an AutoIt error: Checking @error or for $o_speech=0 did not work, but this does. Do Sleep(100) Local $o_speech = ObjCreate ("SAPI.SpVoice") Until IsObj ($o_speech) Talking Clockhttp://www.autoitscript.com/forum/index.php?showtopic=20751Talking Headlineshttp://www.autoitscript.com/forum/index.php?showtopic=20655Sometimes, I sits and thinkssometimes, I just sits Link to comment Share on other sites More sharing options...
w0uter Posted February 6, 2006 Share Posted February 6, 2006 Never use IsObj to check for sucessfull creation. Its in the helpfile! My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
theguy0000 Posted February 6, 2006 Share Posted February 6, 2006 (edited) I use this one quite often Use regular expressions in an array. ; ; use regular exp[b][/b]ressions to find something in an array ; Author: WhiteCrow (but anyone couldve made it) ; Func _FindAny($start, $End, $s_array, $reg_exp[b][/b]ression) For $Pos = $start To $End $ip_regex=StringRegExp ( $s_array[$pos], $reg_exp[b][/b]ression, 1 ) if @error=0 then If @extended=1 Then Return $Pos EndIf endif Next Return -1 EndFunc This just returns the position, i ussualy do something with $ip_regex to now, that was useful. I managed to make an _ArraySearchWithWildcards with it edit: ok, _ArraySearchWithWildcrads didnt work... Edited February 7, 2006 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Valuater Posted February 17, 2006 Author Share Posted February 17, 2006 (edited) ; ArraySortNum(ByRef $nArray, $Ascending = 0, $Start = 1) ; Sorts arrays based on TRUE Numerical Order, including Decimals : Author - SmOke_N #include <Array.au3> ; Example sort Array created with StringSplit. $avArray = StringSplit("6,8,10,4,2,13,12,129,106.1,106.4",",") ArraySortNum($avArray, 1) _ArrayDisplay( $avArray, "Sorted Desc starting at 1" ) Func ArraySortNum(ByRef $nArray, $Ascending = 0, $Start = 1) For $i = $Start To UBound($nArray) - 2 Local $SE = $i If $Ascending = 0 Then For $x = $i To UBound($nArray) - 1 If Number($nArray[$SE]) < Number($nArray[$x]) Then $SE = $x Next Else For $x = $i To UBound($nArray) - 1 If Number($nArray[$SE]) > Number($nArray[$x]) Then $SE = $x Next EndIf Local $HLD = $nArray[$i] $nArray[$i] = $nArray[$SE] $nArray[$SE] = $HLD Next EndFunc thanks... SmOke OR................. ; Author JdeB #include <Array.au3> $result = StringSplit(".125,555,011,6,72,-333", ",") For $x = 1 To UBound($result) -1 $result[$x] = Number($result[$x]) Next _ArraySort($result, 1, 1) _ArrayDisplay($result,"list") Thanks... JdeB 8) Edited April 14, 2006 by Valuater Link to comment Share on other sites More sharing options...
Valuater Posted February 24, 2006 Author Share Posted February 24, 2006 ; create a "Quick Launch" Shortcut ; Author CyberSlug ; Tested on Windows XP $userQuickLaunchPath = @AppDataDir & "\Microsoft\Internet Explorer\Quick Launch" $globalQuickLaunchPath = @AppDataCommonDir & "\Microsoft\Internet Explorer\Quick Launch" $shortcutTarget = @WindowsDir & "\notepad.exe";pick whatever you want FileCreateshortcut($shortcutTarget, $userQuickLaunchPath & "\Notepad.lnk") 8) Link to comment Share on other sites More sharing options...
Recommended Posts