Leaderboard
Popular Content
Showing content with the highest reputation on 07/05/2017 in all areas
-
A possible conclusion: C/C++ seems to be faster. AutoIt seems to be easier.2 points
-
Another way: ;coded by UEZ build 2017-07-06 #include <WinAPI.au3> #include <WinAPIDiag.au3> Global $sFile = FileOpenDialog("Select a BMP file", "", "Bitmap (*.bmp)") If @error Then Exit Global $tResult = BmpGetHeaderInfo($sFile) ConsoleWrite("width: " & $tResult.width & @CRLF) ConsoleWrite("height: " & $tResult.height & @CRLF) MsgBox(0, "Bitmap Header Information", "File: " & $sFile & @CRLF & "Width: " & $tResult.width & @CRLF & "Height: " & $tResult.height, 30) Func BmpGetHeaderInfo($sBMPFile) If Not FileExists($sBMPFile) Then Return SetError(1, 0, 0) Local Const $tagBMPHeader = "char id[2];align 2;dword size;word unused1;word unused2;dword offset;", _ $tagDIBHeader = "dword dibsize;dword width;dword height;word planes;word pixels;dword compression;dword imgsize;dword hres;dword vres;dword nocol;dword impcol;", _ $tagDIBHeader32 = "dword redchannel;dword greenchannel;dword bluechannel;dword alphachannel;dword colorspace; byte colorspaceendpoints[36];dword rgamma;dword ggamma;dword bgamma;", _ $tagOSHeader = "dword size;word width;word height;word planes;word pixels;" Local $iBytes Local $hFile = _WinAPI_CreateFile($sBMPFile, 2, 2) Local $tDIBHeader = DllStructCreate("dword size") _WinAPI_SetFilePointer($hFile, 0x0E) _WinAPI_ReadFile($hFile, $tDIBHeader, 4, $iBytes) _WinAPI_SetFilePointer($hFile, 0x0) Local $tBMP, $sTag ;~ ConsoleWrite($tDIBHeader.size & @CRLF) Switch $tDIBHeader.size Case 12 ;BITMAPCOREHEADER / OS21XBITMAPHEADER $sTag = "struct;" & $tagBMPHeader & $tagOSHeader & "endstruct" Case 40 ;BITMAPINFOHEADER $sTag = "struct;" & $tagBMPHeader & $tagDIBHeader & "endstruct" Case 124 ;BITMAPV5HEADER $sTag = "struct;" & $tagBMPHeader & $tagDIBHeader & $tagDIBHeader32 & "endstruct" EndSwitch $tBMP = DllStructCreate($sTag) _WinAPI_ReadFile($hFile, $tBMP, 14 + $tDIBHeader.size, $iBytes) _WinAPI_CloseHandle($hFile) ;~ _WinAPI_DisplayStruct($tBMP, $sTag) Return $tBMP EndFunc More information can be found here: https://en.wikipedia.org/wiki/BMP_file_format1 point
-
This works without the Obfuscator, and, correcting the syntax from"$$" to "$", twice. Pressing "F1" while the cursor is over "#Au3Stripper_Parameters=" in SciTE will explain the parameters used. #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=\\TEST-PC\D$\Icons\Intellipoint-010.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_LegalCopyright=Created by Varian L.Styles #AutoIt3Wrapper_Run_AU3Check=n ;#AutoIt3Wrapper_Run_Obfuscator=y ;#Obfuscator_Parameters=/pe/sf/mo/rm #AutoIt3Wrapper_Run_Au3Stripper=y ; Default is n #Au3Stripper_Parameters=/pe/sf/mo/rm #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Misc.au3> Opt('PixelCoordMode', 2) Opt('MouseCoordMode', 2) Opt('TrayIconDebug', 1) Opt('TrayAutoPause', 0) _Singleton(@ScriptName, 0) ProcessSetPriority(@AutoItPID, 0) Global $wPos, $mPos, $mClientPos, $mWindowPos, $Text, $wTitle, $Color HotKeySet('{ESC}', '_Quit') While 1 Mouse_Coords() ;Sleep(10) WEnd Func _Quit() ToolTip('') $Text &= 'Mouse Position/Desktop: ' & $mPos[0] & ',' & $mPos[1] & @CRLF $Text &= 'Mouse Position/Window: ' & $mWindowPos[0] & ',' & $mWindowPos[1] & @CRLF $Text &= 'Mouse Position/Client: ' & $mClientPos[0] & ',' & $mClientPos[1] & @CRLF $wPos = WinGetPos('[ACTIVE]', '') $wTitle = StringLeft(WinGetTitle('[ACTIVE]', ''), 15) $Text &= '"' & $wTitle & '" Top-Left Coords: ' & $wPos[0] & ',' & $wPos[1] & @CRLF $Text &= '"' & $wTitle & '" Window Size: ' & $wPos[2] & ',' & $wPos[3] & @CRLF $Text &= 'Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6) ClipPut($Text) MsgBox(0, 'Mouse Position Results', $Text) Exit EndFunc ;==>_Quit Func Mouse_Coords() Local $String Opt('MouseCoordMode', 1) $mPos = MouseGetPos() Opt('MouseCoordMode', 0) $mWindowPos = MouseGetPos() Opt('MouseCoordMode', 2) $mClientPos = MouseGetPos() $Color = 'Hex Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6) $String &= 'Window Title: ' & StringLeft(WinGetTiTle('[ACTIVE]'), 25) & @LF $String &= 'Desktop X: ' & $mPos[0] & ' Y: ' & $mPos[1] & @LF $String &= 'Window X: ' & $mWindowPos[0] & ' Y: ' & $mWindowPos[1] & @LF $String &= 'Client X: ' & $mClientPos[0] & ' Y: ' & $mClientPos[1] & @LF ToolTip($String & $Color) EndFunc ;==>Mouse_Coords1 point
-
Done and done, TheDcoder ... Not a lot of posts yet - I was just thinking that that was too much garbage to post in the message - but I get it now. Thanks!1 point
-
#include <FileConstants.au3> #include <MsgBoxConstants.au3> Local $hFile = FileOpen("Bitmap Image.bmp", $FO_BINARY) Local $bFile = FileRead($hFile, 26) FileClose($hFile) If BinaryToString(BinaryMid($bFile, 1, 2)) == "BM" Then Local $nW = Number(BinaryMid($bFile, 19, 4)) Local $nH = Number(BinaryMid($bFile, 23, 4)) MsgBox($MB_TOPMOST, "Dimensions", $nW & " x " & $nH) Else MsgBox($MB_TOPMOST, "Error!", "Not a bitmap!") EndIf1 point
-
editing autoit script & compile it without access harddisk
salah kai reacted to argumentum for a topic
https://www.autoitscript.com/forum/topic/96783-dllcall-for-cryptunprotectdata/ https://www.autoitscript.com/forum/topic/96783-dllcall-for-cryptunprotectdata/?do=findComment&comment=695769 https://msdn.microsoft.com/en-us/library/windows/hardware/dn567648(v=vs.85).aspx https://www.donkz.nl/overview-rdp-file-settings/ https://technet.microsoft.com/en-us/library/ff393699(v=ws.10).aspx Use the above links to get what you need. All you need is to build the RDP file, that's all. And you can change your frame of mind / criteria, and build something more efficient. Like a user client that get the info from a server master that send the data in a encrypted string via TCP (or UDP), or a thousand different ideas other than what you believe to be best based in your experience. Anyway, the above links will open your horizons.1 point -
Hi! I had the same problem (and was pretty much ready to give up - actually it was worse than that). But I tried another approach. Let me explain what I am trying to do, and what I found that seems to work. - I wanted to close all existing open internet explorer windows ; Close all open internet explorer windows sleep(1000) Local $IEWindowList = WinList() ;_ArrayDisplay($IEWindowList) Local $WindowCounter = $IEWindowList[0][0] While $WindowCounter >= 0 If 0 <> StringInStr($IEWindowList[$WindowCounter][0], "Internet Explorer") Then ConsoleWrite("*** Closing Internet Explorer Applications using WinList approach - " & $IEWindowList[$WindowCounter][0] & @CRLF) WinKill($IEWindowList[$WindowCounter][1]) Endif $WindowCounter = $WindowCounter - 1 WEnd - I wanted to use _IEAttach but got the same error that you got (while using citrix iwth autoit installed in portable mode); I looked at the line in IE.au3 and found the same problem that you found - I am guessing that the com object reference created by ObjCreate is the same reference returned by _IEAttach; I am hoping to verify that soon. So, I decided to directly create an InternetExplorer.Application com object. Note that it does not always suceed the first time so I have it in a loop until it does succeed. ; Try to create internet explorer automation object (which I believe to also be a com object) ; - It doesn't always succeed the first time so I repeat until it succeeds sleep(1000) Local $IEWindowComObject = ObjCreate("InternetExplorer.Application") while @error <> 0 ConsoleWrite("*** Just attempted to create internet explorer com object " & @error & @CRLF) sleep(1000) $IEWindowComObject = ObjCreate("InternetExplorer.Application") WEnd ; Make it visible and go to ipad and then wait until the window is read $IEWindowComObject.Visible = true; $IEWindowComObject.navigate("https://www.google.ca") If @error then $IEWindowComObject.Quit Return EndIf While 1 If $IEWindowComObject.readyState = "complete" or $IEWindowComObject.readyState = 4 then ExitLoop sleep(1000) WEnd - I needed the title to determine the state the window is open; in my case there are actually two possibilities ; Get window handle, needed to get the title, of new internet explorer window $IEWindowList = WinList() ;_ArrayDisplay($IEWindowList) $WindowCounter = $IEWindowList[0][0] Local $IEWindowHandle = 0 While $WindowCounter >= 0 AND $IEWindowHandle = 0 If 0 <> StringInStr($IEWindowList[$WindowCounter][0], "Internet Explorer") Then ConsoleWrite("*** Found Internet Explorer window - " & $IEWindowList[$WindowCounter][0] & @CRLF) $IEWindowHandle = $IEWindowList[$WindowCounter][1] Endif $WindowCounter = $WindowCounter - 1 WEnd ; Get window title Local $IEWindowTitle = "" IF $IEWindowHandle <> 0 Then $IEWindowTitle = WinGetTitle($IEWindowHandle) EndIf ;_ArrayDisplay($IEWindowList) sleep(5000) ConsoleWrite($IEWindowTitle & @CRLF) - As I mentioned before, I think that $IEWindowComObject is the value that should have been returned by _IEAttach if it worked. If I am correct about this, that the com object reference is the reference returned by _IEAttach when it works, it would be extremely helpful if the documentation was modified to indicate this. All the best . . . Phil Troy1 point