Open file from drag over application Icon

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!
 
V

VJ

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
 
?

=?iso-8859-1?q?Horacio_Nu=F1ez_Hern=E1ndez?=

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top