Leaderboard
Popular Content
Showing content with the highest reputation on 07/31/2015 in all areas
-
2nd attempt : #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <Array.au3> Global $prompt = "#Type a command :> " Global $sel, $oldsel, $readonly, $iMinPos, $iStyle Global $iFontSize = 12, $sFontName = "OCR A Extended", $iFontcolor = 0x00FF00 Global $Form = GUICreate("Console", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $DS_SETFOREGROUND)) GUISetBkColor(0x000000) Global $Console = GUICtrlCreateEdit('Loading...', 32, 32, @DesktopWidth-15, @DesktopHeight - 64, $ES_AUTOVSCROLL, 0) GUICtrlSetStyle($Console, $ES_READONLY) GUICtrlSetFont(-1, $iFontSize, 400, 0, $sFontName) GUICtrlSetColor(-1, $iFontcolor) GUICtrlSetBkColor(-1, 0) GUICtrlSetCursor (-1, 2) _GUICtrlEdit_SetMargins( -1, $EC_RIGHTMARGIN, Default, 49) Global $dummyEnter = GUICtrlCreateDummy() Global $dummyTab = GUICtrlCreateDummy() Global $dummyBS = GUICtrlCreateDummy() Global $dummyPreviousFunc = GUICtrlCreateDummy() Global $dummyNextFunc = GUICtrlCreateDummy() Global $dummyEsc = GUICtrlCreateDummy() Global $dummyCtrlD = GUICtrlCreateDummy() Global $dummyCtrlC = GUICtrlCreateDummy() Global $aHistory[1], $iIndexFunc = 1 Global $aFunctions = [ ["__clear", "clear,cls"], _ ["__quit", "quit,exit,close"], _ ["__help", "help"] ] _ArraySort($aFunctions) Global $aKeys = [ ["{ENTER}", $dummyEnter], _ ["{TAB}", $dummyTab], _ ["{BACKSPACE}", $dummyBS], _ ["{UP}", $dummyPreviousFunc], _ ["{DOWN}", $dummyNextFunc], _ ["{ESC}", $dummyEsc ], _ ["^d", $dummyCtrlD], _ ["^q", $dummyCtrlD], _ ["^c", $dummyCtrlC] ] GUISetAccelerators($aKeys) GUISetState(@SW_SHOW) Sleep(1000) _Enter() $iStyle = _WinAPI_GetWindowLong(GUICtrlGetHandle($Console), $GWL_STYLE) GUICtrlSetStyle($Console, BitXOR($iStyle, $ES_READONLY)) While True $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE, $dummyCtrlD __Quit() Case $dummyEnter _Enter() Case $dummyBS _BackSpace() Case $dummyPreviousFunc _PreviousFunc() Case $dummyNextFunc _NextFunc() Case $dummyEsc _Esc() Case $dummyCtrlC _CtrlC() EndSwitch $sel = _GUICtrlEdit_GetSel($Console) If $sel <> $oldsel Then $oldsel = $sel If $sel[0] < $iMinPos Or $sel[1] < $iMinPos Then If NOT $readonly Then GUICtrlSetStyle($Console, $ES_READONLY) $readonly = 1 EndIf Else If $readonly Then $readonly = 0 $iStyle = _WinAPI_GetWindowLong(GUICtrlGetHandle($Console), $GWL_STYLE) GUICtrlSetStyle($Console, BitXOR($iStyle, $ES_READONLY)) EndIf EndIf EndIf WEnd Func _CtrlC() _GUICtrlEdit_AppendText($Console, @CRLF & $prompt) $iMinPos = StringLen(GUICtrlRead($Console) ) EndFunc Func _Esc() Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0] _GUICtrlEdit_SetSel($Console, StringLen(GUICtrlRead($Console)), StringLen(GUICtrlRead($Console)) - StringLen($sCommand) ) _GUICtrlEdit_ReplaceSel($Console, "") EndFunc Func _PreviousFunc() If $iIndexFunc = 1 Then Return $iIndexFunc -= 1 Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0] _GUICtrlEdit_SetSel($Console, StringLen(GUICtrlRead($Console)), StringLen(GUICtrlRead($Console)) - StringLen($sCommand) ) _GUICtrlEdit_ReplaceSel($Console, $aHistory[$iIndexFunc]) EndFunc Func _NextFunc() If $iIndexFunc = UBound($aHistory) - 1 Then Return $iIndexFunc += 1 Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0] _GUICtrlEdit_SetSel($Console, StringLen(GUICtrlRead($Console)), StringLen(GUICtrlRead($Console)) - StringLen($sCommand) ) _GUICtrlEdit_ReplaceSel($Console, $aHistory[$iIndexFunc]) EndFunc Func _BackSpace() Local $aSel = _GUICtrlEdit_GetSel($Console) If $aSel[0] = $aSel[1] Then If $aSel[0] > $iMinPos Then _GUICtrlEdit_SetSel($Console, $aSel[0] - 1, $aSel[0]) _GUICtrlEdit_ReplaceSel($Console, "") EndIf Else _GUICtrlEdit_ReplaceSel($Console, "") EndIf EndFunc Func _Enter() Local $iFound = 0 Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0] If NOT StringRegExp($sCommand, "^\v*$") Then Redim $aHistory[ UBound($aHistory) + 1] $aHistory[ UBound($aHistory) - 1] = $sCommand $iIndexFunc = UBound($aHistory) EndIf For $i = 0 To UBound($aFunctions) - 1 If StringRegExp($sCommand, "^\h*$") Then $iFound = 1 ExitLoop Else If StringRegExp($aFunctions[$i][1], "(?:^|,)" & $sCommand & "(?:,|$)") Then $iFound = 1 GUICtrlSetStyle($Console, $ES_READONLY) Call($aFunctions[$i][0]) $iStyle = _WinAPI_GetWindowLong(GUICtrlGetHandle($Console), $GWL_STYLE) GUICtrlSetStyle($Console, BitXOR($iStyle, $ES_READONLY)) ExitLoop EndIf EndIf Next If NOT $iFound Then _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & $sCommand & " : command not found. Type ""help"" to list the available commands." & @CRLF) _GUICtrlEdit_AppendText($Console, @CRLF & $prompt) $iMinPos = StringLen(GUICtrlRead($Console) ) EndFunc Func __help() Local $command Local $sAlias _GUICtrlEdit_AppendText($Console, @CRLF & "List of available commands : " & @CRLF) For $i = 0 To UBound($aFunctions) - 1 $command = StringRegExpReplace($aFunctions[$i][1], ",\V+", "") $alias = StringRegExpReplace($aFunctions[$i][1], "^.+?,", "") If @extended Then $sAlias = " (alias " & StringReplace($alias, ",", "/") & ")" Else $sAlias = "" EndIf _GUICtrlEdit_AppendText($Console, " " & $command & $sAlias & @CRLF) Next EndFunc Func __clear() GUICtrlSetData($Console, "") EndFunc Func __quit() GUICtrlSetState($Console, $GUI_DISABLE) _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & "Goodbye..." & @CRLF) Sleep(1000) Exit EndFunc3 points
-
Hi there! I'm looking for some team members for a bigger software project, namely Perseus ( https://github.com/Perseus-Dev/Perseus-6 ). Your profile: You have fun programming,you are proficient in AutoIt and you have touched VB.NET (or VBS) at some point,you are interested in compiler development and the inner workings of programming languages, but you don't want to start from scratch,you can spare some time for this,you have crazy, yet somewhat useful ideas.Short history of this project: 2013: Project started as a primitive AssemblerAssembler development was completed, published as "ActiveX Light Assembler" (can be found in my threads here)Plan to evolve Assembler into primitive programming language2014: First version of Perseus ("Unknown Universe") was released, basically a self-compiler. Used FASM as the Assembler.Following community input, the second version was released ("Caffeinated Cat")2015: Development of Perseus 5 began (working title is "Perseus++"), built on a framework called DirectByte, Assembler no longer needed.First version of Perseus++ released, very Pascal-like syntax, many bugsMid 2015: Perseus 6 Development started, first beta version of Perseus 6 was released, first version to be completely open-source.Perseus 6 syntax cleanup, heavy changes to the syntax, now more C-like, but much easier, added a bunch of featuresThe next steps in development: Port the whole Perseus source code to AutoIt, eliminate VB.NET (the current main language)Redo the syntax debuggerPublish final version of Perseus 6 More information about the language in its very long README on the project page (link above). If you are interested send me a PM, if you have any questions, leave them here.2 points
-
I found the idea funny... First attempt : #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Global $prompt = "#Type a command:> " Global $sel, $oldsel, $readonly, $iMinPos, $iStyle Global $Form = GUICreate("Console", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $DS_SETFOREGROUND), $WS_EX_TOPMOST) GUISetBkColor(0x000000) Global $Console = GUICtrlCreateEdit('Loading...', 32, 32, @DesktopWidth-15, @DesktopHeight - 64, $ES_AUTOVSCROLL, 0) GUICtrlSetFont(-1, 12, 400, 0, 'OCR A Extended') GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0) GUICtrlSetCursor (-1, 2) _GUICtrlEdit_SetMargins( -1, $EC_RIGHTMARGIN, Default, 49) Global $dummy = GUICtrlCreateDummy() Global $aKeys[1][2] = [["{ENTER}", $dummy]] GUISetAccelerators($aKeys) GUISetState(@SW_SHOW) Sleep(1000) _Enter() While True $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Quit() Case $dummy _Enter() EndSwitch $sel = _GUICtrlEdit_GetSel($Console) If $sel <> $oldsel Then $oldsel = $sel If $sel[0] < $iMinPos Or $sel[1] < $iMinPos Then If NOT $readonly Then GUICtrlSetStyle($Console, $ES_READONLY) $readonly = 1 EndIf Else If $readonly Then $readonly = 0 $iStyle = _WinAPI_GetWindowLong(GUICtrlGetHandle($Console), $GWL_STYLE) GUICtrlSetStyle($Console, BitXOR($iStyle, $ES_READONLY)) EndIf EndIf EndIf WEnd Func Quit() _GUICtrlEdit_AppendText($Console, @CRLF&@TAB&'Goodbye...') Sleep(1500) Exit EndFunc Func _Enter() Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0] Switch $sCommand Case "clear" GUICtrlSetData($Console, "") Case "quit", "exit" Quit() Case "" Beep(1000,50) Case Else _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & $sCommand & " : command not found") EndSwitch _GUICtrlEdit_AppendText($Console, @CRLF & $prompt) $iMinPos = StringLen(GUICtrlRead($Console) ) EndFunc2 points
-
; ;################################## ; Include ;################################## #include <file.au3> ;################################## ; Variables ;################################## $SmtpServer = "MailServer" ; address for the smtp-server to use - REQUIRED $FromName = "Name" ; name from who the email was sent $FromAddress = "your@Email.Address.com" ; address from where the mail should come $ToAddress = "your@Email.Address.com" ; destination address of the email - REQUIRED $Subject = "Userinfo" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail ; example html body with inline images. file can be quoted or unquoted, ; but the format ##image#your-filename.jpg## is fixed: ;$as_Body = "<body>E-mail with 2 images inline:<br>" & _ ; "first image: ##image#'C:\path-to-Picture\image1.png'##" & _ ; "second image: ##image#C:\path-to-Picture\image1.png##" & _ ; "<br></body>" ; $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "CCadress1@test.com" ; address for cc - leave blank if not needed $BccAddress = "BCCadress1@test.com" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "******" ; username for the account used from where the mail gets sent - REQUIRED $Password = "********" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 25 ; port used for sending the mail $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS $tls = 0 ; enables/disables TLS when required ;~ $SmtpServer = "smtp.gmail.com" ; GMAIL address for the smtp-server to use - REQUIRED ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAIL enables/disables secure socket layer sending - put to 1 if using httpS ;~ $SmtpServer = "smtp.office365.com" ; O365 address for the smtp-server to use - REQUIRED ;~ $IPPort=25 ; O365 port used for sending the mail ;~ $ssl=1 ; O365 enables/disables secure socket layer sending - put to 1 if using httpS ;~ SmtpServer = "smtp.mail.yahoo.com" ; Yahoo address for the smtp-server to use - REQUIRED ;~ $IPPort = 465 ; Yahoo port used for sending the mail ;~ $ssl = 1 ; Yahoo enables/disables secure socket layer sending - put to 1 if using httpS ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl, $tls) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf ; ; The UDF Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0, $tls = 0) Local $objEmail = ObjCreate("CDO.Message") ; convert the Fromname to UTF-8 basex64 to allow for UTF characters in the name If $s_FromName <> "" Then $s_FromName = "=?utf-8?B?" & _Base64Encode(BinaryToString(StringToBinary($s_FromName, 4), 1)) & '?=' $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then ; add embedded images when defined Local $aImages = 0, $iImgCnt = 0 $aImages = StringRegExp($as_Body, "##image#['""]?([^#'""]*)['""]?##", $STR_REGEXPARRAYGLOBALMATCH) $iImgCnt += 1 For $i = 0 To UBound($aImages) - 1 $iImgCnt += 1 $fileext = StringRegExpReplace($aImages[$i], ".*(\.+.*)", "$1") $as_Body = StringRegExpReplace($as_Body, "(##image#['""]?([^#'""]*)['""]?##)", "<img src=" & $iImgCnt & $fileext & ">", 1) $objBP = $objEmail.AddRelatedBodyPart($aImages[$i], $iImgCnt & $fileext, 1) $objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<" & $iImgCnt & $fileext & ">" $objBP.Fields.Update ConsoleWrite('+> Image placed inline: ' & $aImages[$i] & @LF) Next $objEmail.HTMLBody = $as_Body $objEmail.HTMLBodyPart.CharSet = "UTF-8" Else $objEmail.Textbody = $as_Body & @CRLF $objEmail.TextBodyPart.CharSet = "UTF-8" EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 Then $IPPort = 25 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf ; Set security params If $ssl Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True If $tls Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendtls") = True ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf $objEmail="" EndFunc ;==>_INetSmtpMailCom ; ; ; Com Error Handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1); something to check for when this function returns Return EndFunc ;==>MyErrFunc ; Base64 UDF made by Trancexx https://www.autoitscript.com/forum/topic/84133-winhttp-functions/?do=findComment&comment=1260746 Func _Base64Encode($vInput) Local Const $CRYPT_STRING_BASE64 = 0x00000001 Local Const $CRYPT_STRING_NOCRLF = 0x40000000 $vInput = Binary($vInput) Local $tInput = DllStructCreate("byte[" & BinaryLen($vInput) & "]") DllStructSetData($tInput, 1, $vInput) Local $aCall = DllCall("Crypt32.dll", "bool", "CryptBinaryToStringA", _ "struct*", $tInput, _ "dword", DllStructGetSize($tInput), _ "dword", $CRYPT_STRING_BASE64 + $CRYPT_STRING_NOCRLF , _ "ptr", 0, _ "dword*", 0) If @error Or Not $aCall[0] Then Return SetError(1, 0, "") ; error calculating the length of the needed buffer Local $tOut = DllStructCreate("char[" & $aCall[5] & "]") $aCall = DllCall("Crypt32.dll", "int", "CryptBinaryToStringA", _ "struct*", $tInput, _ "dword", DllStructGetSize($tInput), _ "dword", $CRYPT_STRING_BASE64 + $CRYPT_STRING_NOCRLF, _ "struct*", $tOut, _ "dword*", DllStructGetSize($tOut)) If @error Or Not $aCall[0] Then Return SetError(2, 0, ""); error encoding Return DllStructGetData($tOut, 1) EndFunc Edit: Fixed Bcc ... Edit: Added support for different port and SLL which are used by GMail (Port 465) Edit: Added Importance support (10/2008) Edit: Added $TLS option (07/2020) Edit: Added inline Images option in an HTML body (12/2024) Some interesting Info from the thread:1 point
-
No it doesn't speak, I lied. That is impossible. It's about setting animated GIF (and every other type of images) to a GUI control. How is this done for animated GIF? Few simple steps: - created ImageList of GIF Bitmaps retrieved from gif file/resource - created Pic control - every now and then another image is displayed. This is determined by frame delay time - see gif specification somewhere. That's it. All that takes time and could potentially block our gui/script. That's why flying assembly is used. Animation is done in another thread different from one AutoIt's code is executed in. Nothing stops animation but you. Animation works both for x64 and x86. Also it works for all kind of images not only GIFs. That means you can use it to display PNGs, BMPs, JPGs, etc... All of them from resources too. Example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GIFAnimation.au3" Opt("MustDeclareVars", 1) ; Start by choosing GIF to display Global $sFile = FileOpenDialog("Choose Image", "", "(*.gif;*.png;*.jpg;*.tiff;*.bmp;*.jpeg)", -1, "") If @error Then Exit ; Make GUI Global $hGui = GUICreate("GIF Animation", 500, 500, -1, -1, $WS_OVERLAPPEDWINDOW) ; Add some buttons Global $hButton = GUICtrlCreateButton("&Pause animation", 50, 450, 100, 25) Global $hButton1 = GUICtrlCreateButton("&Delete Control", 200, 450, 100, 25) Global $hButton2 = GUICtrlCreateButton("&Open Image", 350, 450, 100, 25) ; Make GIF Control Global $hGIF = _GUICtrlCreateGIF($sFile, "", 10, 10) If @extended Then GUICtrlSetState($hButton, $GUI_DISABLE) GUICtrlSetTip($hGIF, "Image") ; Additional processing of some windows messages (for example) GUIRegisterMsg(133, "_Refresh") ; WM_NCPAINT GUIRegisterMsg(15, "_ValidateGIFs") ; WM_PAINT Global $iPlay = 1 ; Show it GUISetState() ; Loop till end While 1 Switch GUIGetMsg() Case -3 Exit Case $hButton If $iPlay Then If _GIF_PauseAnimation($hGIF) Then $iPlay = 0 GUICtrlSetData($hButton, "Resume animation") EndIf Else If _GIF_ResumeAnimation($hGIF) Then $iPlay = 1 GUICtrlSetData($hButton, "Pause animation") EndIf EndIf Case $hButton1 _GIF_DeleteGIF($hGIF) Case $hButton2 $sFile = FileOpenDialog("Choose gif", "", "(*.gif;*.png;*.jpg;*.tiff;*.bmp;*.jpeg)", -1, "", $hGui) If Not @error Then _GIF_DeleteGIF($hGIF); delete previous $hGIF = _GUICtrlCreateGIF($sFile, "", 10, 10) If @extended Then GUICtrlSetState($hButton, $GUI_DISABLE) Else GUICtrlSetState($hButton, $GUI_ENABLE) EndIf GUICtrlSetTip($hGIF, "Image") $iPlay = 1 GUICtrlSetData($hButton, "Pause animation") EndIf EndSwitch WEnd Func _Refresh($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GIF_RefreshGIF($hGIF) EndFunc ;==>_Refresh Func _ValidateGIFs($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GIF_ValidateGIF($hGIF) EndFunc ;==>_ValidateGIFs It should be 0% cpu. Download from here if you want to impress chicks: http://code.google.com/p/gif-animation/downloads/list There are 8 examples in there. GIF files are downloaded automatically if some example script needs it. Mostly from photobucket.com. Some examples work without classic download. Required data is get with InetRead(). That's mighty cool. So, download, open ZIP, grab folder inside and place it where you want. Run examples and that's it. Word or two about main function, _GUICtrlCreateGIF(). It can handle all sorts of input. Will display Images that are passed as binary, resource identifiers, strings, file names, ... everything. If it's valid image all works. For example, all this is valid: ; Pass GIF File path/name _GUICtrlCreateGIF("Some.gif", "", 10, 10) ; Binary data _GUICtrlCreateGIF($bGIF, "", 10, 10,) ; PE Resource (file GIF.dll, Type: GIF, Name: 4) _GUICtrlCreateGIF("GIF.dll", "GIF;4", 10, 10, 100, 120) ; PE Resource (file @AutoItExe, Type: RES, Name: BLAH, Language: 1033) _GUICtrlCreateGIF(@AutoItExe, "RES;BLAH;1033", 10, 10) ; PE Resource (file "explorer.exe", Type: 2, Name: 6801) _GUICtrlCreateGIF("explorer.exe", "2;6801", 10, 10) ;<- BITMAP ; PE Resource (file @AutoItExe, Type: RC_DATA, Name: PNG) _GUICtrlCreateGIF(@AutoItExe, "10;PNG", 10, 10) ; GIF string _GUICtrlCreateGIF(FileRead("Some.gif"), "", 10, 10) ____________________________________________1 point
-
BASS Function Library This library is a wrapper for the powerful Bass.DLL and add-ons (which increase the functionality of Bass.DLL). Bass.DLL is ideal for use in your applications and scripts if you want an easy way to play a vast range of music and sound files formats while keeping dependency on just Bass.dll and it's add-ons (which in turn maximizes compatibility and minimizes extra requirements for your software to run.), while retaining a small file size. The UDFs included with the release are: Bass The basic Bass library. Required with all (most) add-on libraries. Provides playback of many sound files (and streams). BassASIO (By eukalyptus) BASSASIO is basically a wrapper for ASIO drivers, with the addition of channel joining, format conversion and resampling. BassCD Allows for digital streaming and ripping of audio CDs along with analog playback support. BassFX (By eukalyptus/BrettF) An extension providing several effects, including tempo & pitch control. BassEnc (By eukalyptus) An extension that allows BASS channels to be encoded using any command-line encoder with STDIN support (LAME/OGGENC/etc), or any ACM codec. Also features Shoutcast and Icecast stream sourcing, and PCM/WAV file writing. BassSFX Provides a complete set of functions to include support for winamp, sonique, bassbox, and Windows Media Player visualization plugins. BassTags Provides a simple way to retrieve ID3 tags from stream handles. BassCB/Bass_EXT (ProgAndy) This is for advanced users. BassCB allows the playback of streams in AutoIt. BassVST Allows use of VST effect plugins. Download The download includes all of the wrapper and constants, the original download, examples for all of the previously mentioned add-ons, sample audio files (6 channel audio files also included), sample visualization plugins for BassSFx and more. Current Version: 9 Size: 7360KB AutoIt Version Required: 3.3.2.0 Changelog: /> Fixed _BassRecordGetInputName (updated production versions) +> Added Memory Examples of Bass (Thanks ProgAndy and UEZ) +> Added BassVST (Not 100% complete) +> Added BassFX Examples showing use of most functions: Pitch.au3 Reverse.au3 Tempo.au3 /> Fixed error with calling _BASS_ErrorGetCode in BASSCD.au3 /> Fixed startup functions return the wrong value (Thanks ProgAndy!) +> Added helper functions _BASS_ChannelSetVolume, _BASS_ChannelGetVolume (Thanks ProgAndy) Download Link: https://www.autoitscript.com/forum/files/file/493-basszip/ Previous versions are not supported. Patches: Patch 1 "BASS_ASIO" Fixes issues with BASS ASIO and examples. Patch 2 "BASS_FX/BASS" Fixes issues with BASS FX and BASS.1 point
-
Edit: Detect key before updating content?
jvds reacted to TheAutomator for a topic
Hi everyone , i'm trying to make some sort of full screen console window where some of the text must be non-editable like windows CMD.exe. Text already typed before pressing enter or the working folder 'C:\...>' is read only in CMD.exe and I want to know if mimicking this behavior in an edit control is possible. My attempt to make a console makes all the [A-Za-z0-9] keys a hotkey and the main edit control is set to read only. Every time the user types something the hotkey function is triggered, the cursor in the edit control is set to the end of the text and the character you typed is added to the edit. If you try to press the {backspace} key when you are at the edge of some text that is read only nothing happens. This works but I guess it is not the best or most clean way to make something like this.. Can someone give me some advice or help me make a better function for having full control over text in the edit control? kind regards, TheAutomator #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form = GUICreate("Console", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $DS_SETFOREGROUND), $WS_EX_TOPMOST) GUISetBkColor(0x000000) $Console = GUICtrlCreateEdit('Loading...', 32, 32, @DesktopWidth-15, @DesktopHeight - 64, BitOR($ES_READONLY,$WS_VSCROLL), 0) GUICtrlSetFont(-1, 28, 400, 0, 'OCR A Extended') GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetCursor (-1, 2) _GUICtrlEdit_SetMargins( -1, $EC_RIGHTMARGIN, Default, 49) GUISetState(@SW_SHOW) ;################################################################################################################## Global $keys = 'abcdefghijklmnopqrstuvwxyz _ABCDEFGHIJKLMNOPQRSTUVWXYZ' ;################################################################################################################## For $_ = 1 To StringLen($keys) HotKeySet( StringMid($keys,$_,1), 'keypress') Next For $_ = 0 To 9 HotKeySet($_, 'keypress') HotKeySet('{numpad'&$_&'}', 'keypress') Next HotKeySet('{bs}','Keypress') HotKeySet('{enter}','Enter') _GUICtrlEdit_AppendText($Console, @CRLF&'Type a command:') $MIN = StringLen(GUICtrlRead($Console)) + 1 $MAX = $MIN ;################################################################################################################## Func Keypress() Local $key = @HotKeyPressed If StringLen($key) = 1 Then _GUICtrlEdit_AppendText($Console, $key) $MAX += 1 ElseIf StringRegExp($key,'\{numpad[0-9]\}') Then _GUICtrlEdit_AppendText($Console, StringMid($key,8,1)) $MAX += 1 ElseIf $key = '{bs}' Then If $max = $min then Return Else Local $len = StringLen(GUICtrlRead($Console)) _GUICtrlEdit_SetSel($Console, $len - 1, $len) _GUICtrlEdit_ReplaceSel($Console, '') $MAX -= 1 EndIf EndIf EndFunc Func Enter();handle typed commands when ENTER is pressed: Switch StringStripWS(StringLower(StringMid(GUICtrlRead($Console),$min,$max)),8) Case '' Beep(1000,50) Case 'clear' GUICtrlSetData($Console,'Command:') $MIN = StringLen(GUICtrlRead($Console)) + 1 $MAX = $MIN Return Case 'quit' Quit() Case Else _GUICtrlEdit_AppendText($Console, @CRLF&@TAB&'Unknown command!') EndSwitch _GUICtrlEdit_AppendText($Console, @CRLF&'Type a command:') $MIN = StringLen(GUICtrlRead($Console)) + 1 $MAX = $MIN EndFunc ;============================================================= Func Quit() _GUICtrlEdit_AppendText($Console, @CRLF&@TAB&'Goodbye...') Sleep(1500) Exit EndFunc While True If GUIGetMsg() = $GUI_EVENT_CLOSE Then Quit() EndIf WEnd1 point -
Right clicking the windows "start" button brings up some quick access stuff, including old style cpanel, for me.1 point
-
Windows Update Delivery Optimisation (WUDO)
jvanegmond reacted to Jon for a topic
This new feature basically uses your machine to upload patches to other people on your LAN to save bandwidth and increase download speed in a torrent-like way. Great idea. Except by default it's set to also allow you to share updates with the internet. You go into Windows Update -> Advanced Settings to set it to LAN-only1 point -
AutoIT and MSAA
automaterk reacted to junkew for a topic
As inspect.exe gives you the result / value you are looking for you do not have to go to a java solution. But I do not have an out of the box solution as I expected that the simplespy should give the same result as inspect.exe option 1 fix simple spy or based on the standard code as given by simplespy get your information with the treewalker (see examples1-3)option 2 more difficult but I assume 1 can work although if you see the data in inspect.exe with MSAA option turned on than this is the way to go If you read the thread from start to end you have all the pieces of IUIAutomation, IAccessible, IAccessible2, ISimpledomand in that there will be a name value with the right content. This is the area where LarsJ provided the IAccessible ... stuff (they are also in the zip of the first post) https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/?do=findComment&comment=11563731 point -
Or do this : add Global $wait = xxx replace Sleep(###) with Sleep($wait) and under that add $wait = xxx this makes sure $wait is once again the number it should be next time you press $button1 add under Case $button2 If $wait >= 1 Then $wait = 0 EndIf That should make $button2 only stop the sleep timer. XXX = the amount of time you want sleep to execute ### = the sleep(time) which you want to be able to stop1 point
-
Use TimerInit and TimerDiff instead. Saludos1 point
-
Windows 10 release 29th of July
jvanegmond reacted to trancexx for a topic
I asked Cortana if I could call her differently, and she said "No". Then I asked the same question again and she said "I like being called Cortana". Then I asked the same question again and she said something that really made me laugh. Then I said "ok but then you have to sing a song to me", and she did. Beautiful.1 point -
29-7-2015:New SciTE4AutoIt3 available with the updated SciTE v3.5.4 release.
jaberwacky reacted to Jos for a topic
This is an issue in the Error Lexer which I will fix for the next release. Jos1 point -
I would have made that @ComSpec in stead of cmd. Jos1 point
-
TEXT BOX IN AUTOIT
JLogan3o13 reacted to kylomas for a topic
@‌xxaviarxx - Nice example and kudos for trying to help. Now consider the following: 1 - The op is new and nothing in the post hints at a level of expertise so rudimentary is where we start. 2 - The general bent of this forum is to teach. That involves digging on the part of the thread author. 3 - We have no previous experience with this person so we do not know if he is looking for handouts or a serious programmer/hobbyist. Lastly, the example in the Help file is exactly what this op is asking for. kylomas edit: This is offered as advice, no need to start a pissing contest.1 point -
Moving the cursor etc. is Word COM stuff. So it should be possible to convert it to VB. What you need to change is the AutoIt stuff to VB.1 point
-
Windows 10 release 29th of July
jvanegmond reacted to UEZ for a topic
I updated yesterday from Win 8.1 Pro to Win 10 Pro without any problem. It took approx. 1.5h but I didn't test it in detail yet (was 01:00 am when finished). Seems pretty cool for now. FYI, just download the Windows 10 Media Creation Tool to upgrade immediately. E.g. from here: http://www.chip.de/downloads/Windows-10-64-Bit_72189999.html1 point -
You could simply translate it to VB.1 point
-
@Danyfirex , I have found it in MSDN. it is very nice to use dictionary in autoit. @JLogan3o13 , Thank you for the link. @boththose , Thank you .1 point
-
Windows 10 release 29th of July
jvanegmond reacted to BrewManNH for a topic
I found out that the error message I listed above isn't really an error message. It happens because Microsoft wants to roll out W10 in waves so that the servers don't implode. This error message is just Windows Update's way of saying that it isn't my turn to upgrade yet. There is a registry setting that can be done that will kick off the upgrade anyways though. In regedit, go to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" create a REG_DWORD (32) key in there called AllowOSUpgrade and set its value to 1 and then rerun Windows Update and it should allow you to do the upgrade.1 point -
That array sort above is correct - even though it's from a file. The array count,10, is in the first element, put there by the _FileReadToArray function. The 4 digit numbers at the bottom are treated as strings. And are at the bottom because :- 3520 is less than 365 alphabetically sorted, 1244 is less than 3520 alphabetically sorted, and, 1242 is less than 1244 alphabetically sorted. Here is an example of sorting an array numerically. #include <Array.au3> #include <File.au3> Local $sort, $Temp, $Loop = 1 Local $Dec = 0 ; $Dec = 1 sort descending; $Dec = 0 sort ascending _FileReadToArray("list.txt", $sort) ; $FRTA_COUNT (1) - array count in the first element. (default) _ArrayDisplay($sort) While $Loop ; Keep looping until If statement is missed. $Loop = 0 For $i = 2 To UBound($sort) - 1 If (Number($sort[$i]) > Number($sort[$i - 1]) And $Dec = 1) Or _ ; Sort Descending (Number($sort[$i]) < Number($sort[$i - 1]) And $Dec = 0) Then ; Sort Ascending ; ---- Swap $sort[$i] with $sort[$i - 1] ---- $Temp = $sort[$i] $sort[$i] = $sort[$i - 1] $sort[$i - 1] = $Temp ; ------------------------------------------- $Loop = 1 ; Keep looping EndIf Next WEnd _ArrayDisplay($sort)1 point
-
Edit: Detect key before updating content?
TheAutomator reacted to kylomas for a topic
also problems with the TAB key... Quick impressions: 1 - Seems like a combination of the two techniques will work a - hotkey to trap any key that will affect the behavior of the edit control b - regexp to parse the input @‌xxaviarxx - what is the end game? If your purpose is to try to mimic cmd.exe that has been tried with many issues, search the forum for several examples. If you are trying to create a app/function/command driver of sorts then there is a whole host of issues to consider, among them, console output, command management, possibly security, etc. By the way, I like the gui. Going to use it for the little guessing games that I make for my grandchildren... kylomas1 point -
File->View TypeLib Look into system32's dlls and select scrrun.dll. Saludos1 point
-
Is it safe to use ArrayList in AutoIt ?
kcvinu reacted to JLogan3o13 for a topic
This is geared toward beginning scripters (not saying that is you), but it does have a nice explanation of the dictionary object. https://technet.microsoft.com/en-us/library/Ee176993.aspx1 point -
GitHub and dormant developers
minxomat reacted to jvanegmond for a topic
Fork it! The main branch is only 'main' because its under active development. If that stops, then the most promising fork under active development becomes main.1 point -
AutoIT and MSAA
automaterk reacted to LarsJ for a topic
As far as I know the UI Accessibility checker (AccCheckUI.exe) is the predecessor of Inspect.exe. Both programs are based on two methods to identify windows and controls: MSAA-techniques and UIA-techniques. Because AccCheckUI.exe is the old program I think it's primarily based on MSAA-techniques. And the new program Inspect.exe is primarily based on UIA-techniques. If AccCheckUI.exe can identify the list items, Inspect.exe should also be able to identify the list items. I remember you didn't have much success with Inspect.exe in the old thread. But did you try to run Inspect.exe in pure MSAA mode (combo box in upper left corner)? If you can verify that the list items can be identified with MSAA-techniques, there can be a chance to be able to automate the list box with MSAA-code (instead of UIA-code).1 point -
AutoIT and MSAA
automaterk reacted to junkew for a topic
did you try simplespy and inspect as described in the uia thread? whats the output of those tools, as you use the UI Accessibility checker I am 99.99% sure that inspect and simplespy give you nformation and that way you can automate. This thread can also help but I did not find time to enhance / investigate further. (what you post seems to be a Java application) this makes use of the JavaAccessibilityBridge and as such called it JABSimpleSpy. https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy/1 point -
AutoCamo - 98.18b
Mobius reacted to souldjer777 for a topic
Thank you all, yes, sadly, I was referring to what he did... and I even hate putting this in any forum as it's a big no, no imo. Yeah " -d-e-c-o-m-p-i-l-e- ". He used the infamous one, I even asked him point blank and he said he did, ugh, sad, just sad and unethical. Thank you both for all the suggestions! I will look into them and I will try them as you suggest!!! Thank you all again At least it will buy the programs some time right!? LOL. You can PM me or whatever you fell like, I'm not picky, all good. BTW - Mobius, that image is the bomb, classic movie, I loved it... still do actually. 80's movies freakin ruled.1 point -
Outlook Email Content Searchterm possible?
horphi reacted to JLogan3o13 for a topic
Well...You've already been shown that this line searches for the term AW: ACS BEschriftung in the subject line: $aItems = _OL_ItemFind($oOutlook, "*\Posteingang", $olMail, "[Subject]=AW: ACS BEschriftung", "", "", "Subject,Body", "", 1)What do you think you would need to change to get it to look for Excel instead?1 point