Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

System.Diagnostics.Process.Start problem when the process is already running

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Trabucco - 28 Apr 2005 21:24 GMT
Hello all,

Here is my delemma...

Dim objProcess as  System.Diagnostics.Process =
System.Diagnostics.Process.Start(x)

With objProcess
   .WaitForExit()
    .Close()
End With

Works great in most cases.  It opens up the document in the associated
program and waits for it to exit - just like I need it to.

Now the problem.  I try to use this to open up a Microsoft Word Document.  I
have Word already running or Outlook or some other program that uses Word.

The Start returns Nothing because it just attached to a running process!  My
application really needs to know when the user is done with the document.

Anybody know of a way I could determine they closed the document if the
system just used and existing process?

Thanks in advance,

Bob
Ken Beard - 25 May 2005 14:10 GMT
Hey Bob,

By chance do you find a resolution to your problem?  I'm facing the same
issue and was thinking that forcing the computer to start a 2nd process would
be the answer but I haven't really seen any resolutions to this problem on
the www.  I would appreciatte any assistance you can give.  Or better yet
since I'm a MSDN Universal Subscriber maybe Microsoft will have a good answer
within a couple of days.

THANKS
Signature

Ken Beard
MCSD, MCP

> Hello all,
>
[quoted text clipped - 23 lines]
>
> Bob
Bob Trabucco - 25 May 2005 14:15 GMT
Hey Ken,

What I ended up doing was if the Process.Start returned nothing then I
entered a loop that attempts to open the file exclusively - if that failed I
know it was still in use.

Ugly I know

A better solution is still apprectiated.

Bob

> Hey Bob,
>
[quoted text clipped - 39 lines]
>>
>> Bob
Ken Beard - 25 May 2005 14:38 GMT
WOW, Thanks for the quick response.  I do agree that is an ugly way in doing
it.  I'll keep trying and if I find a better way I'll make sure I'll post it.

THANKS again for the info!
Signature

Ken Beard
MCSD, MCP

> Hey Ken,
>
[quoted text clipped - 51 lines]
> >>
> >> Bob

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.