argumentum Posted May 28, 2023 Share Posted May 28, 2023 _WinAPI_ShellFileOperation ( $sFrom, $sTo, $iFunc, $iFlags [, $sTitle = '' [, $hParent = 0]] ) uses $tagSHFILEOPSTRUCT = 'hwnd hWnd;uint Func;ptr From;ptr To;dword Flags;int fAnyOperationsAborted;ptr hNameMappings;ptr ProgressTitle' but there's no pointer just DllStructSetData($tSHFILEOPSTRUCT, 'ProgressTitle', $sTitle) and should be something like DllStructSetData($tSHFILEOPSTRUCT, 'ProgressTitle', DllStructGetPtr($tTitle)) because that is what the tag calls for. The title part is not working in Win10 or XP ( hence this post ) and I don't know how to fix it, other than the hint that it calls for a ptr and not a string. Help Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
KaFu Posted May 28, 2023 Share Posted May 28, 2023 (edited) Not sure if title is deprecated in Win10, does this do anything with the dialog title under XP? expandcollapse popup#include <WinAPIShellEx.au3> $s_File_In = @ScriptDir & "\large_test_file_in.mp4" $s_File_Out = @ScriptDir & "\out.mp4" _WinAPI_ShellFileOperation_Ex($s_File_In, $s_File_Out, $FO_COPY, $FOF_SIMPLEPROGRESS, "Test") Func _WinAPI_ShellFileOperation_Ex($sFrom, $sTo, $iFunc, $iFlags, $sTitle = '', $hParent = 0) Local $iData If Not IsArray($sFrom) Then $iData = $sFrom Dim $sFrom[1] = [$iData] EndIf Local $tFrom = _WinAPI_ArrayToStruct($sFrom) If @error Then Return SetError(@error + 20, @extended, 0) If Not IsArray($sTo) Then $iData = $sTo Dim $sTo[1] = [$iData] EndIf Local $tTo = _WinAPI_ArrayToStruct($sTo) If @error Then Return SetError(@error + 30, @extended, 0) Local $tTtitle If $sTitle Then If Not IsArray($sTitle) Then $iData = $sTitle Dim $sTitle[1] = [$iData] EndIf $tTtitle = _WinAPI_ArrayToStruct($sTitle) If @error Then Return SetError(@error + 40, @extended, 0) EndIf Local $tSHFILEOPSTRUCT = DllStructCreate($tagSHFILEOPSTRUCT) DllStructSetData($tSHFILEOPSTRUCT, 'hWnd', $hParent) DllStructSetData($tSHFILEOPSTRUCT, 'Func', $iFunc) DllStructSetData($tSHFILEOPSTRUCT, 'From', DllStructGetPtr($tFrom)) DllStructSetData($tSHFILEOPSTRUCT, 'To', DllStructGetPtr($tTo)) DllStructSetData($tSHFILEOPSTRUCT, 'Flags', $iFlags) If IsArray($sTitle) Then DllStructSetData($tSHFILEOPSTRUCT, 'ProgressTitle', DllStructGetPtr($tTtitle)) Local $aCall = DllCall('shell32.dll', 'int', 'SHFileOperationW', 'struct*', $tSHFILEOPSTRUCT) If @error Then Return SetError(@error, @extended, 0) If $aCall[0] Then Return SetError(10, $aCall[0], 0) Return $tSHFILEOPSTRUCT EndFunc ;==>_WinAPI_ShellFileOperation_Ex Edit: Found a remark, that FOF_SIMPLEPROGRESS shows a dialog without file locations, But under Win10 I see a dialog with locations, so maybe the whole SIMPLEPROGRESS dialog concept has been dropped (since Vista)? Edited May 28, 2023 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
argumentum Posted May 28, 2023 Author Share Posted May 28, 2023 from https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileopstructalpszProgressTitle Type: PCTSTR A pointer to the title of a progress dialog box. This is a null-terminated string. This member is used only if fFlags includes the FOF_SIMPLEPROGRESS flag. So it needs a ptr to a string/pcstr ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Danyfirex Posted May 28, 2023 Share Posted May 28, 2023 Hello. Pointer to CWSTR. So struct of wchar then get ptr of struct wchar. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
argumentum Posted May 28, 2023 Author Share Posted May 28, 2023 (edited) 29 minutes ago, Danyfirex said: So struct of wchar then get ptr of struct wchar could you say that in code ? ( as to create the wchar that I can call with DllStructGetPtr() ) I don't know how to do that basic thing Edited May 28, 2023 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
TheXman Posted May 28, 2023 Share Posted May 28, 2023 example() Func example() Local $tTitleBuffer = DllStructCreate("wchar title[256];") ;Populate title buffer $tTitleBuffer.title = "This is a title" ;Display title & pointer to title ConsoleWrite("Title = " & $tTitleBuffer.title & @CRLF) ConsoleWrite("Title Pointer = " & DllStructGetPtr($tTitleBuffer) & @CRLF) EndFunc Console output: Title = This is a title Title Pointer = 0x00000000005D8070 Danyfirex 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
argumentum Posted May 28, 2023 Author Share Posted May 28, 2023 (edited) I've tried both of these: ;~ Local $pTitle, $tTitle = DllStructCreate("wchar ProgressTitle[" & StringLen($sTitle) + 2 & "]") ;~ DllStructSetData($tTitle, "ProgressTitle", $sTitle) ;~ $pTitle = DllStructGetPtr($tTitle) Local $pTitle, $tTitle = DllStructCreate("wchar ProgressTitle[256];") $tTitle.ProgressTitle = "This is a title" $pTitle = DllStructGetPtr($tTitle) and no dice. This code is been around since forever and the title aspect never worked ( or shown any visual difference ). I just now discovered it an I'm like, is this function never been debugged or is it that it just plain don't work ( by way of M$ bug/idea never implemented/depreciated/etc.) Edited May 28, 2023 by argumentum oops Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Danyfirex Posted May 28, 2023 Share Posted May 28, 2023 Interesting. I think It does not work. at least in Windows 10 I don't get title changed. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Solution argumentum Posted May 28, 2023 Author Solution Share Posted May 28, 2023 18 minutes ago, Danyfirex said: Interesting. I think It does not work reading on the net, it seems that is code from Win 3.1, with it's long pointer to a 16 bit failed/dropped Unicode implementation and, long story short, it's a mess. Tried on WinXP because win32 is Win2000 onwards ( I guess ), so if it works on XP, it did work at some point in time. Is likely that either A, it was never used and miscoded or B, does not matter as it would not work as advertised in any case. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now