djkevin33 Posted January 11, 2008 Share Posted January 11, 2008 (edited) I make a copy with a windows screen, is it possible to insert text on this windowsThis is a part of the code:expandcollapse popup#region consts Global Const $FO_MOVE = 0x0001 Global Const $FO_COPY = 0x0002 Global Const $FO_DELETE = 0x0003 Global Const $FO_RENAME = 0x0004 Global Const $FOF_MULTIDESTFILES = 0x0001 Global Const $FOF_CONFIRMMOUSE = 0x0002 Global Const $FOF_SILENT = 0x0004 Global Const $FOF_RENAMEONCOLLISION = 0x0008 Global Const $FOF_NOCONFIRMATION = 0x0010 Global Const $FOF_WANTMAPPINGHANDLE = 0x0020 Global Const $FOF_ALLOWUNDO = 0x0040 Global Const $FOF_FILESONLY = 0x0080 Global Const $FOF_SIMPLEPROGRESS = 0x0100 Global Const $FOF_NOCONFIRMMKDIR = 0x0200 Global Const $FOF_NOERRORUI = 0x0400 Global Const $FOF_NOCOPYSECURITYATTRIBS = 0x0800 Global Const $FOF_NORECURSION = 0x1000 Global Const $FOF_NO_CONNECTED_ELEMENTS = 0x2000 Global Const $FOF_WANTNUKEWARNING = 0x4000 Global Const $FOF_NORECURSEREPARSE = 0x8000 #endregion consts $result = _CopyWithProgress($CheminArchive,$Serveur) Func _CopyWithProgress($sFrom, $sTo) ; version 1 by SumTingWong on 5/26/2006 ; http://www.autoitscript.com/forum/index.php?showtopic=11888 ; updated by lod3n on 6/5/2007 Local $SHFILEOPSTRUCT Local $pFrom Local $pTo Local $aDllRet Local $nError = 0 Local $i $SHFILEOPSTRUCT = DllStructCreate("int;uint;ptr;ptr;uint;int;ptr;ptr") If @error Then Return "nostruct" ; hwnd DllStructSetData($SHFILEOPSTRUCT, 1, 0) ; wFunc DllStructSetData($SHFILEOPSTRUCT, 2, $FO_COPY) ; pFrom $pFrom = DllStructCreate("char[" & StringLen($sFrom)+2 & "]") ; pFrom will now be null-terminated at StringLen($sFrom)+1 DllStructSetData($pFrom, 1, $sFrom) For $i = 1 To StringLen($sFrom)+2 If DllStructGetData($pFrom, 1, $i) = 10 Then DllStructSetData($pFrom, 1, 0, $i) Next ; We need a second null at the end DllStructSetData($pFrom, 1, 0, StringLen($sFrom)+2) DllStructSetData($SHFILEOPSTRUCT, 3, DllStructGetPtr($pFrom)) ; pTo $pTo = DllStructCreate("char[" & StringLen($sTo)+2 & "]") ; pTo will now be null-terminated at StringLen($sTo)+1 DllStructSetData($pTo, 1, $sTo) ; We need a second null at the end DllStructSetData($pTo, 1, 0, StringLen($sTo)+2) DllStructSetData($SHFILEOPSTRUCT, 4, DllStructGetPtr($pTo)) ; fFlags DllStructSetData($SHFILEOPSTRUCT, 5, BitOR($FOF_NOCONFIRMMKDIR, _ $FOF_NOCONFIRMATION, _ $FOF_NOERRORUI)) ; fAnyOperationsAborted DllStructSetData($SHFILEOPSTRUCT, 6, 0) ; hNameMappings DllStructSetData($SHFILEOPSTRUCT, 7, 0) ; lpszProgressTitle DllStructSetData($SHFILEOPSTRUCT, 8, 0) $aDllRet = DllCall("shell32.dll", "int", "SHFileOperation", "ptr", DllStructGetPtr($SHFILEOPSTRUCT)) $retcode = $aDllRet[0] $pFrom = 0 $pTo = 0 $SHFILEOPSTRUCT = 0 If $retcode <> 0 Then ;Ajout log windows run ( 'eventcreate /T WARNING /ID 100 /L Application /SO "Backup Outlook Archive PST" /D "' & SHFileOperationErrDecode($retcode)& '"' ) Else ;Ajout log windows run ( 'eventcreate /T WARNING /ID 100 /L Application /SO "Backup Outlook Archive PST" /D "Archive copier avec succes"' ) EndIf Return True EndFunc func SHFileOperationErrDecode($errNum) Switch $errNum case 1223 return "L'operation a été intérompu par l'utilisateur." case 113 return "Les fichiers de destination et de source sont les mèmes" case 114 return "Multiple file paths were specified in the source buffer, but only one destination file path." case 115 return "Rename operation was specified but the destination path is a different directory. Use the move operation instead." case 116 return "The source is a root directory, which cannot be moved or renamed." case 117 return "The operation was cancelled by the user, or silently cancelled if the appropriate flags were supplied to SHFileOperation." case 118 return "The destination is a subtree of the source." case 120 return "Security settings denied access to the source." case 121 return "The source or destination path exceeded or would exceed MAX_PATH." case 122 return "The operation involved multiple destination paths, which can fail in the case of a move operation." case 124 return "The path in the source or destination or both was invalid." case 125 return "The source and destination have the same parent folder." case 126 return "The destination path is an existing file." case 128 return "The destination path is an existing folder." case 129 return "The name of the file exceeds MAX_PATH." case 130 return "The destination is a read-only CD-ROM, possibly unformatted." case 131 return "The destination is a read-only DVD, possibly unformatted." case 132 return "The destination is a writable CD-ROM, possibly unformatted." case 133 return "The file involved in the operation is too large for the destination media or file system." case 134 return "The source is a read-only CD-ROM, possibly unformatted." case 135 return "The source is a read-only DVD, possibly unformatted." case 136 return "The source is a writable CD-ROM, possibly unformatted." case 183 return "MAX_PATH was exceeded during the operation." case 1026 return "An unknown error occurred. This is typically due to an invalid path in the source or destination. This error does not occur on Microsoft Windows Vista and later." case 65536 return "An unspecified error occurred on the destination." case 65652 return "Destination is a root directory and cannot be renamed." EndSwitch return "SHFileOperation returned errorcode " & hex($errNum) & ", which is not recognized" EndFuncThank you! Edited January 11, 2008 by djkevin33 Link to comment Share on other sites More sharing options...
djkevin33 Posted February 4, 2008 Author Share Posted February 4, 2008 Is it difficult? Link to comment Share on other sites More sharing options...
BrettF Posted February 4, 2008 Share Posted February 4, 2008 ControlSetText? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
djkevin33 Posted February 4, 2008 Author Share Posted February 4, 2008 What is ControlSetText, 'im not expert, i'm a beginner. Thank you Link to comment Share on other sites More sharing options...
BrettF Posted February 4, 2008 Share Posted February 4, 2008 What is the helpfile? I'm not an expert, I'm a beginner. Thank you Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Jackchar Posted June 8, 2008 Share Posted June 8, 2008 Thank Your Code! But I Cann't Help You! Link to comment Share on other sites More sharing options...
rasim Posted June 8, 2008 Share Posted June 8, 2008 Try this: expandcollapse popup#region consts Global Const $FO_MOVE = 0x0001 Global Const $FO_COPY = 0x0002 Global Const $FO_DELETE = 0x0003 Global Const $FO_RENAME = 0x0004 Global Const $FOF_MULTIDESTFILES = 0x0001 Global Const $FOF_CONFIRMMOUSE = 0x0002 Global Const $FOF_SILENT = 0x0004 Global Const $FOF_RENAMEONCOLLISION = 0x0008 Global Const $FOF_NOCONFIRMATION = 0x0010 Global Const $FOF_WANTMAPPINGHANDLE = 0x0020 Global Const $FOF_ALLOWUNDO = 0x0040 Global Const $FOF_FILESONLY = 0x0080 Global Const $FOF_SIMPLEPROGRESS = 0x0100 Global Const $FOF_NOCONFIRMMKDIR = 0x0200 Global Const $FOF_NOERRORUI = 0x0400 Global Const $FOF_NOCOPYSECURITYATTRIBS = 0x0800 Global Const $FOF_NORECURSION = 0x1000 Global Const $FOF_NO_CONNECTED_ELEMENTS = 0x2000 Global Const $FOF_WANTNUKEWARNING = 0x4000 Global Const $FOF_NORECURSEREPARSE = 0x8000 #endregion consts Global $CopyWindowTitle = "Копирование..." ;Change this value to your value, because my OS is russian :) Global $TimerProcHandle = DllCallbackRegister("_TimerProc", "none", "hwnd;int;int;dword") Global $TimerCall = DllCall("user32.dll", "int", "SetTimer", "hwnd", 0, "int", 0, "int", 100, _ "ptr", DllCallbackGetPtr($TimerProcHandle)) $TimerCall = $TimerCall[0] $CheminArchive = "d:\Video\New\GLAZ.avi" $Serveur = "c:\" $result = _CopyWithProgress($CheminArchive, $Serveur) Func _CopyWithProgress($sFrom, $sTo) ; version 1 by SumTingWong on 5/26/2006 ; http://www.autoitscript.com/forum/index.php?showtopic=11888 ; updated by lod3n on 6/5/2007 Local $SHFILEOPSTRUCT Local $pFrom Local $pTo Local $aDllRet Local $nError = 0 Local $i $SHFILEOPSTRUCT = DllStructCreate("int;uint;ptr;ptr;uint;int;ptr;ptr") If @error Then Return "nostruct" ; hwnd DllStructSetData($SHFILEOPSTRUCT, 1, 0) ; wFunc DllStructSetData($SHFILEOPSTRUCT, 2, $FO_COPY) ; pFrom $pFrom = DllStructCreate("char[" & StringLen($sFrom)+2 & "]") ; pFrom will now be null-terminated at StringLen($sFrom)+1 DllStructSetData($pFrom, 1, $sFrom) For $i = 1 To StringLen($sFrom)+2 If DllStructGetData($pFrom, 1, $i) = 10 Then DllStructSetData($pFrom, 1, 0, $i) Next ; We need a second null at the end DllStructSetData($pFrom, 1, 0, StringLen($sFrom)+2) DllStructSetData($SHFILEOPSTRUCT, 3, DllStructGetPtr($pFrom)) ; pTo $pTo = DllStructCreate("char[" & StringLen($sTo)+2 & "]") ; pTo will now be null-terminated at StringLen($sTo)+1 DllStructSetData($pTo, 1, $sTo) ; We need a second null at the end DllStructSetData($pTo, 1, 0, StringLen($sTo)+2) DllStructSetData($SHFILEOPSTRUCT, 4, DllStructGetPtr($pTo)) ; fFlags DllStructSetData($SHFILEOPSTRUCT, 5, BitOR($FOF_NOCONFIRMMKDIR, _ $FOF_NOCONFIRMATION, _ $FOF_NOERRORUI)) ; fAnyOperationsAborted DllStructSetData($SHFILEOPSTRUCT, 6, 0) ; hNameMappings DllStructSetData($SHFILEOPSTRUCT, 7, 0) ; lpszProgressTitle DllStructSetData($SHFILEOPSTRUCT, 8, 0) $aDllRet = DllCall("shell32.dll", "int", "SHFileOperation", "ptr", DllStructGetPtr($SHFILEOPSTRUCT)) $retcode = $aDllRet[0] $pFrom = 0 $pTo = 0 $SHFILEOPSTRUCT = 0 If $retcode <> 0 Then ;Ajout log windows run ( 'eventcreate /T WARNING /ID 100 /L Application /SO "Backup Outlook Archive PST" /D "' & SHFileOperationErrDecode($retcode)& '"' ) Else ;Ajout log windows run ( 'eventcreate /T WARNING /ID 100 /L Application /SO "Backup Outlook Archive PST" /D "Archive copier avec succes"' ) EndIf Return True EndFunc func SHFileOperationErrDecode($errNum) Switch $errNum case 1223 return "L'operation a ete interompu par l'utilisateur." case 113 return "Les fichiers de destination et de source sont les memes" case 114 return "Multiple file paths were specified in the source buffer, but only one destination file path." case 115 return "Rename operation was specified but the destination path is a different directory. Use the move operation instead." case 116 return "The source is a root directory, which cannot be moved or renamed." case 117 return "The operation was cancelled by the user, or silently cancelled if the appropriate flags were supplied to SHFileOperation." case 118 return "The destination is a subtree of the source." case 120 return "Security settings denied access to the source." case 121 return "The source or destination path exceeded or would exceed MAX_PATH." case 122 return "The operation involved multiple destination paths, which can fail in the case of a move operation." case 124 return "The path in the source or destination or both was invalid." case 125 return "The source and destination have the same parent folder." case 126 return "The destination path is an existing file." case 128 return "The destination path is an existing folder." case 129 return "The name of the file exceeds MAX_PATH." case 130 return "The destination is a read-only CD-ROM, possibly unformatted." case 131 return "The destination is a read-only DVD, possibly unformatted." case 132 return "The destination is a writable CD-ROM, possibly unformatted." case 133 return "The file involved in the operation is too large for the destination media or file system." case 134 return "The source is a read-only CD-ROM, possibly unformatted." case 135 return "The source is a read-only DVD, possibly unformatted." case 136 return "The source is a writable CD-ROM, possibly unformatted." case 183 return "MAX_PATH was exceeded during the operation." case 1026 return "An unknown error occurred. This is typically due to an invalid path in the source or destination. This error does not occur on Microsoft Windows Vista and later." case 65536 return "An unspecified error occurred on the destination." case 65652 return "Destination is a root directory and cannot be renamed." EndSwitch return "SHFileOperation returned errorcode " & hex($errNum) & ", which is not recognized" EndFunc Func _TimerProc($hWnd, $Msg, $IDTimer, $dwTime) If WinExists($CopyWindowTitle) Then DllCallbackFree($TimerProcHandle) DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "int", $TimerCall) ControlSetText($CopyWindowTitle, "", "Static2", "What you copying?") ControlSetText($CopyWindowTitle, "", "Static1", "I don`t know!") ControlSetText($CopyWindowTitle, "", "Static3", "How many time remain?") ControlSetText($CopyWindowTitle, "", "Button1", "Button") WinSetTitle($CopyWindowTitle, "", "My new title") EndIf EndFunc 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