@האדם-החושב קוד זה (קרדיט ל-chatGPT) אמור לעשות מה שאתה מבקש, הבעיה היא שכרגע היא לא עובדת ועוד לא הבנתי למה
זה קוד של EXE ש(לכאורה) מקבל שם קובץ/ים כפרמטר ומעביר אותו לאשף שליחת קבצים בבלוטוס
אולי תצליח איכשהו להבין למה זה לא עובד
using System;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using System.Windows.Forms;
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("00000122-0000-0000-C000-000000000046")]
public interface IDropTarget
{
void DragEnter([In] System.Runtime.InteropServices.ComTypes.IDataObject pDataObj, [In] uint grfKeyState, [In] System.Drawing.Point pt, [In, Out] ref uint pdwEffect);
void DragOver([In] uint grfKeyState, [In] System.Drawing.Point pt, [In, Out] ref uint pdwEffect);
void DragLeave();
void Drop([In] System.Runtime.InteropServices.ComTypes.IDataObject pDataObj, [In] uint grfKeyState, [In] System.Drawing.Point pt, [In, Out] ref uint pdwEffect);
}
class Program
{
[DllImport("shell32.dll", CharSet = CharSet.Unicode)]
public static extern void SHDoDragDrop(IntPtr hwnd, System.Runtime.InteropServices.ComTypes.IDataObject dataObject, IDropTarget dropTarget, uint keyState, uint effect);
static void Main(string[] args)
{
if (args.Length == 0)
return;
StringCollection fileDropList = new StringCollection();
fileDropList.AddRange(args);
DataObject dataObject = new DataObject();
dataObject.SetFileDropList(fileDropList);
IDropTarget dropTarget = (IDropTarget)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("047ea9a0-93bb-415f-a1c3-d7aeb3dd5087")));
SHDoDragDrop(IntPtr.Zero, dataObject, dropTarget, 0, 0);
}
}