Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window Text

Status
Not open for further replies.

asm338s

Programmer
Jul 16, 2001
135
US
I found this sample code on news2news.com relating to closing all running programs. When I run that program it works but it shows the text for all programs closed either on top of the form, from where I am calling it or in the background window. Any clue about how to stop it from doing that.
 
Add:
SET TALK OFF

to the start of this program module.

Rick
 
There is a line of code, (about line 53) that reads:

? arrWin[lnWinIndex, 2]

'?' is the display text command.
Remove the line or comment it out to get rid of the output:

*... ? arrWin[lnWinIndex, 2]

Dave S.
 
Hi Dave:

Thanks for the tip. It appears that you have used this code before. Do you know of any way to prompt users to save their work. For example say they are typing something in Word, then they should see the word messagebox to save or cancel.

Thanks

asm338s
 
That's the deal with this routine, it's an unconditional "kill all processes" routine. Don't stop and ask questions, just terminate. If you want to gracefully exit apps that are running, you should maybe check into another api call or better yet, allow the users to do it themselves. Use the example, but instead of forcibly closing everything, put the names of running apps in a list, ignoring your app. Then, pop up a dialog requesting the user close the listed apps before allowing your app to run.

Dave S.
 
It SHOULD already do that. If the program you are using simply forces an END TASK on every running application, this is a BAD THING. A LOT of data could be lost that way.

I am not familiar with the program you're using, but I would imagine it simply sends a QUIT message to each open application. The apps will then all act as if you selected QUIT or EXIT from the menu, prompting to save and such.

I would also imagine that this program returns a value indicating whether or not the shutdown was successful. You'll want to abort loading your app if it didn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top