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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms always on top

Status
Not open for further replies.

wrov

Programmer
Nov 1, 2002
43
0
0
PY
Hi everybody

Is there a way to do a form "always on top", no matter that the user does ?

In another words: if the program Advice.exe is running then the user can't use Word neither Excel neither nothing more than Advice.exe

The idea is the following: The SysAdmin send a message to a user and he could answer the message before continue using the computer.

Walter.
 
I don't think so. The pre-emptive multitasking doesn't allow for an application to take over the system the way it could under Win 3.1.

You can come close with a system modal message box that will stay on top of all applications until the user closes it:
Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Application.MessageBox(
     'I won''t go away until you click OK',
     'Important Message',
     MB_SYSTEMMODAL )
end;
Hope this helps.
 
To Zathras

Thank you very much. I think that you give me the right answer. I will try your code and if it work then you will have a star.

Walter.
 
I haven't tried this, but if you make your modal form big and set the formstyle property to fsStayOnTop, it may stay in front of the other applications. This formstyle sure as !@#!$ stays in front of my IDE while I'm trying to debug. Brian
"There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group." - tag line I stole
 
To bbegley

No, that's not the idea. I want that the user can use any program but when the SysAdmin send a message it could be seen, it could be showed over all the windows.

Anyway, I had found a good solution looking for in Internet.

Walter.

 
If you had found a good one, this is a good place to share it

G.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top