Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Misc > Re: Open file
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 5996 of 6154
Post > Topic >>

Re: Open file

by Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@[EMAIL PROTECTED] > Feb 26, 2008 at 08:05 PM

rforgues@[EMAIL PROTECTED]
 wrote:
> Hi,
> 
> Is there a way to open multiple files in the same MDI app.  I mean :
> 
> 1- Double-click a file «TEST1.ABC» in Windows...
> 2- a Delphi program is opened (because the file type .ABC is
> registered with this program)...
> 3- the Delphi program retrieves the paramstr and open the file
> «TEST1.ABC» in a new MDI form...
> 4- double-click a file "TEST2.ABC file in Windows...
> 
> (up to now, no problem...)
> 
> 5- the Delphi program open the file «TEST2.ABC» in a new MDI form so
> we have both files open at the same time in the same program.
> 
> Any way to do this?
> 
> Thanks!
> 
> 
There are a couple of ways of handling that.

   first, you can use the windows method that has been there for
some time which allows you to associate a file extension with
an application for the request. In those parameters are command
line key words that you decide to use which gets passed to
your app.
   Windows can use a dynamic Data exchange service option if you
select that (DDE). With that, you're app must register it self
as a DDE server on start up and from there, windows will send
messages to your already existing app in operation...

   If you don't want to do it that way, you can edit the
code in your main section of the app each time a copy of
your app starts up. This way you can decide if a copy of your
app is already operating and if so, post a custom message directly to
it containing the info that as been sent to it and then terminate the
current copy that just started up.
   For this to work efficiently, you should write a simple stub app that
does scan for the existence of the main app via a "findwindow" for 
example, and then, make the proper move. In either case, the stub app 
will terminate at the end. How ever, before it does it should have 
already either started the real app for the first time if it could not 
be found and then post the command line information to it in both cases.
   etc..


-- 
http://webpages.charter.net/jamie_5"
 




 3 Posts in Topic:
Open file
rforgues@[EMAIL PROTECTED  2008-02-26 11:52:04 
Re: Open file
"Maarten Wiltink&quo  2008-02-26 22:31:29 
Re: Open file
Jamie <jamie_ka1lpa_no  2008-02-26 20:05:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 3:22:03 CDT 2008.