Leaderboard
Popular Content
Showing content with the highest reputation on 02/24/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 ptrex2 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.2 points
-
What version of FF are you using? MozRepl doesn't work in the latest version, so the FF.au3 UDF won't either.1 point
-
if that "trick" is allowed then just one line it's enough Local $1 = FileWrite(FileOpen(@TempDir & "\Cal.au3", 2), "Global $iMsg, $j, $BA[] = [7, 8, 9, '+', 'C', 4, 5, 6, '-', 'SqRt', 1, 2, 3, '*', '.', 0, '(', ')', '/', '='], $hGui = GUICreate('Calc', 360, 330, 229, 118, 0x00C00000), $D = GUICtrlCreateInput('', 8, 8, 344, 31, BitOR(0x00000080, 2)), $1 = GUISetState(@SW_SHOW), $a = DllCallbackRegister('BP', 'none', 'hwnd;uint;uint_ptr;dword'), $b = DllCall('user32.dll', 'uint_ptr', 'SetTimer', 'hwnd', 0, 'uint_ptr', 0, 'uint', 10, 'ptr', DllCallbackGetPtr($a)), $exit = MsgBox(0, 'Info', 'click here to exit'), $TheEnd1 = DllCallbackFree($a), $TheEnd2 = DllCall('user32.dll', 'bool', 'KillTimer', 'hwnd', 0, 'uint_ptr', $b)" & @CRLF & "Func BP($hWnd, $iMsg2, $iTimerID, $iTime)" & @CRLF & "$j = (Assign('iMsg', GUIGetMsg(0))) * 0 ? 0 :($j < UBound($BA)) ?(GUICtrlCreateButton($BA[$j], Mod($j, 5) * 70 + 7, Int($j / 5) * 70 + 50, 65, 63) + GUICtrlSetFont(-1, 18, 400, 0, 'MS Sans Serif')) * 0 + $j + 1 : UBound($BA) + 0 * ($iMsg > 3 And $iMsg < 24 ?(GUICtrlRead($iMsg) = 'C' ? GUICtrlSetData($D, '') : GUICtrlRead($iMsg) = 'SqRt' ? GUICtrlSetData($D, Sqrt(Execute(GUICtrlRead($D)))) : GUICtrlRead($iMsg) = '=' ? GUICtrlSetData($D, Execute(GUICtrlRead($D))) :(StringInStr('0123456789()+-*/.', GUICtrlRead($iMsg))) > 0 ? GUICtrlSetData($D, GUICtrlRead($D) & GUICtrlRead($iMsg)) : 0) : 20)" & @CRLF & "EndFunc"), $2 = Run(@AutoItExe & " " & @TempDir & "\Cal.au3")1 point
-
Loop How many times?
Danp2 reacted to Earthshine for a topic
When I see this kind of laziness I reach for the ignore button. RTFM1 point -
Improved from junkew 's code into two lines Hi Funs Improved from junkew 's code into 2 line if not FileExists(@TempDir&"\Cal.au3") then FileWrite(@TempDir&"\Cal.au3",'local $fcBtn=GUICtrlCreateButton, $j=0, $2=0, $amsg[]=[0,0,0,0,0], $BA[] = ["7", "8", "9", "+", "C", "4", "5", "6", "-", "SqRt", "1", "2", "3", "*", ".", "0", "(", ")", "/", "="], $hGui = GUICreate("Calc", 360, 330, 229, 118), $f=GUISetFont(18, 400, 0, "MS Sans Serif"), $D = GUICtrlCreateInput("", 8, 8, 344, 31, BitOR(0x00000080, 2)), $1 = GUISetState(@SW_SHOW),$2 = $fcBtn($BA[0],7,50,65, 63) , $2 = $fcBtn($BA[1],77,50,65, 63) ,$2 = $fcBtn($BA[2],147,50,65, 63) ,$2 = $fcBtn($BA[3],217,50,65, 63) ,$2 = $fcBtn($BA[4],287,50,65, 63) ,$2 = $fcBtn($BA[5],7,120,65, 63) ,$2 = $fcBtn($BA[6],77,120,65, 63) ,$2 = $fcBtn($BA[7],147,120,65, 63) ,$2 = $fcBtn($BA[8],217,120,65, 63) ,$2 = $fcBtn($BA[9],287,120,65, 63) ,$2 = $fcBtn($BA[10],7,190,65, 63) ,$2 = $fcBtn($BA[11],77,190,65, 63) ,$2 = $fcBtn($BA[12],147,190,65, 63) ,$2 = $fcBtn($BA[13],217,190,65, 63) ,$2 = $fcBtn($BA[14],287,190,65, 63) ,$2 = $fcBtn($BA[15],7,260,65, 63) ,$2 = $fcBtn($BA[16],77,260,65, 63) ,$2 = $fcBtn($BA[17],147,260,65, 63) ,$2 = $fcBtn($BA[18],217,260,65, 63) ,$2 = $fcBtn($BA[19],287,260,65, 63)' &@CRLF & 'do' &@CRLF & 'Until (((assign("aMsg",GUIGetMsg(1))=1) and ($aMsg[2]=0 ? $2=0 : (GUICtrlRead($aMsg[0]) = "C" ? GUICtrlSetData($D, "") : GUICtrlRead($aMsg[0]) = "SqRt" ? GUICtrlSetData($D, Sqrt(Execute(GUICtrlRead($D)))) : GUICtrlRead($aMsg[0]) = "=" ? GUICtrlSetData($D, Execute(GUICtrlRead($D))) : GUICtrlSetData($D, GUICtrlRead($D) & GUICtrlRead($aMsg[0]))) and ($aMsg[0]=-3))=true) or ($aMsg[0] = -3))') ShellExecute(@TempDir&"\Cal.au3",@TempDir)1 point
-
Probably getting the wrong handle on win10 ( wrong instance number ) $hSysTray = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:" & (@OSVersion = "WIN_10" ? 3 : 1) & "]")1 point
-
Thanks guys for inputs but I'm not interesed especially to get this specific information as much to know how to get all data from this registers in a single call. If I would need just to get VendorID your code would be nice. EDIT: I'm such an idiot, I could pass a string and add the content of registers to it. #AutoIt3Wrapper_UseX64=n #include <Memory.au3> MsgBox(0,"",GetVendorID()) Func GetVendorID() $Code = "0x" & _ ; use32 "55" & _ ; push ebp "89E5" & _ ; mov ebp, esp "60" & _ ; pushad "B800000000" & _ ; mov eax,0 "0FA2" & _ ; cpuid "8B7D08" & _ ; mov edi, [ebp + 08] "891F" & _ ; mov [edi], ebx "895704" & _ ; mov [edi + 4], edx "894F08" & _ ; mov [edi + 8], ecx "B000" & _ ; mov al, 0 "88470C" & _ ; mov [edi + 12], al "61" & _ ; popad "5D" & _ ; pop ebp "C20400" ; ret 4 $iSize = BinaryLen($Code) $pBuffer = _MemVirtualAlloc(0,$iSize,$MEM_COMMIT,$PAGE_EXECUTE_READWRITE) $tBuffer = DllStructCreate("byte Code[" & $iSize & "]",$pBuffer) DllStructSetData($tBuffer,"Code",$Code) $aRet = DllCallAddress("int",$pBuffer,"str","") _MemVirtualFree($pBuffer,$iSize,$MEM_DECOMMIT) Return $aRet[1] EndFunc1 point