Results 1 to 8 of 8

Thread: Trying to perform action when user ctrl-alt-del's

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Miramichi, New Brunswick
    Posts
    5

    Post


    In my prog, I am hiding the taskbar when it starts and bringing it back when the user quits, but my problem is when the user quits by ctrl-alt-del, the task bar doesnt come back. I am trying to figure out which method I can put my code to bring it back.

    Michael Raczynski
    Developer

  2. #2
    Junior Member
    Join Date
    Feb 2000
    Location
    England
    Posts
    26

    Post

    Is there any reason why you can't disable the Crtl, Alt ,Del ?.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Miramichi, New Brunswick
    Posts
    5

    Post

    Hutchie,

    Well if my program crashes for 'some' reason, wouldnt it be nice to let the user ctrl-alt-del, instead of re booting?

    Michael Raczynski

  4. #4
    Junior Member
    Join Date
    Feb 2000
    Location
    England
    Posts
    26

    Post

    Fair Comment !!

  5. #5
    Guest

    Post

    and if you put a code in FORM_TERMINATE that re-shows the taskbar ?

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    Miramichi, New Brunswick
    Posts
    5

    Post

    Talon,

    I have tried the form_unload, form_query_unload, and the form_terminate. Not one of those three work. I am guessing that there is a call made to a specific method when the user closes the program via ctrl-alt-del.

    If anyone knows this method, plese let me know!

    Michael Raczynski
    Developer

    [This message has been edited by Michael Raczynski (edited 02-21-2000).]

  7. #7
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Post

    Strange that the Query_Unload event didn't work. It always worked fine for me.
    eg
    Code:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        If UnloadMode = vbAppTaskManager Then
            'do your stuff
        End If
    End Sub

  8. #8
    Guest

    Post

    mhhh.... other way is to make install you're app as an service... so it isn't listed in the ctrl+alt+entf 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
    ---------
    hope that helps....


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