Open file from drag over application Icon

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I want to fire the drag events when someone drags a file over the
application's icon. This means the application has not opened yet.

Scenario would be:
1. user selects file they want to open through the app
2. user drags file onto the app's icon (desktop) or from "Send To" popup
3. app opens upon "drop"
4. app recognized the file that was dropped on it and opens the file from
the application

If this is not clear, just let me know.

Thanks!
 
You have to make sure that your application is the default application for
files with whatever the extension you support. So if for notepad .txt is the
extension. This can be done when installing the application. the setpup and
deployment or InstallShield packaging gives you the option to register your
app as the default app for a extension. If you are looking to do it from
C-Sharp code, I am noot sure, but would be possible..

VJ
 
Hi all,

I want to fire the drag events when someone drags a file over the
application's icon. This means the application has not opened yet.

Scenario would be:
1. user selects file they want to open through the app
2. user drags file onto the app's icon (desktop) or from "Send To" popup
3. app opens upon "drop"
4. app recognized the file that was dropped on it and opens the file from
the application

If this is not clear, just let me know.

Thanks!


Hi, I think you must put some code on Main method, Use the args
parameter
look this
using System.IO;

class Program
{
static void Main(string[] args)
{
if (Path.GetExtension(args[0])==".jpg")
{
//load the form
}

}

cheers
 
Thanks! I had to tweek the code you sent to do what I wanted, but great call!


Horacio Nuñez Hernández said:
Hi all,

I want to fire the drag events when someone drags a file over the
application's icon. This means the application has not opened yet.

Scenario would be:
1. user selects file they want to open through the app
2. user drags file onto the app's icon (desktop) or from "Send To" popup
3. app opens upon "drop"
4. app recognized the file that was dropped on it and opens the file from
the application

If this is not clear, just let me know.

Thanks!


Hi, I think you must put some code on Main method, Use the args
parameter
look this
using System.IO;

class Program
{
static void Main(string[] args)
{
if (Path.GetExtension(args[0])==".jpg")
{
//load the form
}

}

cheers
 
Back
Top