サンプルを見ながら作ったこのスプリクトですがどうしても絵の上にボタンを貼ってしまいます。
; Windowへのドラッグ&ドロップsample ; http://quasiquote.org/hspwiki/ ; thanks ちょくと さん ; http://yokohama.cool.ne.jp/chokuto/urawaza/dragdrop.html ; #uselib "shell32.dll" #func DragAcceptFiles "DragAcceptFiles" int,int #func DragQueryFile "DragQueryFileA" int,int,int,int #func DragQueryPoint "DragQueryPoint" int,int #func DragFinish "DragFinish" int #define WM_DROPFILES 0x0233 ; WM_DROPFILES メッセージハンドラを設定 oncmd gosub *OnDropFiles, WM_DROPFILES ; ファイルをドラッグ&ドロップできるように設定 DragAcceptFiles hwnd, 1 title "ウィンドウにファイルをドロップしてください" stop *OnDropFiles ; --- ファイルがドロップされたとき --- ; ドロップされたファイルの数を取得する hdrop = wParam ; ドロップファイル情報のハンドル DragQueryFile hdrop, -1, 0, 0 ndrop = stat ; ファイルの数 ; 画面をクリア syscolor 5 : boxf syscolor 8 : pos 0,0 ; ファイル名を取得して表示 sdim filename, 260 repeat ndrop DragQueryFile hdrop, cnt, varptr(filename), 260 #uselib "shell32" #func global SHGetFileInfo "SHGetFileInfo" sptr, int, int, int, int #uselib "user32" #func DrawState "DrawStateA" int, int, int, sptr, int, int, int, int, int, int objsize 70,40:pos 30,50 ;ボタン表示 button "",*押したら #func DestroyIcon "DestroyIcon" int dim shinfo, 4 SHGetFileInfo filename, 0, varptr(shinfo), 4, $00000100 DrawState hdc, , ,shinfo.0, , 50, 50, , , $3 redraw DestroyIcon shinfo.0 loop ; ドロップファイル情報をクリア (これをしないとメモリリークになる) DragFinish hdrop return *押したら stop
どこがいけないのでしょうか。