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
Delphi
Last Comment
Munim
8/22/2022 - Mon
PoeticAudio
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.
krydea
ASKER
i get an error while using `Application.Terminate;`...??
SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE or SWP_NOSIZE or
SWP_NOACTIVATE);
PoeticAudio
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!
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....
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.