用PostMessage_UDF.au3后台发送命令无效,求解
#include <Misc.au3>#include<PostMessage_UDF.au3>
Local $fTest
$fTest = _ClipPutFile("C:\123\abc.txt" );把"C:\123\abc.txt"文件复制到剪贴板
$hWnd=WinGetHandle("333");获取"C:\333"目录窗口句柄
_SendKeys($hWnd, "^v");向"C:\333"目录发送粘贴命令"Ctrl+V"结果:无效!求解!
PostMessage_UDF.au3文件:
http://www.shynd.com/scripts/PostMessage_UDF.au3 呵呵楼主在跟我找一样的东西
sanhen的东西可惜路径不支持中文
Func _ExplorerCopy($source, $dest)
Global Const $FO_COPY = 0x0002
Global Const $FOF_ALLOWUNDO = 0x0040
Local $SHFILEOPSTRUCT, $source_struct, $dest_struct
$SHFILEOPSTRUCT = DllStructCreate("hwnd hWnd;uint wFunc;ptr pFrom;ptr pTo;int fFlags;" & _
"int fAnyOperationsAborted;ptr hNameMappings;ptr lpszProgressTitle")
$source_struct = DllStructCreate("char[" & StringLen($source) + 2 & "]")
DllStructSetData($source_struct, 1, $source)
DllStructSetData($source_struct, 1, 0, StringLen($source) + 2)
$dest_struct = DllStructCreate("char[" & StringLen($dest) + 2 & "]")
DllStructSetData($dest_struct, 1, $dest)
DllStructSetData($dest_struct, 1, 0, StringLen($dest) + 2)
DllStructSetData($SHFILEOPSTRUCT, "hWnd", 0)
DllStructSetData($SHFILEOPSTRUCT, "wFunc", $FO_COPY)
DllStructSetData($SHFILEOPSTRUCT, "pFrom", DllStructGetPtr($source_struct))
DllStructSetData($SHFILEOPSTRUCT, "pTo", DllStructGetPtr($dest_struct))
DllStructSetData($SHFILEOPSTRUCT, "fFlags", $FOF_ALLOWUNDO)
DllCall("shell32.dll", "int", "SHFileOperation", "ptr", DllStructGetPtr($SHFILEOPSTRUCT))
EndFunc ;==>_ExplorerCopy
为什么不用filecopy? 追求系统复制进度条
页:
[1]