Application always on top

  • Thread starter Thread starter G Uljee
  • Start date Start date
G

G Uljee

Hi,



I want that my application is always on top (configurable), so the user can
not use any other program.

Any ideas?



Gaby
 
Gaby,

It should be noted that this is very bad behavior for any program, and
should be discouraged. I also believe that there are statements to this
affect in the Windows Application Guidelines. Of course, that doesn't mean
that you can't do it, just that you shouldn't.

What exactly are you trying to do? Perhaps there is a better way of
doing it.
 
Nicholas,



This application will be used as an 100% dedicated program on a client
(reception) machine, my client want this to protect that people play games
on the machine -:).

The top most property is not enough.

Any suggestion?



Gaby




Nicholas Paldino said:
Gaby,

It should be noted that this is very bad behavior for any program, and
should be discouraged. I also believe that there are statements to this
affect in the Windows Application Guidelines. Of course, that doesn't mean
that you can't do it, just that you shouldn't.

What exactly are you trying to do? Perhaps there is a better way of
doing it.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

G Uljee said:
Hi,



I want that my application is always on top (configurable), so the user can
not use any other program.

Any ideas?



Gaby
 
Gaby,

In that case, I would make sure that the machine that this is installed
on doesn't have the games in the first place. Additionally, I would make it
so that the receptionist does not have the appropriate rights to install new
programs on the machine (just make her a normal user). I think that writing
an application that hijacks the machine isn't really the answer (no
offense).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

G Uljee said:
Nicholas,



This application will be used as an 100% dedicated program on a client
(reception) machine, my client want this to protect that people play games
on the machine -:).

The top most property is not enough.

Any suggestion?



Gaby




message news:%[email protected]...
Gaby,

It should be noted that this is very bad behavior for any program, and
should be discouraged. I also believe that there are statements to this
affect in the Windows Application Guidelines. Of course, that doesn't mean
that you can't do it, just that you shouldn't.

What exactly are you trying to do? Perhaps there is a better way of
doing it.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

G Uljee said:
Hi,



I want that my application is always on top (configurable), so the
user
can
not use any other program.

Any ideas?



Gaby
 
I've had to do the same thing several times on PC's set up in a lobby for
customers (the public) to sign in, and also a guard desk application where
vistitors sign in and get a badge printed on the spot. And it's very hard to
do in windows. The least troublesome way is to make a form that has no
controls, no close box, control box or min/max. Set it topmost. Be sure to
monitor keystrokes so you can kill the app with a password. Make the box
size the same as the screen resolution and set the start bar so it's not
hidden and doesn't cover anything. This will fool anyone except a smart 8
year old.

On the app that the public used, I even altered the keyboard to disable the
F keys, control and alt keys, print screen, etc.
I hope this helps

Nicholas Paldino said:
Gaby,

It should be noted that this is very bad behavior for any program, and
should be discouraged. I also believe that there are statements to this
affect in the Windows Application Guidelines. Of course, that doesn't mean
that you can't do it, just that you shouldn't.

What exactly are you trying to do? Perhaps there is a better way of
doing it.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

G Uljee said:
Hi,



I want that my application is always on top (configurable), so the user can
not use any other program.

Any ideas?



Gaby
 
I want that my application is always on top (configurable), so the user
Yes, here's a better one. Tie the users hands down to his desk once he has
your app on top.

You should write your app such that there is no way of proceding before the
user performed the necessary tasks. Not by inhibiting him to navigate but by
disabling the next step in the process, in other words by checking
prerequisites.

Now on the Window-on-top issue, I found this to be flawed in the .NET
framework, possibly by design. I did not find a nice way to make an
application window pop up to the foreground for instance. I had to revert to
the Win32 SetForeGroundWindow function. Pretty horrid yet it was the only
way to make my application window pop back out of the tray on top of others.

The TopMost property works only within the context of an application window.

Martin.
 
Back
Top