hualong1009 发表于 2017-1-9 17:45:08

回复 15# austere


   还是不行,可能我这个客户端有特殊的权限限制吧,Thank you

hualong1009 发表于 2017-1-9 17:45:35

回复 14# q410225


    感谢刷分,我也顺便刷点金币

austere 发表于 2017-1-9 18:25:52

说下你啥客户端,可以测试一下

hualong1009 发表于 2017-1-18 22:51:24

刷一下金币,{:face (355):}

hualong1009 发表于 2017-1-18 22:51:46

再{:face (355):}刷一下金币,

hualong1009 发表于 2017-1-18 22:52:03

强刷一下金币,{:face (355):}

虫子樱桃 发表于 2017-1-20 11:14:30

官网早有解决,直接上代码

#RequireAdmin
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
Opt("GuiOnEventMode", 1)

Global $DropFilesArr
Global $FilesAllowedMask =

$mainFrm = GUICreate("Drop Multiple Files to LV Demo", 500, 400, -1, -1, -1, $WS_EX_ACCEPTFILES+$WS_EX_TOPMOST)
_ChangeWindowMessageFilterEx($mainFrm, 0x233, 1)
_ChangeWindowMessageFilterEx($mainFrm, $WM_COPYDATA, 1)
_ChangeWindowMessageFilterEx($mainFrm, 0x0049, 1)

GUISetOnEvent($GUI_EVENT_CLOSE, "MainEvents")
GUISetOnEvent($GUI_EVENT_DROPPED, "MainEvents")

GUIRegisterMsg(0x233, "WM_DROPFILES_FUNC")

GUICtrlCreateLabel("Drag to the List View some file(s)", 60, 20)

$ListView = GUICtrlCreateListView("Col1", 50, 50, 400, 300, -1, $WS_EX_CLIENTEDGE)
GUICtrlSendMsg(-1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_HEADERDRAGDROP, $LVS_EX_HEADERDRAGDROP)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)

GUISetState()

While 1
    Sleep(100)
WEnd

Func MainEvents()
    Switch @GUI_CtrlId
      Case $GUI_EVENT_CLOSE
            Exit
      Case $GUI_EVENT_DROPPED
            $NotValidExtPath = ""
            $ValidExtCount = 0
            For $i = 1 To UBound($DropFilesArr)-1
                $ValidExtCount += 1
                GUICtrlCreateListViewItem($DropFilesArr[$i], $ListView)
            Next
            If $ValidExtCount > 0 Then GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 0, -1)
    EndSwitch
EndFunc

Func _IsValidExt($sPath)
    For $i = 1 To $FilesAllowedMask
      If StringRight($sPath, 4) = $FilesAllowedMask[$i] And _
            Not StringInStr(FileGetAttrib($sPath), $FilesAllowedMask[$i]) Then Return True
    Next
    Return False
EndFunc

Func WM_DROPFILES_FUNC($hWnd, $msgID, $wParam, $lParam)
    Local $nSize, $pFileName
    Local $nAmt = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255)
    For $i = 0 To $nAmt - 1
      $nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0)
      $nSize = $nSize + 1
      $pFileName = DllStructCreate("char[" & $nSize & "]")
      DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", _
            DllStructGetPtr($pFileName), "int", $nSize)
      ReDim $DropFilesArr[$i + 2]
      $DropFilesArr[$i+1] = DllStructGetData($pFileName, 1)
      $pFileName = 0
    Next
    $DropFilesArr = UBound($DropFilesArr)-1
EndFunc

Func _ChangeWindowMessageFilterEx($hWnd, $iMsg, $iAction)
    Local $aCall = DllCall("user32.dll", "bool", "ChangeWindowMessageFilterEx", _
            "hwnd", $hWnd, _
            "dword", $iMsg, _
            "dword", $iAction, _
            "ptr", 0)
    If @error Or Not $aCall Then Return SetError(1, 0, 0)
    Return 1
EndFunc

hualong1009 发表于 2017-2-6 17:17:01

回复 22# 虫子樱桃


    {:face (245):}沒看懂,我的意思是運行外部的程序,不是自己的GUI窗口!
页: 1 [2]
查看完整版本: 在使用AUTOIT脚本中使用run跑外部程序不支持文件拖拽的问题