Leaderboard
Popular Content
Showing content with the highest reputation on 02/26/2018 in all areas
-
Windows Image Acquisition Object https://msdn.microsoft.com/en-us/library/windows/desktop/ms630826(v=vs.85).aspx#SharedSample011 The "WIA.Vector" COM Example posted earlier, Object example led me to other WIA COM Objects local $v $v = ObjCreate("WIA.vector") $v.Add(1) $v.Add(42) $v.Add(3) $v.Remove(1) $v.Remove(2) ConsoleWrite("$v(1) = " & $v(1) & @CRLF) $v.Clear $v.Add("This") $v.Add("Is") $v.Add("Cool") $v.Remove(1) $v.Remove(1) ConsoleWrite("$v(1) = " & $v(1) & @CRLF) Here are some quick and dirty examples I converted found on the net. Image Convert Format ; $lFormat = 2 ; 0 = BMP, 1 = GIF, 2 = JPEG, 3 = PNG, 4 = TIFF $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir WIA_ConvertImage($sInFile,$sOutFile, 4) Func WIA_ConvertImage($sInitialImage, _ $sOutputImage, _ $lFormat, _ $lQuality = 85) Select Case $lFormat = 0 $sFormatID = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}" $sExt = "BMP" Case $lFormat = 1 $sFormatID = "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}" $sExt = "GIF" Case $lFormat = 2 $sFormatID = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}" $sExt = "JPEG" Case $lFormat = 3 $sFormatID = "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}" $sExt = "PNG" Case $lFormat = 4 $sFormatID = "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}" $sExt = "TIFF" EndSelect If $lQuality > 100 Then $lQuality = 100 $oWIA = ObjCreate("WIA.ImageFile") $oIP = ObjCreate("WIA.ImageProcess") $oIP.Filters.Add ($oIP.FilterInfos("Convert").FilterID) $oIP.Filters(1).Properties("FormatID") = $sFormatID $oIP.Filters(1).Properties("Quality") = $lQuality $oWIA.LoadFile($sInitialImage) ; --- $oWIA = $oIP.Apply($oWIA) If FileExists($sOutputImage & "\OutFile." & $sExt) Then FileDelete($sOutputImage & "\OutFile." & $sExt) EndIf $oWIA.SaveFile ($sOutputImage & "\OutFile." & $sExt) ConsoleWrite("File Saved : " & $sOutputImage & "\OutFile." & $sExt & @CRLF) EndFunc Image Resize $sInFile = "C:\Temp\Test.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_ResizeImage($sInFile,$sOutFile,100,200) Func WIA_ResizeImage($sInitialImage, _ $sResizedImage, _ $lMaximumWidth, _ $lMaximumHeight) $oWIA = ObjCreate("WIA.ImageFile") $oIP = ObjCreate("WIA.ImageProcess") $oIP.Filters.Add ($oIP.FilterInfos("Scale").FilterID) $oIP.Filters(1).Properties("MaximumWidth") = $lMaximumWidth $oIP.Filters(1).Properties("MaximumHeight") = $lMaximumHeight $oWIA.LoadFile($sInitialImage) $oWIA = $oIP.Apply($oWIA) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $oWIA.SaveFile($sResizedImage) EndFunc Image File Properties local $Img = ObjCreate("WIA.ImageFile") ; $Img.LoadFile ( "C:\Temp\Plastiflex Logo New.jpg") $Img.LoadFile (@ScriptDir & "\Vector.bmp") local $s = "Width = " & $Img.Width & @CrLf _ & "Height = " & $Img.Height & @CrLf _ & "Depth = " & $Img.PixelDepth & @CrLf _ & "HorizontalResolution = " & $Img.HorizontalResolution & @CrLf _ & "VerticalResolution = " & $Img.VerticalResolution & @CrLf _ & "FrameCount = " & $Img.FrameCount & @CrLf ;ConsoleWrite($s & @CRLF) If $Img.IsIndexedPixelFormat then $s = $s & "Pixel data contains palette indexes" & @CrLf EndIf If $Img.IsAlphaPixelFormat then $s = $s & "Pixel data has alpha information" & @CrLf EndIf If $Img.IsExtendedPixelFormat then $s = $s & "Pixel data has extended color information (16 bit/channel)" & @CrLf EndIf If $Img.IsAnimated then $s = $s & "Image is animated" & @CrLf EndIf If $Img.Properties.Exists("40091") then $v = $Img.Properties("40091").Value $s = $s & "Title = " & $v & @CrLf EndIf If $Img.Properties.Exists("40092") then $v = $Img.Properties("40092").Value $s = $s & "Comment = " & $v & @CrLf EndIf If $Img.Properties.Exists("40093") then $v = $Img.Properties("40093").Value $s = $s & "Author = " & $v & @CrLf EndIf If $Img.Properties.Exists("40094") then $v = $Img.Properties("40094").Value $s = $s & "Keywords = " & $v & @CrLf EndIf If $Img.Properties.Exists("40095") then $v = $Img.Properties("40095").Value $s = $s & "Subject = " & $v & @CrLf EndIf ConsoleWrite($s & @CRLF) Local $IP = ObjCreate("WIA.ImageProcess") For $fi In $IP.FilterInfos $s = $fi.Name & @CRLF & _ "==================================================" & @CRLF & _ $fi.Description ConsoleWrite( $s & @CRLF) Next Image Rotate ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_RotateImage($sInFile,$sOutFile,90) Func WIA_RotateImage($sInitialImage,$sRotatedImage, $sDegrees) Local $Img = ObjCreate("WIA.ImageFile") Local $oIP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) $oIP.Filters.Add( $oIP.FilterInfos("RotateFlip").FilterID) $oIP.Filters(1).Properties("RotationAngle") = $sDegrees $Img = $oIP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sRotatedImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Crop $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_RotateCrop($sInFile,$sOutFile) Func WIA_RotateCrop($sInitialImage,$sRotatedImage) Local $Img = ObjCreate("WIA.ImageFile") Local $oIP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) $oIP.Filters.Add ($oIP.FilterInfos("Crop").FilterID) $oIP.Filters(1).Properties("Left") = ($Img.Width / 4) $oIP.Filters(1).Properties("Top") = ($Img.Height / 4) $oIP.Filters(1).Properties("Right") = ($Img.Width / 4) $oIP.Filters(1).Properties("Bottom") = ($Img.Height / 4) $Img = $oIP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sRotatedImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Stamp ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $sInFile = "C:\Temp\Logo.jpg" $sStamp = @ScriptDir & "\Test1.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_Imagestamp($sInFile,$sStamp,$sOutFile) Func WIA_Imagestamp($sInitialImage, _ $sThumbImage, _ $sStampedImage) $Img = ObjCreate("WIA.ImageFile") $Thumb = ObjCreate("WIA.ImageFile") $IP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) $Thumb.LoadFile($sThumbImage) $IP.Filters.Add($IP.FilterInfos("Stamp").FilterID) $IP.Filters(1).Properties("ImageFile") = $Thumb $IP.Filters(1).Properties("Left") = $Img.Width - $Thumb.Width $IP.Filters(1).Properties("Top") = $Img.Height - $Thumb.Height $Img.LoadFile($sInitialImage) $Img = $IP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sStampedImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Set Title ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ;https://msdn.microsoft.com/en-us/library/windows/desktop/ms630800(v=vs.85).aspx Const $VectorOfBytesImagePropertyType = 1101 $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_ImagesAddTitle($sInFile,$sOutFile) Func WIA_ImagesAddTitle($sInitialImage,$sOutImage) $Img = ObjCreate("WIA.ImageFile") $IP = ObjCreate("WIA.ImageProcess") $v = ObjCreate("WIA.Vector") $Img.LoadFile($sInitialImage) $IP.Filters.Add( $IP.FilterInfos("Exif").FilterID) $IP.Filters(1).Properties("ID") = 40091 $IP.Filters(1).Properties("Type") = $VectorOfBytesImagePropertyType $v.SetFromString( "This Title tag written by Windows Image Acquisition Library v2.0") $IP.Filters(1).Properties("Value") = $v $Img = $IP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sOutImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Convert II ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Const $wiaFormatJPEG = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}" Const $wiaFormatBMP = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}" Const $wiaFormatPNG = "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}" Const $wiaFormatGIF = "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}" Const $wiaFormatTIFF = "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}" Local $sInFile = "C:\Temp\Vector.bmp" Local $sOutFile = @ScriptDir & "\Test.jpg" WIA_ImageConvertJPG($sInFile,$sOutFile,$wiaFormatJPEG) Func WIA_ImageConvertJPG($sInitialImage, _ $sImage, _ $wiaFormat) Local $Img = ObjCreate("WIA.ImageFile") Local $IP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) $IP.Filters.Add ($IP.FilterInfos("Convert").FilterID) $IP.Filters(1).Properties("FormatID").Value = $wiaFormat $IP.Filters(1).Properties("Quality").Value = 5 $Img = $IP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile ($sImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Variant ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_ImagesModified($sInFile,$sOutFile) Func WIA_ImagesModified($sInitialImage,$sOutImage) $Img = ObjCreate("WIA.ImageFile") $IP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) Local $v,$i,$IP $v = $Img.ARGBData For $i = 1 To $v.Count Step 21 $v($i) = 0xFFFF00FF ; opaque pink (A=255,R=255,G=0,B=255) Next $IP.Filters.Add($IP.FilterInfos("ARGB").FilterID) $IP.Filters(1).Properties("ARGBData") = $v $Img = $IP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sOutImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Properties ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms630800(v=vs.85).aspx Const $RationalImagePropertyType = 1006 Const $StringImagePropertyType = 1002 $sInFile = "C:\Temp\Logo.jpg" Local $Img = ObjCreate("WIA.ImageFile") $Img.LoadFile($sInFile) For $p In $Img.Properties $s = $p.Name & "(" & $p.PropertyID & ") = " If $p.IsVector Then $s = $s & "[vector data not emitted]" ElseIf $p.Type = $RationalImagePropertyType Then $s = $s & $p.Value.Numerator & "/" & $p.Value.Denominator ElseIf $p.Type = $StringImagePropertyType Then $s = $s & """" & $p.Value & """" Else $s = $s & $p.Value EndIf ConsoleWrite(@CRLF & $s & @CRLF & @CRLF) Next Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Enjoy ptrex3 points
-
Just a little program I whipped up a few days ago, that I thought some might appreciate. It uses hash checking to match source with destination, and if equal, deletes the source. It is pretty basic code, but does some nice tricky things ... including working by drag & drop for source and destination. NOTE - Source and Destination paths are never the same. The source file or folder must exist in the Destination folder. Essentially, I use this to clear folders on my transfer thumb drive ... thus making sure I have indeed backed up all. In reality, just a form of double-checking, because I do a lot of transfers between Netbook and Laptop and eventually external HDDs, using a thumb drive as the transfer medium ... between the PCs anyway. I keep multiple copies of everything ... and yes, even online (Google Drive) for smaller size content. Hopefully its basic usage should be self evident. Enjoy! WARNING - The process is an immediate one, when source is dragged & dropped on that input (providing Destination has already been set). There are no prompts. DeleteIf Same v1.1.zip 515.95 kB (148 downloads) (includes source, but not the icon which I got for myself as an online freebie) DeleteIf Same v1.2.zip 522.24 kB (159 downloads) (includes source) update detail at Post #4 DeleteIf Same v1.3.zip (includes source) update detail at Post #5 Older Screenshots P.S. I have belatedly realized (as is often the case) that I should have labelled the first input as, Destination Path To Compare Inside, and other as, Source To Delete If A Match Within Destination. Oh well, just a slight amendment to each, but does make things clearer.1 point
-
Please, Can anyone translate this C small function to autoit
adelbak reacted to Earthshine for a topic
Can you post your script so others can also look at it and help? Even if it does not work1 point -
phpIPAM - API [WIP]
Earthshine reacted to JRSmile for a topic
try it yourself: https://phpipam.net/demo/ it is a better excel sheet if you want to document your network infrastructure. you can create subnets and devices and even scan them for uptime and document changes. vlan and vrf docomentation as wenn as subnets even racks and cables are planable. we use it to keep track which cable is connected to which device here. i am currently labling cable 40450 by hand and documenting it in the system with source destination, sort of cable, lwl or cat7, etc. phpipam is relatively new, it can automatically detect new devices in a network and read port configuration from managed switches. in addition you could combine it with power-dns a bind / Windows-DNS Server alternative to manage hostnames and domainnames as well.1 point -
Please, Can anyone translate this C small function to autoit
adelbak reacted to Earthshine for a topic
I don’t think folks are going to want to do your work for you. You would not learn anything. Autoit has arrays and for loops so this is not really that hard. Post what you tried so far for better results1 point -
DeleteIf Same
coffeeturtle reacted to TheSaint for a topic
DeleteIf Same has been updated to v1.2. See first post,, which includes latest screenshot. (v1.2) Added options for 'Deleting an empty folder' and 'Report only', plus relocated the 'Remove the Thumbs.db files' to a checkbox option (rather than a dialog OK button toggle). After a source has been deleted its path now gets greyed out in the source input. Renamed 'Destination' and 'Source' input titles, plus modified the greyed out advice text shown in each input. An error is now reported when a file is dropped on the Destination input field. Major rewrite of checking & deleting code to accommodate new features. Log entries are now added to start of Log file, not end. NOTES - With this new version, and the 'Report only' option, you can now use the program as a comparison tool only (no delete). However it only advises if a match or not. Three checks are involved - (1) Folder or File existence in destination folder. (2) Folder & File list (including all sub-folders & content) and layout. (3) Hash check using that facility in AutoIt's Crypt.au3 (Crypt Management UDF). An empty folder also applies when containing empty sub-folders. So long as no files exist within the hierarchy, then the parent folder is deemed empty. TOP1 point -
Re-Name Duplicate String in File
nanobox1471 reacted to Malkey for a topic
This example appears to work. #include <File.au3> Local $iDup = 0 $file = "test.ini" Global $sharename = IniReadSection($file, "PrintList") For $x = 1 To UBound($sharename) - 1 If String($sharename[$x][0]) = "ShareName" Then $iDup += 1 $sharename[$x][0] &= StringRight("00" & $iDup, 2) EndIf Next IniWriteSection($file, "PrintList", $sharename) ShellExecute($file) ; to Verify Change to Document"1 point -
Capatcha AutoIt using Vector
coffeeturtle reacted to Ascer for a topic
1 point -
1) Koda keeps all configurations (including saved positions) in file fd.xml which is in the same directory as fd.exe 2) menu: Options/Options/Designer/Windows/Size and position saving: Don't save/Automatically/Manually 3) menu: Options/Remember position --> details are described in Koda's helpfile (menu: Help/Content)1 point
-
Base64 Autoit encode decode. Extra Fast!
coffeeturtle reacted to Ascer for a topic
Here you are. Local $vData = "Hello jcpetu this is an example using base64 func.khsfishfiagsfgiy9047019tcDV:{:J{B:CSgAAFCACXC>N<@#$%#$^@@#%@#$^TCCCCCKGAS GZG" print("Your data for this example is [" & $vData & "]" & @CRLF) print("1. Method: String -> Base64Binary") Local $sBase64Binary = base64($vData) print("Output: " & $sBase64Binary & @CRLF) print("2. Method: Base64Binary -> String") print("Output: " & BinaryToString(base64($sBase64Binary, False)) & @CRLF) ; used binary to string because base64 func first convert data to Binary (some web dont do this) print("3. Method: String -> Base64Url") Local $sBase64Url = base64($vData, True, True) print("Output: " & $sBase64Url & @CRLF) print("4. Method: Base64Url -> String") print("Output: " & BinaryToString(base64($sBase64Url, False, True)) & @CRLF) Func print($vData) Return ConsoleWrite($vData & @CRLF) EndFunc ;==>print()1 point -
EddieBoy, Then implement the For-loop in assembler. The zip-file below contains a complete set of resources and templates to use flat assembler code in AutoIt scripts. However, you must download FASM.DLL from the flat assembler forum yourself. FASM.DLL is dated 2017-10-20. Contents in zip-file: fasm\ - Top folder fasm\ - Resources FASM.DLL - Save FASM.DLL here *.au3 - 3 AutoIt include files MsgBox\ - Templates based on MessageBoxW function x64\MsgBox-x64.asm - 64 bit assembler source code x64\MsgBox-x64.au3 - Compiles and runs the assembler code x64\MsgBox-x64.bin - Contains the binary code (generated by MsgBox-x64.au3) x64\MsgBox-x64.txt - Binary code as text string (generated by MsgBox-x64.au3) x64\MsgBox-x64.log - Information about compilation (generated by MsgBox-x64.au3) x86\ - 32 bit templates MsgBox-1.au3 - Loads and executes fasm code from binary string MsgBox-2.au3 - Loads and executes fasm code from binary file This is the x64 and x86 source files. MsgBox-x64.asm: ; flat assembler code ; Documentation ; MessageBoxW( hWnd, pText, pCaption, iType ) ; Parameters: ; rcx : hWnd ; rdx : pText ; r8 : pCaption ; r9 : iType ; [rsp + 40] : pMessageBoxW ; Init directive use64 ; 64 bit code ; Function code mov rax, qword [rsp + 40] ; pMessageBoxW -> rax sub rsp, 40 ; Stack space and alignment call rax ; Call MessageBoxW add rsp, 40 ; Restore stack pointer ; Exit code ret ; Return MsgBox-x86.asm: ; flat assembler code ; Documentation ; MessageBoxW( hWnd, pText, pCaption, iType ) ; Parameters: ; [ebp + 08] : hWnd ; [ebp + 12] : pText ; [ebp + 16] : pCaption ; [ebp + 20] : iType ; [ebp + 24] : pMessageBoxW ; Init directive use32 ; 32 bit code ; Entry code push ebp ; Store base pointer on stack mov ebp, esp ; Use stack pointer as base pointer ; Function code push dword [ebp + 20] ; 4. parameter: iType push dword [ebp + 16] ; 3. parameter: pCaption push dword [ebp + 12] ; 2. parameter: pText push dword [ebp + 08] ; 1. parameter: hWnd call dword [ebp + 24] ; Call MessageBoxW ; Exit code pop ebp ; Restore base pointer from stack ret 20 ; Return and cleanup stack You can try to run the AutoIt scripts in MsgBox folder. Make a copy of the entire MsgBox folder and rename it for your own project. Delete bin-, txt- and log-files. Rename asm- and au3-files for your project. Start coding flat assembler. fasm.7z fasm-NoBins.7z (see post 12 and 13 below)1 point
-
RegExp - Remove Leading/Trailing char
NDog reacted to HurleyShanabarger for a topic
Thanks you guys, the solution von mikell is working the best for me.1 point -
Yeah it works. I ended on trying it. I didn´t want to do it cause it screwes upp my awesome system of arranging all the icons on different screens. But yeah you are the man.1 point
-
Some time ago I worked on similar multimonitor problem at our customrs's PC in other application. I heard about problems with some applications on multimonitor computers where primary monitor is not that left/top most one. Try to change your monitor configuration to left/top (virtual) monitor to be the primary one if problem dissapear. I know this is not fix just advice for workaround.1 point