[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

D5 Hidden form

There is a hidden form which can't see the user. If the program is closed in the Task Manager, neither the OnClose, nor the OnDestroy event will run for this hidden form. How would be possible to use this events in this case too?

Thanks for your help

Janos
0
kacor
Asked:
kacor
  • 3
  • 3
2 Solutions
 
vadim_tiCommented:
i think task manager use TerminateProcess call
and you have no chance to do anything after this call

it is from MSDN concerning TerminateProcess

If a process is terminated by TerminateProcess, all threads of the process are terminated immediately with no chance to run additional code. This means that the thread does not execute code in termination handler blocks. In addition, no attached DLLs are notified that the process is detaching.

0
 
kacorretiredAuthor Commented:
thanks vadim
0
 
mikelittlewoodCommented:
Could you write your own system messagae handler in your application. and try and catch the call to the program from windows?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
mikelittlewoodCommented:
Have a look at this PAQ kacor, it talks about where you could possibly either catch the system message, or hide the application from the system so it cantbe shut from Task Manager

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20318617.html
0
 
mikelittlewoodCommented:
0
 
kacorretiredAuthor Commented:
thanks mikelittlewood
0
 
kacorretiredAuthor Commented:
Hi mikelittlewood and vadim_te,

ad first link:

A part of the hiddening works right on NT4WS, W2kProf and Win XP Prof

ad second link:

html must you use on the end  to have the rigth link :-)
Using D5 the WMQueryEndSession gives an error message "Unstatisfied forward or external declaration"

I can hide my prog from the task bar, I can handle the the normal closing event and machine restarting event. The only event I can't handle is the closing event from the task manager.

Thanks for your help!

with best regards

Janos

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now