GuiDropFiles
GUI コントロールを使用するにはどうすればよいですか?
フォームにいくつかのedit
フィールドがあり、それらにファイルを個別にドロップして操作できるようにしたいと考えています。
これは私が思いついたものです:
まず、私のコントロールは次のように設定されています。
WS_EX_ACCEPTFILES=0x10
Gui, add, edit, vedit1, %file_1%
WinSet,ExStyle, +WS_EX_ACCEPTFILES, edit1
そして、私のドラッグドロップルーチンは次のとおりです。
GuiDropFiles: ; Support drag & drop.
Loop, parse, A_GuiControlEvent, `n
{
thisfile := a_loopfield ; Get the first file only (in case there's more than one).
thiscontrol := a_guicontrol
break
}
alert(thisfile . "`r" . thiscontrol)
if(thiscontrol = edit1)
guicontrol,,%edit1%, %thisfile%
if(thiscontrol = edit2)
guicontrol,,%edit2%, %thisfile%
if(thiscontrol = edit3)
guicontrol,,%edit3%, %thisfile%
return
autohotkey ドキュメントの基本的な例を使用しています。hereの例も試しましたが、「編集ボックスにドロップされていません」と言い続けます。どんな手がかりも素晴らしいでしょう。