Remote Executing

i'm using delphi4 and would like to write a cyber cafe management system that able to logoff the client pc from server, then the terminal pc will freeze until the server unable back. any idea on doing this ? all the pc are win95 connected.
Explorer060599Asked:
Who is Participating?
 
tomer_engelConnect With a Mentor Commented:
no prob :
first some theory:

every message in the windows op.system goes through the   wndProc procedure    this procedure checks if our application overrided the message if it did override it then it hadled the messages as your application wants,, other wise it returns the message to  the op system to furthur hadaling.

so if you override this procedure  youcan do almost everything to your application,so the nextcode specifies how it's done.

a)first add the next override in your public section(in your client,or where ever you want to override  messages)

procedure WndProc(Var message :TMessage);override;

b)i think the  best way to halt your client is with  a simple global boolean variable-->tha't the way i'm gonn'a  implement the wndProc .

so lets imagine you added  a gloabl boolean varibale called:

LockClient:Boolean;

and initilazed it as needed.

b-1)disable all controls on the client form-->for good user interface programming      ,,and maybe add     some indication that client  is locked.
         
c)the client listenes to the network ,and when getting the right message it trigger the LockClient to true.                
d)implement the WndProc procedure (somewhere in the implementation section of your code)

procedure Tform1.WndProc(Var Message : TMessage);
Begin
//check the LockClient variable
  if not LockClient then inherited    
  else {lock the client if the message is a mouse/keyboard or what ever message}
    begin
     case Message.Msg of
     WM_LBUTTONDOWN,
     WM_LBUTTONUP,
     WM_LBUTTONDBLCLK,
     WM_RBUTTONDOWN,
     WM_RBUTTONDBLCLK,
     WM_RBUTTONUP,
     WM_KEYDOWN//add more messages
     ://do nothing
     else  inherited;
     end;//the case

    end;//the else cluase
End;//the procedure

HAVE FUN ,, Lets me   know how it came out..

for more questions,,contact   me..

Tomer


                   


0
 
craig_capelCommented:
define a little more......
0
 
niknoxeCommented:
hi,
should be impossible cause win95 must not be logged on. uses DCOM for IPC. more info from your side would help.
bye
nik
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

 
Explorer060599Author Commented:
what i wants is actually like what normally cyber cafe system does. from the server i can logoff and login the client pc, here logoff meants client pc would come out with a screen and user unable to get rid of that screen without server response. every client pc would have a some kind of process that running behind to capture server message. once receipt message ie. "LOGOFF" then the process reside in client pc would display one full screen graphic and disable everykey. if receipt message from server ie. "LOGON" then the process in client pc would disable that screen.
0
 
craig_capelCommented:
yes it could be done, u would need to make a client and server program to run on the network, server then talks to the clients, and when u need to log them off.... but surely, they can log themselves back in, the client just tells the server right, there back in!!!, log um....

Craig C....

There is no quick way of doing what you want, your talking about two full programs take a look at the demos provided with delphi 4, look for the chat program, simple tcp ip program and start off there.
0
 
tomer_engelCommented:
are the programs located in the same place (like an office network?),,beacuse if it does you should do a DCOM program ,,or use the TClientSocket and TServerSocket in the delphi components

it's not so hard to lock the client,, after the client got the message(you'll see how it's done in the chat demo)

just capture ALL windows messages in the client in the WinProc procedure (view the help on this procedure--it's not hard to implemtn it in Delphi)
and in the WinProc procedure if the message is a keyboard or a mouse message and the message from the server had come ,,dont use the inherited on those messagees-->which will not send the messages to the op. system and nothing will happen,,

pretty cool idea,, tell me how it'll come out--> for more help/clarifications ask and i'll try helping

Bye tomer
0
 
Explorer060599Author Commented:
i need to put the sender program on server and receiver program on client.
tomer_engel, what you said is user even cannot move the mouse or keyboard when you dont use the inherited on those messagees ? was you saying that ? can you please give me a example code.
0
 
Explorer060599Author Commented:
thanks tomer, l've tried your code as follow but it seen still go through op.system. when i ran this application and press CTRL+ESC the Showmessage works and the Start Menu Still Came out. it mean it still went through the op.system right ? can i receive and disable all others applications message like CTRL+ALT+DEL,CTRL+ESC,double click in excell application and so on ?

     case Message.Msg of
     WM_LBUTTONDOWN,
     WM_LBUTTONUP,
     WM_RBUTTONDOWN,
     WM_RBUTTONDBLCLK,
     WM_RBUTTONUP
     :;
     WM_LBUTTONDBLCLK : ShowMessage'Double Click');
     WM_KEYDOWN :
ShowMessage('Key Down');
     else inherited;
     end;//the case
0
 
niknoxeCommented:
What you want is nearly impossible in a multitasking environment. The only way I can think of is disabling the keyboard driver for this time. I do not know how to do that, but you must be very shure of what you do, because if someone turns of the machine it will restart WITHOUT keyboard driver. WIN?? is not designed for that things. Keyboard events are interrupt processed. You should figure out the program that is responsible for that and then try to hook it. If youve done this you will be informed of any keystroke, but I suppose, that you wont find a single program for that. What you want is an integral part of WinNT, so maybe you better think of using a os that is allready through with it?
0
 
Explorer060599Author Commented:
niknoxe, what i want is only disable the CTRL+ALT+DEL,CTRL+ESC and ALT+TAB so the user wont be able to get rid of my screen and use the resource of this computer without authorised.
0
 
tomer_engelCommented:
hey
yes,,what you should dois disablaing     ALL  keys and mouse event in the code.....
0
 
tomer_engelCommented:
sorry,,submmited by mistake

view the winapi      help ,and add the wanted messages in the case statment
0
 
Explorer060599Author Commented:
yes..you are right, thanks tomer.
0
 
tomer_engelCommented:
no problem,, happy i helped. :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.