Results 1 to 3 of 3

Thread: cancel logoff

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    4

    Question cancel logoff

    My question is if my application is running and the user tries to
    logoff or shutdown he should not be able to do it.
    Bhappi

  2. #2
    jim mcnamara
    Guest
    To prevent users from getting or starting other windows set your from to system modal, it blocks ALT-TAB:

    Code:
    Declare Function SetSysModalWindow Lib "User" (ByVal hwnd%) As Integer 
    
    i = SetSysModalWindow(From1.hwnd)
    You still have to block CTRL-ALT-DEL. Do a search on this forum. Lots of good answers on how to do this.

    PS: the type of app you're making had better tell users it has locked the sytem and actively shows that its doing something.
    It's the kind of thing that makes users angry - angry enough to unplug the PC, because they think it's locked up. My best advice is DON'T DO IT.

  3. #3
    jim mcnamara
    Guest
    For Win9x systems you can stop ctrl-alt-del with:
    Code:
    Private Declare Function SystemParametersInfo Lib _
    "user32" Alias "SystemParametersInfoA" (ByVal uAction _
    As Long, ByVal uParam As Long, ByVal lpvParam As Any, _
    ByVal fuWinIni As Long) As Long
    
    Private Const SPI_SETSCREENSAVERRUNNING = 97
    
    ' DISABLED = TRUE TO DISABLE CTRL-ALT-DELETE
    ' DISABLED = FALSE TO RE-ENABLE
    
        Dim lRet As Long
        lRet = SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, _
          Disabled, 0&, 0&)
    I do not know how to do this on NT

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