Solved

To control all screen of monitor

Posted on 2002-07-23
6
141 Views
Last Modified: 2010-04-04

Dear advisor !

i use D.5

i want to write an application to control computer like Cyber Time.

After windown starting, the application must be run and it holds all screen of monitor.
To use all services in computer(internet, music ...) , the user must input username and password correctly.

Please should me how to write this application. Send to me the source if possible

Thanks for all consider

Beginner

PS : i could increase the point if require
0
Comment
Question by:NamCit
  • 3
  • 2
6 Comments
 
LVL 7

Expert Comment

by:Cynna
ID: 7174703
Most of your problem is easy. This is the "poor-man version":

var AllowedClosing: Boolean=TRUE; // FALSE to prevent Alt-F4

procedure TForm1.FormCreate(Sender: TObject);
begin
   // "Capture" monitor:
   SetBounds(0,0,Screen.Width,Screen.Height);
   FormStyle:=fsStayOnTop;
   BorderStyle:=bsNone;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  // We must set AllowedClosing to allow termination
  if AllowedClosing then CanClose:=FALSE;
end;

This code will do most of what you want.
But, to really cut-off user, you'll have to disable Ctrl-Alt-Delete for example. Total keyboard control is possible
only through global keyboard hook, which is a whole different issue (a "rols-royce version" :) ...
0
 

Author Comment

by:NamCit
ID: 7176118

Oh , it works well.

How could i disable Ctrl-Alt-Delete ?

I will offer more points to Mr. Cynna or anyone help me to solve this problem.

Looking forward to hearing any news

0
 
LVL 3

Expert Comment

by:gandalf_the_white
ID: 7176866
i have once downloaded a programm called
protect. this does exactly what you want
i'm not more able to find the place where
i downloaded it so if you give me an email
i can send it to you

gandalf
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:Cynna
ID: 7176952
NamCit,

I presume you don't want this for NT based system (otherwise, why bother with login sequence, if system provides you this already...). If not, forget it: Ctrl-Alt-Del can't be captured on NT.

For Win9x, add the following in FormCreate to disable Ctrl-Alt-Del:

var tmp: Integer;
//.....
SystemParametersInfo(SPI_SCREENSAVERRUNNING, 1, @tmp, 0);

And, after logon, enable it again by:

SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, @tmp, 0);

0
 

Author Comment

by:NamCit
ID: 7178980

Dear Cynna !

It works well.

Please expalain for me a bit about SystemParametersInfo Procedure.

I find that procedure on D5 Help Doccument, but not found.
Mr Dynna, your answear is easy and shortly.

*----------

Dear gandalf_the_white !

My email : faq111@yahoo.com. I hope to learn ST from your source
0
 
LVL 7

Accepted Solution

by:
Cynna earned 50 total points
ID: 7179536
This is the quote from Win32 developer's references help:


The SystemParametersInfo function queries or sets systemwide parameters. This function can also update the user profile while setting a parameter.

BOOL SystemParametersInfo(

    UINT uiAction,     // system parameter to query or set
    UINT uiParam,     // depends on action to be taken
    PVOID pvParam,     // depends on action to be taken
    UINT fWinIni      // user profile update flag
   );    


So, we are using it to tell the system that your app is a
screen saver. This disables Ctrl-Alt-Del functionality.
To enable it again (notify that screen server is not
running any more), second parameter is set to 0.
Third parametar is return variable, which is irrelevant
for our purpose. And last parametar tells the system how
your change is to be broadcasted, and if user profile is
to be updated. We don't want that, so we set it to zero.

If you need more info on this (as well as any other API
call), you should search MSDN. For example, detailed help
on SystemParametersInfo is at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/sysinfo_4p67.asp
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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