Jump to content

All Activity

This stream auto-updates

  1. Today
  2. Got it.! Thanks. I was confused how the Script works and hence was in a bit state of confusion. let me workout on the code . If required i will post again with updated query. Thanks once again for clarifying. Really appreciate quick response
  3. .cmd files created with Au3toCmd.au3 fail to launch if the PC being run on has changed the "Short date" format in Windows. In Windows 10, the setting is found at Settings -> Date & Time -> Date, Time and Regional Formatting -> Change date formats -> Short date. I looked at the source, but don't understand it enough to fix it. It surely has something to do with %date%. Is this an easy fix? Why does it need the date anyway? Temp file?
  4. I appreciate the work that you are doing on this. It's interesting to follow your progress as well. I have to admit, I really like the look of that button. I had never really thought much of WinRT or WinUI3 before but it's got my attention now. One interesting thing: You can't see the button with the default Windows Dark theme. You can see the button with Windows Light theme and just about any other theme. But not default Dark theme for some reason. I suppose there must be more to the WinUI3 theming and theme detection but I don't understand it at all yet.
  5. Hi folks, bit more progress. You can push the button using a mocked-up delegate. (same technique used for the colorPicker example in the other WinRT thread.) Its a bit of a manual process for now, but the plan is to build in a few internal funcs to streamline things... Main points of difference: We have a working button! Dumb error - there was a iWinID filter in place. So the main window messages were getting through, but button messages weren't being processed. We break out of the message loop when our winproc handles WM_DESTROY. Previously I was sending WM_QUIT when the "X" was pressed - i.e. looking for SC_CLOSE in a WM_SYSCOMMAND message. We're now properly closing the dispatch queue with a PostQuitMessage call. This means we can make use of RunEventLoop() without being stuck in an endless loop Last upload broke the class explorer, so that now should be fixed too. I've attached the two changed files to save people re-downloading the whole zip again... ClassExplorer v2.3.3.au3 WindowTest.au3
  6. Am fixing a bunch of links ( not right now )... . Actually already did over a year ago, but got me a virus, reinstalled the PC, ..then work got heavy. Long story short, it's a mess that I'm working on untangling. This time I will document my steps so that they can be understood and shared, ..and !, avoid multiple people working on the same thing, without knowing who's doing what when. I'll open a thread called, hmm, "for the betterment of the help file in 2025", I think. Nope, we have this thread for that, dah. But an entry with a list of dead links. They are not that many and I thing I've got them all, ..I think. I'll compare what is now with what I fixed and list it in a post so that is publicly known. In any case, even tho I haven't updated that site in a year, I'll keep it updated with the fixes so that we can double check if the upcoming version fixed this or that. Today is Monday for me, ..I think by next Monday I'll that other site updated with the latest updates.
  7. haha sure (bravely ran sir Robin!). But yeah, I'm happy enough to have a crack - and also to be swatted back. I just didn't want to be too presumptuous by putting something together. If you're fixing links though... its probably worth checking out a few more on that page. I haven't been through them all, but i know the garybeene.com ones under the "Advanced COM usage" section have also died of old age!
  8. Just add _ScreenCapture_Capture that isn't a workaround. That would be the solution. You already have the ltwh as part of the highlight parameters.
  9. Wow !. A whole lot of work !. Return Run(@ComSpec & " /C AutoIt3.exe """ & @ScriptFullPath & """ " & $StringCall ,"C:\Program Files (x86)\AutoIt3",@SW_HIDE) I don't run AutoIt from that path. Maybe that's the reason the script ends with "AutoIt3 ended. rc:-1073740771" ? Nice 1st post
  10. First of all thanks for such an amazing UDF and Such an Amazing tool UIA spy . I wish to asked that former version by @junkew had an action capture,Screencapture etc. Is the same available in current version. if someone could help me find the function or help on developing the said function. i feel the workaround would be to use LTHW(DIMENSIONS) from the tool and use _ScreenCapture_Capture() function to save it. Any help would be beneficial. Thanks in Advance.
  11. User Interface Builder Overview Use this tool to visually design Windows applications with a focus on Metro windows, standard windows, and Tool windows. This is for users who want a faster and simpler development tool. Drag-and-drop GUI creation, code generation, and easy control alignment tools. No more clicking through property sheets to set variable names, sizes, and the control’s text. Features Metro Controls for all window types WYSIWYG real-time preview Generates AutoIt GUI and message loop code Multiple control selection and manipulation Make additional selections with the CTRL key Accelerated control movements with the SHIFT key Change controls position with mouse or arrow keys Double click a control to precisely set its size and text Save/load GUI layouts and Control layouts to files Custom styles/themes and Controls using Metro Snap-to-guide, and toolbar alignment aids Drag down guides from the top and left sides of the Designer window Copy-n-paste between different window types Technical Details .Gui/.Ctrls file is a simple delimited text file Copy-n-paste is a similar file without the window specifications The application is meant to be portable, so it is one file The only Custom UDFs in use is Metro 5.1, and my Metro Expansion pack The script uses Label controls for everything. No GDI was used. Every control handle is saved in an array Maps are used in Metro and in future UDFs containing new controls You need Metro 5.1 UDF $GuiWindow[dynamic][18] · $GuiWindow[$GuiInFocus][0] ; Selection rectangle handle · $GuiWindow[$GuiInFocus][1] ; Upper left sizing anchor · $GuiWindow[$GuiInFocus][2] ; Lower right square sizing anchor · $GuiWindow[$GuiInFocus][3] ; Lower left sizing anchor · $GuiWindow[$GuiInFocus][4] ; Working window's handle · $GuiWindow[$GuiInFocus][5] ; Horizontal pull sizing anchor · $GuiWindow[$GuiInFocus][6] ; Vertical pull sizing anchor · $GuiWindow[$GuiInFocus][7] ; Top constrained Vertical pull circle · $GuiWindow[$GuiInFocus][8] ; Left constrained Horizontal pull circle · $GuiWindow[$GuiInFocus][9] ; Scope and name, ex. Global $hWnd · $GuiWindow[$GuiInFocus][10] ; Properties, ex. GuiSet* · $GuiWindow[$GuiInFocus][11] ; Horizontal guide line visual · $GuiWindow[$GuiInFocus][12] ; Vertical guide line visual · $GuiWindow[$GuiInFocus][13] ; Drag Titlebar for created for Metro windows · $GuiWindow[$GuiInFocus][14] ; Left Align Button · $GuiWindow[$GuiInFocus][15] ; Center Align Button · $GuiWindow[$GuiInFocus][16] ; Right Align Button · $GuiWindow[$GuiInFocus][17] ; Horizontally Align Button $GuiControl[dynamic][7] · $GuiControl[$ControlCount][0] ; Control handle · $GuiControl[$ControlCount][1] ; Function that creates the control · $GuiControl[$ControlCount][2] ; Scope and variable name · $GuiControl[$ControlCount][3] ; Style · $GuiControl[$ControlCount][4] ; Extended Style · $GuiControl[$ControlCount][5] ; Functions run after creation. Ex. GuiSet* · $GuiControl[$ControlCount][6] ; Text for Metro controls $GuiUndo [256] · Revolving push array of string to call to create the undo action Limitations and known issues Resizing the Metro window with the mouse is flaky Changing control and window styles is not implemented Window size cannot be changed precisely Undo functionality might cause problems with code generation No Redo implemented Thank you BB19 and everyone that contributed to Metro UDF. MetroGUI_UDF_xpk.au3 UserInterfaceBuilder.au3
  12. Shall we do a copy-paste? 😁 ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: $tagIStreamErrorTable ; Description ...: 2D array containing possible HRESULT error codes for the IStream interface, along with their symbolic names and descriptions. ; Fields ........: HRESULT (hex) | Symbolic name | Description | Affected methods ; Author ........: Numeric1 ; Modified ......: 2025-07-27 ; Remarks .......: HRESULT codes starting with 0x8003 are specific to storage errors (STG_E_*). Use this array to translate HRESULT codes returned by IStream methods. ; Related .......: IStream UDF ; =============================================================================================================================== Global Const $tagIStreamErrorTable = [ _ ["0x80030001", "STG_E_INVALIDFUNCTION", "Function invalid for this stream type (e.g., Revert on a non-transactional stream).", "Revert, Commit, LockRegion, UnlockRegion"], _ ["0x80030002", "STG_E_FILENOTFOUND", "The specified file or stream does not exist.", "Stat"], _ ["0x80030008", "STG_E_TOOMANYOPENFILES", "Too many files or streams are open.", "Open, Create"], _ ["0x8003001D", "STG_E_INVALIDPOINTER", "Invalid pointer passed to the method.", "Read, Write, Seek, SetSize, CopyTo, Stat, Clone"], _ ["0x80030020", "STG_E_LOCKVIOLATION", "Lock violation (e.g., accessing a locked region).", "Read, Write, LockRegion, UnlockRegion"], _ ["0x80030021", "STG_E_FILEALREADYEXISTS", "The stream or file already exists.", "Create"], _ ["0x80030050", "STG_E_INVALIDNAME", "Invalid stream name.", "Stat"], _ ["0x80030057", "STG_E_INVALIDPARAMETER", "Invalid parameter passed to the method.", "Seek, CopyTo, Commit, LockRegion, UnlockRegion"], _ ["0x80030070", "STG_E_MEDIUMFULL", "The storage medium is full.", "Write, SetSize, CopyTo"], _ ["0x800300F0", "STG_E_READFAULT", "Error reading from the stream.", "Read, CopyTo"], _ ["0x800300FA", "STG_E_WRITEFAULT", "Error writing to the stream.", "Write, CopyTo, SetSize"], _ ["0x80030102", "STG_E_REVERTED", "The stream was reverted and is no longer valid.", "Read, Write, Seek"], _ ["0x80030103", "STG_E_NOTCURRENT", "The stream has been modified since the last operation.", "Commit, Revert"], _ ["0x80030104", "STG_E_CANTSAVE", "Unable to save changes to the stream.", "Commit"], _ ["0x8007000E", "E_OUTOFMEMORY", "Insufficient memory to perform the operation.", "Read, Write, SetSize, CopyTo, Clone"], _ ["0x80070057", "E_INVALIDARG", "One or more arguments are invalid.", "Read, Write, Seek, SetSize, CopyTo, Commit, LockRegion, UnlockRegion, Stat, Clone"], _ ["0x80004001", "E_NOTIMPL", "The method is not implemented for this stream type (e.g., LockRegion on a memory stream).", "LockRegion, UnlockRegion"], _ ["0x80004005", "E_FAIL", "Unspecified operation failure.", "All methods"], _ ["0x80030006", "STG_E_INSUFFICIENTMEMORY", "Insufficient memory for the operation (similar to E_OUTOFMEMORY).", "Read, Write, SetSize, CopyTo, Clone"] _ ] thanks
  13. Yesterday
  14. Nice !. The $tagIStreamErrorTable is in French. I don't mind because am a polyglot ( via google ) but in English would be better
  15. The rktools.exe is here (it says beta but it has the same hash in every version) and the ovi386.exe is here. I can update the links in the help file but..... ...will take a brave soul to get that done ( looking at you @MattyD ) and, impress the ones who would have a say At least that's the way I got them to have a look at it, when I proposed something 😇
  16. I’m thrilled to introduce my IStream UDF, a sophisticated library designed to handle the COM IStream interface in AutoIt. This UDF enables management of data streams, whether from files, memory, or other sources, leveraging Windows IStream APIs. It provides a reliable solution for reading, writing, and administering streams in your AutoIt scripts. Whether you need to process large files, manipulate in-memory data, or handle transactional streams, this UDF is crafted to be versatile, well-documented, and user-friendly.Key Features Full Implementation of the IStream Interface: Supports all methods of the IStream interface (Read, Write, Seek, SetSize, CopyTo, Commit, Revert, LockRegion, UnlockRegion, Stat, Clone). Support for File and Memory Streams: Create streams from files using _SHCreateStreamOnFileEx or from in-memory data with _StreamCreateFromData, _SHCreateMemStream, and _StreamCreateFromDataOnHGlobal. Advanced Error Handling: Includes a detailed HRESULT error table ($tagIStreamErrorTable) and a _IStream_GetErrorInfo function for clear, understandable error messages. Utility Functions: Functions like _StreamGetSize, _StreamGetName, _StreamGetType, and _StreamStatDisplay simplify access to stream metadata. Comprehensive Documentation: Each function comes with standard UDF-format documentation, including syntax, parameters, return values, remarks, MSDN links, and practical examples. Compatibility: Works with AutoIt 3.3+ and relies on standard libraries (AutoItObject, WinAPI, Memory, Date). Use Cases Reading and writing large files without loading their entire content into memory. Handling in-memory binary data for applications such as network stream processing or serialized data manipulation. Supporting transactional streams for secure operations (e.g., via StgCreateDocfile). Integration with other COM interfaces requiring IStream. you need: AutoItObject.au3 Example: copy data between streams #include "IStream.au3" ; Example demonstrating the use of _StreamCopyToEx to copy data between streams Func Example_StreamCopyToEx() ; Create a source stream with the content "Strong" using _StreamCreateFromDataOnHGlobal ConsoleWrite("Creating source stream with 'Strong'..." & @CRLF) Local $iSrcSize,$aError Local $oSrcStream = _StreamCreateFromDataOnHGlobal("Strong", $iSrcSize, True) If @error Or Not IsObj($oSrcStream) Then ; Handle errors by displaying the HRESULT code and details from $tagIStreamErrorTable ConsoleWrite("Error: Failed to create source stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf Return EndIf ConsoleWrite("Source stream created, size: " & $iSrcSize & " bytes" & @CRLF) ; Create a destination stream with the content "AutoIt is " using _StreamCreateFromDataOnHGlobal ConsoleWrite("Creating destination stream with 'AutoIt is '..." & @CRLF) Local $iDestSize Local $oDestStream = _StreamCreateFromDataOnHGlobal("AutoIt is ", $iDestSize, True) If @error Or Not IsObj($oDestStream) Then ; Handle errors for destination stream creation ConsoleWrite("Error: Failed to create destination stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf ; Release the source stream and COM resources before exiting _StreamRelease($oSrcStream) Return EndIf ConsoleWrite("Destination stream created, size: " & $iDestSize & " bytes" & @CRLF) ; Copy the content from the source stream to the destination stream using _StreamCopyToEx ConsoleWrite("Copying 'Strong' to destination stream..." & @CRLF) Local $iBytesRead, $iBytesWritten If Not _StreamCopyToEx($oSrcStream, $oDestStream, $iSrcSize, $iBytesRead, $iBytesWritten) Then ; Handle errors during the copy operation ConsoleWrite("Error: _StreamCopyToEx failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf ; Release both streams and COM resources before exiting _StreamRelease($oDestStream) _StreamRelease($oSrcStream) Return EndIf ConsoleWrite("Copied " & $iBytesRead & " bytes read, " & $iBytesWritten & " bytes written." & @CRLF) ; Read and display the content of the destination stream ConsoleWrite("Reading destination stream content..." & @CRLF) Local $iNewDestSize = _StreamGetSize($oDestStream) If @error Then ; Handle errors when retrieving the destination stream size ConsoleWrite("Error: Failed to get destination stream size. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf ; Release both streams and COM resources before exiting _StreamRelease($oDestStream) _StreamRelease($oSrcStream) Return EndIf ConsoleWrite("Destination stream size after copy: " & $iNewDestSize & " bytes" & @CRLF) ; Position the stream pointer at the beginning for reading Local $pDestMem, $iDestRead _StreamSeek($oDestStream, 0, $STREAM_SEEK_SET) If @error Then ; Handle errors when seeking in the destination stream ConsoleWrite("Error: Failed to seek destination stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf _StreamRelease($oDestStream) _StreamRelease($oSrcStream) Return EndIf ; Read the content of the destination stream _StreamRead($oDestStream, $iNewDestSize, $pDestMem, $iDestRead) If @error Then ; Handle errors when reading the destination stream ConsoleWrite("Error: Failed to read destination stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) $aError = _IStream_GetErrorInfo(@extended) If IsArray($aError) Then ConsoleWrite("Name: " & $aError[0] & @CRLF) ConsoleWrite("Description: " & $aError[1] & @CRLF) ConsoleWrite("Affected methods: " & $aError[2] & @CRLF) EndIf ; Free the memory buffer if allocated, then release streams and COM resources If $pDestMem Then _MemGlobalFree($pDestMem) _StreamRelease($oDestStream) _StreamRelease($oSrcStream) _WinAPI_CoUninitialize() Return EndIf ; Convert the read data to a string and display it Local $bufSize Local $bDestData = _WinAPI_GetBufferData($pDestMem, $bufSize) ConsoleWrite("Destination stream content: " & BinaryToString($bDestData, 4) & @CRLF) ; Free the memory buffer If $pDestMem Then _MemGlobalFree($pDestMem) ; Release both streams to prevent memory leaks _StreamRelease($oDestStream) _StreamRelease($oSrcStream) ConsoleWrite("COM uninitialized, resources freed." & @CRLF) EndFunc ;==>Example_StreamCopyToEx ; Run the example Example_StreamCopyToEx() example demonstrating multiple IStream interface methods #include "IStream.au3" ; Example demonstrating multiple IStream interface methods Func Example_IStream() ; Initialize the COM object model (required for COM API calls) _WinAPI_CoInitialize() ConsoleWrite("=== Creating Stream with SHCreateMemStream ===" & @CRLF) ; Create a memory stream with initial content "Hello, IStream UDF!" Local $sData = "Hello, IStream UDF!" Local $iSize = 0 Local $oStream = _StreamCreateFromData($sData, $iSize) If @error Then ; Handle stream creation error and display details ConsoleWrite("Error: Failed to create stream. @error = " & @error & @CRLF) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Stream created successfully. Size: " & $iSize & " bytes" & @CRLF) ; Test IUnknown::QueryInterface to verify the IStream interface ConsoleWrite("Testing QueryInterface..." & @CRLF) Local $IID_IStream = "{0000000C-0000-0000-C000-000000000046}" Local $pQueriedStream = _StreamQueryInterface($oStream, $IID_IStream) If @error Then ; Handle QueryInterface error and release resources ConsoleWrite("Error: QueryInterface failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("QueryInterface succeeded." & @CRLF) ; Release the queried interface to prevent memory leaks DllCall("ole32.dll", "ulong", "Release", "ptr", $pQueriedStream) ; Test IStream::Write by appending additional data ConsoleWrite("Testing Write..." & @CRLF) Local $sNewData = " Additional data." ; 16 characters Local $iNewSize = 0 Local $pMemory = _StreamCreateMemoryBuffer($sNewData, $iNewSize) If @error Then ; Handle memory buffer creation error ConsoleWrite("Error: Failed to create memory buffer. @error = " & @error & @CRLF) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf Local $iWrittenSize = 0 ; Set the stream size to accommodate new data If Not _StreamSetSize($oStream, $iSize + $iNewSize) Then ConsoleWrite("Error: SetSize failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pMemory) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Move the stream pointer to the end for appending If Not _StreamSeek($oStream, $iSize, $STREAM_SEEK_SET) Then ConsoleWrite("Error: Seek failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pMemory) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Write the new data to the stream If Not _StreamWrite($oStream, $pMemory, $iNewSize, $iWrittenSize) Then ConsoleWrite("Error: Write failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pMemory) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Wrote " & $iWrittenSize & " bytes." & @CRLF) ; Free the memory buffer _WinAPI_FreeMemory($pMemory) ; Test IStream::Seek to move the pointer to the beginning ConsoleWrite("Testing Seek..." & @CRLF) Local $iNewPosition = _StreamSeek($oStream, 0, $STREAM_SEEK_SET) If @error Then ConsoleWrite("Error: Seek failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Stream pointer moved to: " & $iNewPosition & @CRLF) ; Test IStream::Read to retrieve the entire stream content ConsoleWrite("Testing Read..." & @CRLF) Local $pMemoryRead = 0, $iReadSize = 0 If Not _StreamRead($oStream, $iSize + $iNewSize, $pMemoryRead, $iReadSize) Then ConsoleWrite("Error: Read failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pMemoryRead) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf Local $bData = _WinAPI_GetBufferData($pMemoryRead, $iReadSize) ConsoleWrite("Read " & $iReadSize & " bytes: " & BinaryToString($bData) & @CRLF) _WinAPI_FreeMemory($pMemoryRead) ; Verify that the read data matches the expected content If $iReadSize <> $iSize + $iNewSize Or BinaryToString($bData) <> $sData & $sNewData Then ConsoleWrite("Error: Read data does not match expected: " & $sData & $sNewData & @CRLF) EndIf ; Test IStream::CopyTo by copying the stream to a new destination stream ConsoleWrite("Testing CopyTo..." & @CRLF) ; Create a destination stream Local $pDestStream = _WinAPI_CreateStreamOnHGlobal(0, True) If Not $pDestStream Then ConsoleWrite("Error: Failed to create destination stream." & @CRLF) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Move the source stream pointer to the beginning $iNewPosition = _StreamSeek($oStream, 0, $STREAM_SEEK_SET) If @error Then ConsoleWrite("Error: Seek failed on source stream. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) DllCall("ole32.dll", "ulong", "Release", "ptr", $pDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Copy the content to the destination stream Local $iBytesRead = 0, $iBytesWritten = 0 If Not _StreamCopyTo($oStream, $pDestStream, $iSize + $iNewSize, $iBytesRead, $iBytesWritten) Then ConsoleWrite("Error: CopyTo failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) DllCall("ole32.dll", "ulong", "Release", "ptr", $pDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Copied " & $iBytesRead & " bytes read, " & $iBytesWritten & " bytes written." & @CRLF) ; Create an IStream object from the destination stream pointer Local $oDestStream = _AutoItObject_WrapperCreate($pDestStream, $tagIStream) If @error Then ConsoleWrite("Error: Failed to create destination stream object. @error = " & @error & @CRLF) DllCall("ole32.dll", "ulong", "Release", "ptr", $pDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ; Read and verify the destination stream content _StreamSeek($oDestStream, 0, $STREAM_SEEK_SET) Local $pDestMemory, $iDestReadSize If Not _StreamRead($oDestStream, $iSize + $iNewSize, $pDestMemory, $iDestReadSize) Then ConsoleWrite("Error: Reading destination stream failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _WinAPI_FreeMemory($pDestMemory) _StreamRelease($oDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf Local $bDestData = _WinAPI_GetBufferData($pDestMemory, $iDestReadSize) ConsoleWrite("Destination stream content: " & BinaryToString($bDestData, $SB_UTF8) & @CRLF) _WinAPI_FreeMemory($pDestMemory) ; Verify that the copied data matches the expected content ; Test IStream::Commit ConsoleWrite("Testing Commit..." & @CRLF) If Not _StreamCommit($oDestStream, $STGC_DEFAULT) Then ConsoleWrite("Error: Commit failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("Commit succeeded." & @CRLF) EndIf ; Test IStream::Revert ConsoleWrite("Testing Revert..." & @CRLF) If Not _StreamRevert($oDestStream) Then ; Note that Revert may not be supported by memory streams ConsoleWrite("Note: Revert may not be supported. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("Revert succeeded (unexpected for memory stream)." & @CRLF) EndIf ; Test IStream::LockRegion and UnlockRegion ConsoleWrite("Testing LockRegion..." & @CRLF) If Not _StreamLockRegion($oStream, 0, 10, 0) Then ; Note that LockRegion may not be supported by memory streams ConsoleWrite("Note: LockRegion may not be supported. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) __IStreamErrorInfo(@extended) Else ConsoleWrite("LockRegion succeeded." & @CRLF) ConsoleWrite("Testing UnlockRegion..." & @CRLF) If Not _StreamUnlockRegion($oStream, 0, 10, 0) Then ConsoleWrite("Error: UnlockRegion failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("UnlockRegion succeeded." & @CRLF) EndIf EndIf ; Test IStream::Stat to retrieve stream metadata ConsoleWrite("Testing GetStat..." & @CRLF) Local $pStatFlag = 0 If Not _StreamGetStat($oStream, $pStatFlag) Then ConsoleWrite("Error: GetStat failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _StreamRelease($oDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Displaying stream metadata:" & @CRLF) _StreamStatDisplay($pStatFlag) _WinAPI_CoTaskMemFree($pStatFlag) ; Test IStream::GetType and GetName ConsoleWrite("Testing GetType and GetName..." & @CRLF) Local $sType = _StreamGetType($oStream) If @error Then ConsoleWrite("Error: GetType failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("Stream type: " & $sType & @CRLF) EndIf Local $sName = _StreamGetName($oStream) If @error Then ConsoleWrite("Error: GetName failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) Else ConsoleWrite("Stream name: " & $sName & @CRLF) EndIf ; Test IStream::Clone ConsoleWrite("Testing Clone..." & @CRLF) Local $pCloned Local $oCloneStream = _StreamClone($oStream, $pCloned) If @error Then ConsoleWrite("Error: Clone failed. @error = " & @error & ", @extended = 0x" & Hex(@extended, 8) & @CRLF) _StreamRelease($oDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() Return EndIf ConsoleWrite("Clone stream created successfully." & @CRLF) _StreamRelease($oCloneStream) DllCall("ole32.dll", "ulong", "Release", "ptr", $pCloned) ; Clean up all resources _StreamRelease($oDestStream) _StreamRelease($oStream) _WinAPI_CoUninitialize() ConsoleWrite("All streams released and COM uninitialized." & @CRLF) EndFunc ;==>Example_IStream ; Run the example Example_IStream() The help file is included with the UDF IStream.zip
  17. Hi guys, just suggestion. If we wanted to update the OLEView demo on the Obj/COM Reference page, perhaps this project could replace the old tool? Its a bit of a mission finding/getting the old one up and running. (I gave it a go, and needed to pull some stuff via waybackmachine) To roughly replicate the exercise of pulling up the typelib on the "new" viewer Registry Menu > Implemented Categories Control > Microsoft Web Browser > Right click the object > View Type Library
  18. I've been stuck on this topic for a while now. I'm talking specifically about the modern context menu of windows 11 meaning tweaking registry doesn't work outside of "Open with". Notepad++ was my first helping hand so I've looked into the nppshell.dll on github but I have no experience with that language and even with AI I couldn't modify the file even though it was "guiding me through the process". What I'm trying to achieve is create a single menu option with a submenu that will have various other options depending on the extension. I'm not looking for someone to write me the code just point me in the right direction.
  19. I'm not sure if this helps - but to look at it from another angle, we're talking about 30kb worth of plain text. (I think those INI funcs deal in ansi strings). Just in case the concern was around headroom... Edit: Oops KB not MB!
  20. You can use the native WinAPI GetPrivateProfileSection. It says that : Here my take on it : #include <Array.au3> Local $aSection = IniReadSectionEx("C:\Apps\AutoIt\SQLite\Sudoku.ini", "Setting") _ArrayDisplay($aSection) Func IniReadSectionEx($sFile, $sSection, $iBuffer = 64000, $iEntry = 1000, $iLine = 100) Local $tData = DllStructCreate("byte [" & $iBuffer & "]") Local $pData = DllStructGetPtr($tData) Local $aRet = DllCall("Kernel32.dll", "int", "GetPrivateProfileSection", "str", $sSection, "struct*", $tData, "int", $iBuffer, "str", $sFile) Local $tString, $aList[$iEntry + 1][2] = [[0]], $aSplit For $i = 1 To $iEntry $tString = DllStructCreate("char string[" & $iLine & "]", $pData) $sString = $tString.string If Not $sString Then ExitLoop $aList[0][0] += 1 $aSplit = StringSplit($sString, "=", $STR_NOCOUNT) $aList[$i][0] = $aSplit[0] $aList[$i][1] = $aSplit[1] $pData += StringLen($sString) + 1 Next ReDim $aList[$i][2] Return $aList EndFunc ;==>IniReadSectionEx
  21. Hello, "inireadsection()" is a natively buildin function, not added as needed by including some AU3. So I cannot dig into its logic (edit the function). Is there a way to get around this limitation, documented in the help file "Only the first 32767 chars are read for legacy reasons."? the opposit function "iniwritesection()" does *NOT* have this limitation: That one is doing writes beyond 32767 chars without any constraints.
  22. That worked Show how is ("' & $sPlexTrash & '") different from ("$sPlexTrash$") i usually use the CMD abbreviation in AutoIt, I changed it based on a suggestion from another thread ***FIGURED IT OUT*** Forgot to add the space after ComSpec before the /c so it was rendering as "cmd.exe/c" instead of "cmd.exe /c"
  23. try with RunWait(@ComSpec & ' /c curl.exe -X PUT "' & $sPlexTrash & '"', '', @SW_HIDE) Edit: To run DOS commands, try RunWait(@ComSpec & " /c " & "commandName") ; don't forget " " before "/c"
  24. ConsoleWrite(@CRLF & 'curl.exe -X PUT "$sPlexTrash$"'); & @CRLF & @CRLF) Did that...i just removed it from the code i inserted copied code from Console, and it worked in CMD
  25. $sURL = "http://1.1.1.1:7539" $sToken = "ABC123" Local $aLib[5] = [1, 2, 3, 4, 5] For $i = 0 To UBound($aLib)-1 $sLib = $aLib[$i] $sPlexTrash = "$sURL$/library/sections/$sLib$/emptyTrash?X-Plex-Token=$sToken$" ConsoleWrite(@CRLF & "Emptying Trash - Library $sLib$ - $sPlexTrash$") RunWait(@ComSpec & '/c curl.exe -X PUT "$sPlexTrash$"', '', @SW_HIDE) Next ConsoleWrite (@CRLF & "<><><><><><><><><><><><><><><><><><><><><><><><><><>" & @CRLF) I am trying to run a curl command with ComSpec, but its not working I can run the same command from CMD, and it works just fine I have a batch file that works perfectly as well I'm missing something, but I don't know what
  1. Load more activity
×
×
  • Create New...