473,416 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

handling user prompts in shell-executed processes

Our software launches a variety of applications and prints documents
using shellExecute and the printto verb. Occasionally, a program will
get stuck and will not be able to print, requiring user intervention.
Unfortunately, our program is a server program.
Is there a way to recognize that software is waiting for user
intervention so that we can at least alert the user and kill the
process?

Nov 17 '05 #1
1 1107
hsifelbmur wrote:
Our software launches a variety of applications and prints documents
using shellExecute and the printto verb. Occasionally, a program will
get stuck and will not be able to print, requiring user intervention.
Unfortunately, our program is a server program.
Is there a way to recognize that software is waiting for user
intervention so that we can at least alert the user and kill the
process?


There's not any especially nice way that I know of, since this involves
predicting what the program will do, but some simple approaches are:

* Set some fixed timeout value after which the alert is given and the
process is killed.

* Import the Win32 API function FindWindow at the following URL with
DllImport and use it to look for an open dialog with a title indicating a
printer error.

http://msdn.microsoft.com/library/de...findwindow.asp

* Try to test the printer's status from your own app. If it doesn't report
having printed the desired document, or it's down or not responding, and
the app times out, you can be reasonably confident something is up.

* Try sending user input to the app and seeing how it responds using basic
automation. This might help you establish its state.

The best possible way to do this would be to somehow obtain a programmatic
interface, or at least a command-line interface, to the needed application
functionality so that you can execute desired commands and get appropriate
errors back. This may not be an option in your case, but look around and
see if you can find anything.
--
Derrick Coetzee, MCP, MSFT (Speech Server)
This posting is provided "AS IS" with no warranties, and confers no
rights. Use of included code samples are subject to the terms
specified at http://www.microsoft.com/info/cpyright.htm
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Christopher Jedlicka | last post by:
I am trying to write a script that will access files on another computer on the network but in a seperate domain. In order to access the files, I need to first authenticate to the other domain as...
115
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." ...
13
by: forbes | last post by:
Hi, I have a user that used the Query Wizard to create a query in Access. Now she claims that her master table is missing all the data that was excluded from the query. Can you create anything...
1
by: karthikeyansen | last post by:
HI all I would like to know what is the method or idea to handle a renaming of folder that requires user intervention. When i performed a manual rename of a folder, i find that there is a...
11
by: Tom Plunket | last post by:
I have some code to autogenerate some boilerplate code so that I don't need to do the tedious setup stuff when I want to create a new module. So, my script prompts the user for the module name,...
7
by: yogeshnelwadkar | last post by:
Hello, i have a problem with replacing c++ exception handling with structured exception handling. How to replace the " catch(...) " in c++ exception handling with, __except , a structured...
12
by: sam | last post by:
hi all, i'm starting to put together a program to simulate the performance of an investment portfolio in a monte carlo manner doing x thousand iterations and extracting data from the results. ...
3
by: Gilles Ganault | last post by:
Hello I have a PHP script rss.php that serves RSS to clients. It work fine, but I'd like to server customized contents, and for this, I need to know who the user is. Unless there's a better...
1
by: 32Alpha | last post by:
Hi, first post here. First off, this IS a homework assignment for an operating systems class, but the question isn't "how do i do the assignment" but "why is my particular implementation not...
4
by: DHS1 | last post by:
Hey guys. I have a lab that is due in two weeks, but I wanted to start on it now. Problem is, I'm at home during christmas break so I can't ask my professors. Here's my problem: I am given a very...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.