I haven't tested but I imagine you can use property AllowDropFiles on TForm to get the file paths of the shortcuts through the OnDropFiles event of TForm. They won't be removed from their source directory.

I think you can directly execute the shortcuts with ShellExecute from unit ShellAPI, no need to search the actual exe path. And it's likely that with SHGetFileInfo with flag SHGFI_ICON ( https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shgetfileinfoa ) from unit ShellAPI you can get directly an hIcon icon handle that you can use directly to display the Icon on your form.

_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to