?
Solved

app settings alway's on top easy!

Posted on 2003-03-24
8
Medium Priority
?
250 Views
Last Modified: 2010-04-04
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
Comment
Question by:krydea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 6

Expert Comment

by:PoeticAudio
ID: 8196634
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
 

Author Comment

by:krydea
ID: 8196678
i get an error while using `Application.Terminate;`...??
0
 
LVL 6

Accepted Solution

by:
PoeticAudio earned 200 total points
ID: 8196721
Where are you trying to put this application.Terminate code? What event?
0
Independent Software Vendors: 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!

 

Expert Comment

by:Imagine
ID: 8197344
To set it ontop:

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

To abort your app:

application.Terminate;
0
 

Author Comment

by:krydea
ID: 8197775
in onCreate and in Onactived and in OnDeActived
0
 
LVL 1

Expert Comment

by:Munim
ID: 8205204
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
 
LVL 6

Expert Comment

by:PoeticAudio
ID: 8214831
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
 
LVL 1

Expert Comment

by:Munim
ID: 8217164
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question