Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

app settings alway's on top easy!

hello,
i have two simple question's.
1 is how can i terminate my app (progress) i tryed halt; but i get a error: "onshow onhide"
in use of oncreate; (O.S: "XP")
is there no other way?

and the other is how can i set that my app in alway's on top?

plz help...
greets
0
krydea
Asked:
krydea
  • 3
  • 2
  • 2
  • +1
1 Solution
 
PoeticAudioCommented:
Answers....

First question.

Application.Terminate;

that will end your app and setting your form on top is just as easy!

Form.FormStyle := fsStayOnTop;

With the stay on top code, you can actually set that in design time. Just go to your Object inspector, and change the FormStyle property to fsStayOnTop.
0
 
krydeaAuthor Commented:
i get an error while using `Application.Terminate;`...??
0
 
PoeticAudioCommented:
Where are you trying to put this application.Terminate code? What event?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ImagineCommented:
To set it ontop:

SetWindowPos(Handle,HWND_TOPMOST,Left,Top,Width,Height,0); //on top

To abort your app:

application.Terminate;
0
 
krydeaAuthor Commented:
in onCreate and in Onactived and in OnDeActived
0
 
MunimCommented:
use the code for closing your program

SendMessage(Handle, WM_CLOSE, 0, 0);

and use to set the window at top:

SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,
    SWP_NOMOVE or SWP_NOSIZE or
    SWP_NOACTIVATE);
0
 
PoeticAudioCommented:
I wouldnt use windows API to close your own programs, I would use Delphis Application.Terminate, it takes care of everything for you... plus its just easier to read and remember!
0
 
MunimCommented:
Do  you know that Application.Terminate does??? It calls the ExitProcess API function. You must understand the scheme of programming, programming is not "plus its just easier to read and remember!". When you send WM_CLOSE to a window, it follows the best way the Windows does, to destroy everything associated with the window. After destroying that, the process comes to a halt. You should have known all these....
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

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