I have developed a simple text editing program using Windows Forms. I want
to be able to right-click on a text file, choose "Open With" and select my
program from the list to open the file, but I don't know how to get my
program to "accept" a file in such a way.
Is it using the command line? If so, what arguements are passed? Should I
deal with them after capturing the Load event, or is there a different event?
Am I not even close?
Thank you for your time.
-Daniel 4 2325
Hello
You can access the command line parameters at the main entry point,eg...
static void Main(string [] args)
{
if(args.GetLength(0) >0)
{
string filearg = args[0]
etc
"Daniel Miller" <Daniel Mi****@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com... I have developed a simple text editing program using Windows Forms. I want to be able to right-click on a text file, choose "Open With" and select my program from the list to open the file, but I don't know how to get my program to "accept" a file in such a way.
Is it using the command line? If so, what arguements are passed? Should I deal with them after capturing the Load event, or is there a different event? Am I not even close?
Thank you for your time.
-Daniel
Thank you for the response.
I know how to access the command line arguments, but I don't know which
arguments (if any) are sent . Additionally, I am not sure after which event
to act on them.
"WRH" wrote: Hello
You can access the command line parameters at the main entry point,eg... static void Main(string [] args)
{
if(args.GetLength(0) >0) { string filearg = args[0]
etc
"Daniel Miller" <Daniel Mi****@discussions.microsoft.com> wrote in message news:D9**********************************@microsof t.com...
I have developed a simple text editing program using Windows Forms. I want to be able to right-click on a text file, choose "Open With" and select my program from the list to open the file, but I don't know how to get my program to "accept" a file in such a way.
Is it using the command line? If so, what arguements are passed? Should I deal with them after capturing the Load event, or is there a different event? Am I not even close?
Thank you for your time.
-Daniel
The path of the file selected in Windows Explorer's "Open With" is
passed as the first argument, ie arg[0]
In my case I act upon it just after Form InitializeComponent()
"Daniel Miller" <Da**********@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com... Thank you for the response.
I know how to access the command line arguments, but I don't know which arguments (if any) are sent . Additionally, I am not sure after which event to act on them.
"WRH" wrote:
Hello
You can access the command line parameters at the main entry point,eg... static void Main(string [] args)
{
if(args.GetLength(0) >0) { string filearg = args[0]
etc
"Daniel Miller" <Daniel Mi****@discussions.microsoft.com> wrote in message news:D9**********************************@microsof t.com...
>I have developed a simple text editing program using Windows Forms. I >want > to be able to right-click on a text file, choose "Open With" and select > my > program from the list to open the file, but I don't know how to get my > program to "accept" a file in such a way. > > Is it using the command line? If so, what arguements are passed? > Should > I > deal with them after capturing the Load event, or is there a different > event? > Am I not even close? > > Thank you for your time. > > -Daniel
Okay, thanks. :)
"WRH" wrote: The path of the file selected in Windows Explorer's "Open With" is passed as the first argument, ie arg[0]
In my case I act upon it just after Form InitializeComponent()
"Daniel Miller" <Da**********@discussions.microsoft.com> wrote in message news:8A**********************************@microsof t.com... Thank you for the response.
I know how to access the command line arguments, but I don't know which arguments (if any) are sent . Additionally, I am not sure after which event to act on them.
"WRH" wrote:
Hello
You can access the command line parameters at the main entry point,eg... static void Main(string [] args)
{
if(args.GetLength(0) >0) { string filearg = args[0]
etc
"Daniel Miller" <Daniel Mi****@discussions.microsoft.com> wrote in message news:D9**********************************@microsof t.com...
>I have developed a simple text editing program using Windows Forms. I >want > to be able to right-click on a text file, choose "Open With" and select > my > program from the list to open the file, but I don't know how to get my > program to "accept" a file in such a way. > > Is it using the command line? If so, what arguements are passed? > Should > I > deal with them after capturing the Load event, or is there a different > event? > Am I not even close? > > Thank you for your time. > > -Daniel This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Berthold Hoellmann |
last post by:
Hello,
When I use
./configure --with-thread --with-fpectl --with-signal-module \
--with-pymalloc --enable-shared --with-cxx=g++
make test
on 2.3.3 I get
|
by: john.burton.email |
last post by:
I've done some extensive searching and can't seem to find an answer to
this -
Is it correct to using "using" with templates, for example:
using std::vector;
Or do I need to specify the type...
|
by: mahurshi |
last post by:
i have a quick question
i am putting a debug flag in my program (i really dont need this
feature, but i figured it might be useful when i get into trouble)
so i want to check if argv is the...
|
by: Paul Brownjohn |
last post by:
Hello
I am new both to this group and to C# programming having spent the last 15
years or so writing C and VB.
You will forgive I hope if I am asking the totally obvious but it is a
question...
|
by: Hareth |
last post by:
When VS2003 is installed :
I can open Form1.cs w/ windows "open with" contextmenu, then it opens the
file w/ notepad & it works fine
but after installing VS2005, "open with" doesnt...
| |
by: OutdoorGuy |
last post by:
Greetings,
I have a "newbie" question in relation to opening files from C#. I have
a Windows form where I allow the user to type in a file extension in a
text box (e.g., "xls"). I then take...
|
by: kbarrios |
last post by:
Hi,
I am working with VBScript and I put a "window.open" inside a "form action post" due that I am handing a "checkbox" on it, but the "window.open" doesn't work:
<FORM...
|
by: Ofelia |
last post by:
Hi,
I'm new to this forum and to Perl language but I would like to ask for your help.
I'm working in Linux and the files I need to process are in the format “file.gz”.
I created a script which...
|
by: Stefano Tonello |
last post by:
Hi all,
I need to call windows' "open with" dialog from my C# windows form
application. After the user selects application, control must return to
me (I have to launch directly the process).
I...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |