Results 1 to 5 of 5

Thread: How to deactivate the close option(Ctrl+Alt+Del)for my application?

  1. #1

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265

    Post

    I have an application that should not be closed by pressing CTRL+ALT+DEL or in other words "End task". It is a standard EXE only.
    Please reply.

    Thanx,
    Jebs.

  2. #2
    Addicted Member
    Join Date
    Feb 2000
    Posts
    224

    Post

    Win32 provides no direct method for disabling task-switching functions.
    They are, however, disabled whenever the screen saver is active in order to
    provide for password-protected savers. This can be exploited under Windows
    95 by using API calls to declare the current application to be an active
    screen saver. The actual screen saver will not start while this is in
    effect. This also does not function under Windows NT.

    Private Declare Function SystemParametersInfo Lib "user32" _
    Alias "SystemParametersInfoA" (ByVal uAction As Long, _
    ByVal uParam As Long, lpvParam As Any, _
    ByVal fuWinIni As Long) As Long
    Private Const SPI_SCREENSAVERRUNNING = 97

    Private Sub cmdDisable_Click()
    SystemParametersInfo SPI_SCREENSAVERRUNNING, True, ByVal 1&, 0
    End Sub

    Private Sub cmdEnable_Click()
    SystemParametersInfo SPI_SCREENSAVERRUNNING, False, ByVal 1&, 0
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    ' re-enable Ctrl+Alt+Del and Alt+Tab before the program terminates!
    cmdEnable_Click
    End Sub

    '*************************************

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Post

    just search vb-world for disable,
    that's how i found it


    ------------------
    david
    Teenage Programmer


  4. #4
    Guest

    Post

    why you don't register you're programm as service ??? (then it i hiden on the CTRL+ALT+DEL Tasklist)

    here the code: (works not on NT)

    Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
    Public Declare Function GetCurrentProcess Lib "kernel32" () As Long
    Public Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
    Public Const RSP_SIMPLE_SERVICE = 1
    Public Const RSP_UNREGISTER_SERVICE = 0
    Public Sub MakeMeService()
    Dim pid As Long
    Dim reserv As Long
    pid = GetCurrentProcessId()
    regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
    End Sub
    Public Sub UnMakeMeService()
    Dim pid As Long
    Dim reserv As Long
    pid = GetCurrentProcessId()
    regserv = RegisterServiceProcess(pid, _
    RSP_UNREGISTER_SERVICE)
    End Sub

    [This message has been edited by taLON (edited 02-09-2000).]

  5. #5

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265

    Post

    thank u guys for your support.

    bye!
    jebs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width