Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/17/2018 in all areas

  1. water

    Auto it excel help

    Welcome to AutoIt and the forum! Sure you can let the user select the workbook to process. I suggest something like this: #include <FileConstants.au3> #include <Excel.au3> Local $sWorkbook = FileOpenDialog("Please select workbook to process", "", "Excel Workbooks (*.xlsx)", $FD_FILEMUSTEXIST + $FD_PATHMUSTEXIST) If @error Then Exit msgBox(0, "Error", "File selection returned error " & @error) ; @error = 1 means: So file was selected Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook)
    2 points
  2. HMW - Hide my Windows Current Version: v4 (2024-Oct-18) HMW is a free program to stash away the Windows on your desktop. With HMW you can set any program Window as hidden, while the program itself will run silently in the background. Additionally all the Hotkeys used can be customized to your needs. [*] With HMW you can improve your “Visual Privacy”. No-one looking at your desktop will see instantly what programs you’re running anymore. [*] You can hide away programs which have long processing runs, cluttering your desktop and impairing the overall usability. [*] HMW is fully portable, the settings are stored in a "hmw.ini" file created in the scriptdir. It works fine on my XP-32bit, Win7-64bit, Win8(.1)-64bit and Win10 machines. If you find bugs please let me know. The source and executable can be downloaded from my site: https://funk.eu Kudos to Ascend4nt, Prog@ndy, UEZ, Yashied, Tuape & wraithdu for parts of the code. Please let me know if you found some piece of code in the source for which I forgot to mention a credit. Enjoy, let me know what you think of HMW and with Best Regards
    1 point
  3. JRSmile

    DXGI Screen Capture

    Hi Folks, i was looking for a fast an reliable way to make screenshots and came across this: https://github.com/pgurenko/DXGICaptureSample https://msdn.microsoft.com/en-us/library/windows/desktop/bb205075(v=vs.85).aspx so far i managed to find the following code on the forum but not more. ;~ #AutoIt3Wrapper_UseX64=y #include <WinAPI.au3> Global Const $DXGI_ERROR_NOT_FOUND = 0x887A0002 Global Const $sTag_DummyIDXGIObject = "Dummy1 hresult();Dummy2 hresult();Dummy3 hresult();Dummy4 hresult();" Global Const $sTag_IDXGIFactory = $sTag_DummyIDXGIObject & "EnumAdapters hresult(uint;ptr*); MakeWindowAssociation hresult(hwnd;uint); GetWindowAssociation hresult(hwnd*); CreateSwapChain hresult(ptr;ptr;ptr*); CreateSoftwareAdapter hresult(hwnd;ptr*);" Global Const $sIID_IDXGIFactory = "{7b7166ec-21c7-44ae-b21a-c9ae321ae369}" Global Const $sTag__IDXGIAdapter = $sTag_DummyIDXGIObject & "EnumOutputs hresult(uint;ptr*);GetDesc hresult(ptr);CheckInterfaceSupport hresult(ptr;long)" Global Const $sIID_IDXGIAdapter = "{2411e7e1-12ac-4ccf-bd14-9798e8534dc0}" Global Const $sTag_DXGI_ADAPTER_DESC = "wchar Description[128];uint VendorId;uint DeviceId;uint SubSysId;uint Revision;ULONG_PTR DedicatedVideoMemory;ULONG_PTR DedicatedSystemMemory;ULONG_PTR SharedSystemMemory;DWORD LowPart;LONG HighPart;" DllOpen("DXGI.dll") Local $tRIID_IDXGIFactory = _WinAPI_CLSIDFromString($sIID_IDXGIFactory) Local $aRet = DllCall("DXGI.dll", "long", "CreateDXGIFactory1", "ptr", DllStructGetPtr($tRIID_IDXGIFactory), "ptr*", 0) If @error Or UBound($aRet) <> 3 Then $aRet = DllCall("DXGI.dll", "long", "CreateDXGIFactory", "ptr", DllStructGetPtr($tRIID_IDXGIFactory), "ptr*", 0) If @error Or UBound($aRet) <> 3 Then Exit ConsoleWrite("Unable to get IDXGIFactory Interface Pointer" & @CRLF) EndIf EndIf Local $pIDXGIFactory = $aRet[2] ConsoleWrite("$pIDXGIFactory: " & $pIDXGIFactory & @CRLF) If Not $pIDXGIFactory Then Exit ConsoleWrite("Unable to get IDXGIFactory Interface Pointer" & @CRLF) Local $oDXGIFactory = ObjCreateInterface($pIDXGIFactory, $sIID_IDXGIFactory, $sTag_IDXGIFactory) ConsoleWrite("IsObj($oDXGIFactory): " & IsObj($oDXGIFactory) & @CRLF) Local $pAdapter = 0 Local $oAdapter = 0 Local $i = 0 Local $tApdaterDescription = 0 While Not $oDXGIFactory.EnumAdapters($i, $pAdapter) = $DXGI_ERROR_NOT_FOUND ConsoleWrite("$pAdapter: " & $pAdapter & @CRLF) $oAdapter = ObjCreateInterface($pAdapter, $sIID_IDXGIAdapter, $sTag__IDXGIAdapter) ConsoleWrite("IsObj($oAdapter): " & IsObj($oAdapter) & @CRLF) If IsObj($oAdapter) Then $tApdaterDescription = DllStructCreate($sTag_DXGI_ADAPTER_DESC) $oAdapter.GetDesc(DllStructGetPtr($tApdaterDescription)) ConsoleWrite(">>>>>>>>>>>Adapter Information<<<<<<<<<<<<<" & @CRLF) ConsoleWrite("Description: " & $tApdaterDescription.Description & @CRLF) ConsoleWrite("VendorId: " & $tApdaterDescription.VendorId & @CRLF) ConsoleWrite("DeviceId: " & $tApdaterDescription.DeviceId & @CRLF) ConsoleWrite("SubSysId: " & $tApdaterDescription.SubSysId & @CRLF) ConsoleWrite("Revision: " & $tApdaterDescription.Revision & @CRLF) ConsoleWrite("DedicatedVideoMemory: " & $tApdaterDescription.DedicatedVideoMemory & @CRLF) ConsoleWrite("DedicatedSystemMemory: " & $tApdaterDescription.DedicatedSystemMemory & @CRLF) ConsoleWrite("SharedSystemMemory: " & $tApdaterDescription.SharedSystemMemory & @CRLF) ConsoleWrite(@CRLF & @CRLF) $oAdapter = 0 EndIf $i += 1 WEnd Func _WinAPI_CLSIDFromString($sGUID) Local $tGUID = DllStructCreate('ulong Data1;ushort Data2;ushort Data3;byte Data4[8]') Local $iRet = DllCall('ole32.dll', 'uint', 'CLSIDFromString', 'wstr', $sGUID, 'ptr', DllStructGetPtr($tGUID)) If (@error) Or ($iRet[0]) Then Return SetError(@error, @extended, 0) EndIf Return $tGUID EndFunc ;==>_WinAPI_CLSIDFromString my question is how would i go from c to autoit. and make it reliable. the most interresting function is DXGIOutputDuplication::AcquireNextFrame i wonder if it is possible to request regions of a screen and if it is possible to get hex values of the pixels very fast.
    1 point
  4. trancexx

    dll call failed

    There's no such thing as "void" in AutoIt. Use "none".
    1 point
  5. Melba23

    Make copy of GUI

    kira1414, Welcome to the AutoIt forums. However, we do not just produce code for you - we help you get your code working correctly. Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers. I suggest looking in the help file for the examples for GUICreate, GUICtrlCreateInput, GUICtrlCreateIcon, GUICtrlCreateLabel & GUICtrlCreateButton. Try and code something yourself and then, even if it does not work, post your code (see here how to do it) so we can see where you have gone wrong. M23
    1 point
  6. FrancescoDiMuro

    A simple query

    Hi @LudwigIt Maybe ControlGetText()?
    1 point
  7. Didn't realize there was a new version out there. I was still on V0.1.0.13. Just updated and you are correct, that does hide when I used the $_WD_DEBUG = $_WD_DEBUG_None
    1 point
  8. Hi @TotallyNotWorkingatm, and welcome to the AutoIt forum Syntacically, this is not correct: Run ('c:\program files\subfolder\subfolder\subfolder\program.exe Try this instead: Run('c:\program files\subfolder\subfolder\subfolder\program.exe')
    1 point
  9. You might try the hard way
    1 point
  10. mikell

    help with regexp

    Exactly the reason why I asked for more details. How do you think a regex can be built without knowing ALL the requirements ? "It might be other number or text" is not precise enough. The part to be replaced must be precisely defined : format, location, etc Example using location : $string = '"blah blah"}","answer":0,"authorization":"blah blah"' $new = StringRegExpReplace($string, '(?<=answer":)([^,]*)', "none") Msgbox(0,"", $new)
    1 point
  11. Simpel

    New Script

    @Danyfirex, I tried your chrome extension and it worked like charme. I modified the AutoItCodeRunner this way: #include <String.au3> #include <File.au3> ; define your pathes Local $sDestinationPath = ; where do you want putted the files to - no trailing \ Local $sPathSciTE = ; path to SciTE Local $sFileName = "CCR_" ; ChromeCodeRunner Local $aFilename = _StringBetween(ClipGet(), ";Title: ", " - AutoIt ") If IsArray($aFilename) Then $sFileName &= StringRegExpReplace($aFilename[0], '[ /:*?"<>|]', '_') ConsoleWrite($sFileName & @CRLF) Else ; find the last test file Local $aTestFiles = _FileListToArray($sDestinationPath, "test*.au3", $FLTA_FILES) ; search existing test*.au3 Local $sTestFiles = _ArrayToString($aTestFiles) ; make a string of it $aTestFiles = StringRegExp($sTestFiles, "(?i)test(\d+)\.au3", $STR_REGEXPARRAYGLOBALMATCH) ; search all test*-files with digits between test and extension au3 For $i = 0 To UBound($aTestFiles) -1 $aTestFiles[$i] = Number($aTestFiles[$i]) ; make them all to numbers Next _ArraySort($aTestFiles) ; sort them ; find first empty file or get the last number + 1 Local $iNextNumber For $i = 0 To UBound($aTestFiles) -1 If FileGetSize($sDestinationPath & "\test" & $aTestFiles[$i] & ".au3") = 0 Then $iNextNumber = $aTestFiles[$i] ExitLoop EndIf Next If Not IsNumber($iNextNumber) Then $iNextNumber = $aTestFiles[UBound($aTestFiles) -1] + 1 ; that is the highest number + 1 $sFileName &= "test" & $iNextNumber ConsoleWrite($sFileName & @CRLF) EndIf ; create the file Local $sNewFile = $sDestinationPath & "\" & $sFileName & ".au3" Local $File = FileOpen($sNewFile, $FO_OVERWRITE) ; open the file in overwrite mode Local $sCheck = "#AutoIt3Wrapper_AU3Check_Parameters=;-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7" ; for all those cases variables are not declared etc. FileWrite($File, $sCheck & @CRLF & @CRLF & ClipGet()) ; put the clipboard inside FileClose($File) ; close the file ; open the file in SciTE If Not WinExists("[CLASS:SciTEWindow]") Then ShellExecute($sPathSciTE) ; that's for re-opening current opened files too before While Not WinExists("[CLASS:SciTEWindow]") Sleep(100) WEnd RunWait('"' & $sPathSciTE & '" "' & $sNewFile & '"', $sDestinationPath, @SW_HIDE) ; now open that file Regards, Simpel
    1 point
  12. So not sure about the rest of you, but even after downloading the SDK and launching the application, I still got errors and was unable to use it (figured out needed to launch as admin for it to work right), but for those who would rather just use a small, portable application that does the exact same thing (and even almost looks the exact same) as the OLE/COM Object Viewer in the Windows SDK, click here. On this page, you will find a crap ton of free tools including "MiTeC OLE/COM Object Explorer 1.3". Enjoy!
    1 point
  13. 2016.07.01b fixed the installer. At times the template on vista and newer goes to c:\users\All Users\.. ..\Templates 2016.07.01 ; https://www.autoitscript.com/forum/topic/149137-sign-your-exe-with-a-digital-signature-signtoolexe/?do=findComment&comment=1316935 after extensive testing, this is the best I can come up with, to simplify self signing the executable compiled with AutoIt3 from SciTE ( the editor ). Could have given the code more options but I felt at the time of coding that it was practical enough and if you ( the coder ) feel different, the code is in the file to tweak or just plain rewrite. In this ZIP are included the updated utility files from the original distribution of this package plus an installer of sorts called "copy all these to SciTE path.exe", to place the files in the path that the "#AutoIt3Wrapper_Run_After" command can find even if running as a portable setup. The path is %scitedir%\tools\SignThisFile\CertSigner.exe and it will also patch the Template.au3 ( if one is found ), to add the directive, with /NoPopup /NoLogfile ( therefore CertSigner.exe would otherwise write a log file and show a GUI with said log ), but the output is displayed at SciTE's console anyway, so what's the need for more bells and whistles. No need. Unless you run it in self standing mode, by dropping a file to it. Then you do want to have a feedback. In such case, a log is written and displayed. You may even add a shortcutr to "SendTo", to sign files from explorer. I tested the original code from Windows 2000 to Windows 10 and this compilation in english, spanish, french and korean, to assure uniform looks and functionality under every circumstance that I can think of at this moment. An ini file will be created as you first run CertSigner.exe, for you to edit and create your own self signed certificate. Do add the certificate to the store as trusted root ( otherwise what's the point ), and by doing so, the verification at the end of the signing will pass. Enjoy
    1 point
×
×
  • Create New...