Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Stopping windows enabling CTRL,ALT,DEL

MadPandaMadPanda Posts: 4Member
i am a beginer and am curently writing a simple password program, the program its self works fine its just that windows lets CTRL,ALT,DEL stop the program at will, is ther any way of stopping this just while the program is running.

Comments

  • zibadianzibadian Posts: 6,349Member
    : i am a beginer and am curently writing a simple password program, the program its self works fine its just that windows lets CTRL,ALT,DEL stop the program at will, is ther any way of stopping this just while the program is running.
    :
    Here is a small function, which will disable all keys to windows:
    [code]
    procedure DisableTaskmanager(State : boolean);
    var
    OldSysParam : longint;
    begin
    SystemParametersInfo(SPI_SCREENSAVERRUNNING,Word(State),@OldSysParam,0);
    end;
    [/code]
    If you pass TRUE for the state, then all keys (ctrl+alt+del, ctrl+esc, alt+tab, etc.) are disabled. The only way I know of to get into windows is to reset the computer. Note: Be sure to pass FALSE after your program is finished protecting your computer.
  • ibyiby Posts: 323Member
    : : i am a beginer and am curently writing a simple password program, the program its self works fine its just that windows lets CTRL,ALT,DEL stop the program at will, is ther any way of stopping this just while the program is running.
    : :
    : Here is a small function, which will disable all keys to windows:
    : [code]
    : procedure DisableTaskmanager(State : boolean);
    : var
    : OldSysParam : longint;
    : begin
    : SystemParametersInfo(SPI_SCREENSAVERRUNNING,Word(State),@OldSysParam,0);
    : end;
    : [/code]
    : If you pass TRUE for the state, then all keys (ctrl+alt+del, ctrl+esc, alt+tab, etc.) are disabled. The only way I know of to get into windows is to reset the computer. Note: Be sure to pass FALSE after your program is finished protecting your computer.
    :

    Looks good, but where is the unit containing "SystemParametersInfo"?


    Iby

  • zibadianzibadian Posts: 6,349Member
    : : : i am a beginer and am curently writing a simple password program, the program its self works fine its just that windows lets CTRL,ALT,DEL stop the program at will, is ther any way of stopping this just while the program is running.
    : : :
    : : Here is a small function, which will disable all keys to windows:
    : : [code]
    : : procedure DisableTaskmanager(State : boolean);
    : : var
    : : OldSysParam : longint;
    : : begin
    : : SystemParametersInfo(SPI_SCREENSAVERRUNNING,Word(State),@OldSysParam,0);
    : : end;
    : : [/code]
    : : If you pass TRUE for the state, then all keys (ctrl+alt+del, ctrl+esc, alt+tab, etc.) are disabled. The only way I know of to get into windows is to reset the computer. Note: Be sure to pass FALSE after your program is finished protecting your computer.
    : :
    :
    : Looks good, but where is the unit containing "SystemParametersInfo"?
    :
    :
    : Iby
    :
    :
    It should be in the WinProcs or Windows function. If it is not, then here it is directly from the source:
    [code]
    const
    SPI_SCREENSAVERRUNNING = 97;

    function SystemParametersInfo(uiAction, uiParam: LongWord;
    pvParam: Pointer; fWinIni: LongWord): boolean;
    stdcall; external 'user32.dll' name 'SystemParametersInfoA';
    [/code]
    This only works within a windows environment. If your version of pascal doesn't recognize the name directive, then you need to change the function name to the one listed.
  • CroWCroW Posts: 348Member
    im not sure about this,but i have read sometime ago something about that topic on the msdn.there where an article about disabling crtl-alt-del on Win9x machines.i think there was something,that your way doesnt work on WinNT/ME/XP machines.they also have a article about doing this on newer win32-OSes with services or so.it looks fairly complicated.
  • zibadianzibadian Posts: 6,349Member
    : im not sure about this,but i have read sometime ago something about that topic on the msdn.there where an article about disabling crtl-alt-del on Win9x machines.i think there was something,that your way doesnt work on WinNT/ME/XP machines.they also have a article about doing this on newer win32-OSes with services or so.it looks fairly complicated.
    :
    It works on ME (I'm using it right now), as for the other systems, it is very difficult (if not impossible) to trap crtl-alt-del. I know of just one way to do it, but cannot implement it myself. Your programs needs to read the keyboard-port directly, even before windows. Then if it sees a crtl-alt-del, you can trap it and not send it to windows.
Sign In or Register to comment.