|
|
| version 1.1, 2003/11/03 10:19:43 | version 1.2, 2003/11/03 17:36:24 |
|---|---|
| Line 5 | Line 5 |
| #include "dosio.h" | #include "dosio.h" |
| #include "ini.h" | #include "ini.h" |
| #include "resource.h" | #include "resource.h" |
| #include "toolmac.h" | #include "toolwin.h" |
| #include "np2opening.h" | #include "np2opening.h" |
| #include "dialogutils.h" | #include "dialogutils.h" |
| #include "dialog.h" | #include "dialog.h" |
| Line 557 static pascal OSErr DragReceiver( Window | Line 557 static pascal OSErr DragReceiver( Window |
| } | } |
| } | } |
| // アイテムは1つだけか? | |
| UInt16 numItems; | UInt16 numItems; |
| CountDragItems( theDrag, &numItems ); | CountDragItems( theDrag, &numItems ); |
| if ( numItems != 1 ) | if ( numItems != 1 ) |
| { // 複数ある | { |
| return( -1 ); // 取り扱わない | return( -1 ); |
| } | } |
| // アイテムリファレンスを取り出す | |
| DragItemRef ItemRef; | DragItemRef ItemRef; |
| GetDragItemReferenceNumber( theDrag, 1, &ItemRef ); | GetDragItemReferenceNumber( theDrag, 1, &ItemRef ); |
| // フレーバタイプを調べる | |
| FlavorType Type; | FlavorType Type; |
| GetFlavorType( theDrag, ItemRef, 1, &Type ); | GetFlavorType( theDrag, ItemRef, 1, &Type ); |
| // ファイルか? | |
| if ( Type != flavorTypeHFS ) | if ( Type != flavorTypeHFS ) |
| { // ファイルではない | { |
| return( -1 ); // 取り扱わない | return( -1 ); |
| } | } |
| // FSSpecを得る | |
| HFSFlavor aHFSFlavor; | HFSFlavor aHFSFlavor; |
| Size dataSize = sizeof(aHFSFlavor); | Size dataSize = sizeof(aHFSFlavor); |
| GetFlavorData( theDrag, ItemRef, flavorTypeHFS, &aHFSFlavor, &dataSize, 0 ); | GetFlavorData( theDrag, ItemRef, flavorTypeHFS, &aHFSFlavor, &dataSize, 0 ); |