Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute WaitForSingleObject IsRunning(GeorgeTasker)
Message
 
To
19/03/2004 15:39:47
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00887963
Message ID:
00888047
Views:
47
>Thanks for the ideas Mike. I did test that. I double-clicked on the .xfdf file in windows explorer. Adobe Acrobat opened up and loaded the .pdf form and populated it with the data in the .xfdf file. I checked the taskmanager and I only had one instance of acrobat running. Then I closed it and the process terminated as it should and no longer showed up in windows task manager.
>
>Then I did the same thing with the .pdf and then again just clicking on the .exe file. All worked fine. I even tested using the Acrobat Reader shortcut on the desktop and added the command line parameter to the .exe path pointing to my .xfdf file and then the .pdf file, etc. In all cases it works as it should and when I close acrobat or reader, the .exe dissappears from the windows task manager as it should.
>
>I checked in my .prg where I run it and everything opens up fine and my apps waits. While adobe is running (either acrobat or reader) there is only one instance under processes. When I close it, either acrobat or acrord32 remain under processes in the windows task manager because it does not end the process even though the app appears to exit. Waitforsingleobject continues to wait.
>
>I have never seen this happen. It happens just instantiating acrobat or acrobat reader using createprocess too...
>
>I have rebooted and verified they are not running before I run the test.
>
>I'm stumped!
>
(SNIP)

Tracy,

I don't quite understand what your program is doing, or what .xfdf files are about. How is Acrobat being closed, interactively by the user, or by your program? If you replicated the whole sequence of steps under Windows Explorer and it cleaned up the process, but all that your program is doing is to launch this sequence via CreateProcess, that would suggest that there is something different about launching via CreateProcess than what Windows Explorer is doing when you double-click on the document. Maybe you need to pass some optional argument that you haven't included? The closest direct equivalent to what Windows Explorer is doing would be the behavior of ShellExecute or ShellExecuteEx. Again, you may want to examine the registry to see if there are certain default args supplied for .xfdf files.

Another experiment to consider is launching via ShellExecute or ShellExecuteEx to see if closing in those cases eliminates the residue. If you need to wait on the process (remebering MDI considerations), you'd use ShellExecuteEx.

mike
Montage

"Free at last..."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform