Article View: borland.public.cppbuilder.nativeapi
Article #10313A Question about the CreateProcess API
From: Carmen Guo
Date: Fri, 23 Apr 2004 18:12
Date: Fri, 23 Apr 2004 18:12
34 lines
2585 bytes
2585 bytes
Hi,
I am currently writing a program to pool the number of licenses of MS
Office, Corel Draw & Corel PhotoPaint in our office, so that the users can
share these licenses instead of purchasing individual licenses for each
user.
When the user double clicks on a Word, Excel, PowerPoint, CorelDraw or
PhotoPaint file, the registry for these extensions are mapped to my program.
My program will then check if licenses are available. If yes, the program
will call the CreateProcess API to start up the corresponding application.
This works well except for one scenario: if the user already has a file
open in Word, when he double clicks on another Word file, the second file
will open up in a new Word window. In other words, I have 2 Word
applications running. This is the case for Excel and CorelDraw files too.
But for PowerPoint and CorelPhotoPaint files, the second file always opens
up in the same window, i.e., 2 documents in the same application. My
program just calls CreateProcss for each request when the user double clicks
a file. But it seems that for Word, Excel & CorelDraw, CreateProcess
creates
individual applications; whereas for PowerPoint and CorelPhotoPaint, Windows
checks if an application is already open, and if yes, it just opens the
document in the existing application. The second behavior is what I want as
it is easier for my program to manage the process handles.
So the question is: How can I make Word, Excel, and CorelDraw to behave
in the same way?
Does it have anything to do with the Windows registry, or is it just
characteristic of each individual application?
Thanks in advance!
Carmen
Technical Details
Message-ID:
<40894f9e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,500bb0aa1065a825,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-23 10:23:49 PST From: "Carmen Guo" <carmen-g@oconnor-associates.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: A Question about the CreateProcess API Date: Fri, 23 Apr 2004 11:12:56 -0700 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 64.201.174.193 Message-ID: <40894f9e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1082740638 64.201.174.193 (23 Apr 2004 10:17:18 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail