Results 1 to 7 of 7

Thread: What about ALT+F6 and F4

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Skopje,Macedonia
    Posts
    20
    Hello!
    I did a lot of things to secure my application from shutting off, like CTRL+ALT+DEL tip, ALT+F4 etc, but one problem still exist. I found out that any VB app can be shutted off with the following combination: Press ALT+F6 then still holding ALT key press F4. Does anyone know how to solve this problem?
    Thank you!
    Emi

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    Not many people know about that combination
    NXSupport - Your one-stop source for computer help

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Thumbs up Put some magic in the QueryUnload Events

    You must detect the unload mode under the QueryUnload events:

    Code:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    'This will cause the application will only unload when is call by the VB code.
    'Example: 
    'Private Sub Command1_Click()
    '   End
    'End Sub
    If UnloadMode <> vbFormCode Then Cancel = 1
    End Sub

  4. #4
    Hyperactive Member
    Join Date
    Dec 1999
    Posts
    321

    Unhappy Nothing is immune to Ctrl+Alt+Del

    There is no possible way (known to me) to make an application which can't be shutted down by the user. Theres always the Ctrl+Alt+Del method, if running Windows 95 or 98 then you can just use something like WinTop32.exe (comes with Power Toys which is free from Microsoft) which shows all processes running where you can terminate whichever you want. I NT, nothing beats the Task Manager.

    You could try to name the project it something that looks like a system process: Udpsvr32.exe

    The only way is to compile a vxd which would be loaded at the startup of windows, for instance, so this can't be shut down. But it's kind of difficult with vb, (just for not saying impossible).

    Signed, Rodik ([email protected])
    Programmer,usesVB6ED
    ===========================
    Copyright©RodikCo,2002.

    Dont mind this signature ;] Its old

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    YOu can hehe, avoid that too, if you cancel the shutdown progress, and you can make it not shown in ctrl+alt+del list. But anyway you can't avoid someone pressing reset, ok maybe, but you can't avoid someone turning off the power, ok maybe but you can't avoid someone pulling the plug!
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    acctullay it is possible, I saw it done before

    what happens is that it takes 2 seconds for the power to go off completely after you pull the plug. So it takes 1 second for the program to fiqure out about the loss of power, and it copies (or deleted, not sure) a samll file to the computer and then windows doesn't work
    NXSupport - Your one-stop source for computer help

  7. #7
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Re: Nothing is immune to Ctrl+Alt+Del

    Originally posted by Rodik
    There is no possible way (known to me) to make an application which can't be shutted down by the user. Theres always the Ctrl+Alt+Del method, if running Windows 95 or 98 then you can just use something like WinTop32.exe (comes with Power Toys which is free from Microsoft) which shows all processes running where you can terminate whichever you want. I NT, nothing beats the Task Manager.

    You could try to name the project it something that looks like a system process: Udpsvr32.exe

    The only way is to compile a vxd which would be loaded at the startup of windows, for instance, so this can't be shut down. But it's kind of difficult with vb, (just for not saying impossible).

    Hi dimava,
    If you talking about the Task Manager in win9x platform, I've some code which can made your application invisible from the Task Manager. So it is totally made your application can't shut down by the user without a proper procedure that you've define in your application itself.

    Code:
    Option Explicit
    Dim pid As Long
    Dim reserv As Long
    
    Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
    Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
    Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
    
    Private Const RSP_SIMPLE_SERVICE = 1
    Private Const RSP_UNREGISTER_SERVICE = 0
    
    Private Sub Command1_Click()
    'Hide your program from the Task Manager list
    pid = GetCurrentProcessId()
    reserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
    End Sub
    
    Private Sub Command2_Click()
    'Unhide your program from the Task Manager list
    pid = GetCurrentProcessId()
    reserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
    End Sub

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