VB icon

Cool Ctrl + Alt + Del features class!!!

Email
Submitted on: 1/8/2015 4:44:00 PM
By: Kamen (from psc cd)  
Level: Beginner
User Rating: By 11 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 1671
 
     A short but handy and useful class module Desable/Enable Ctrl + Alt + del Show/ Hide application from Ctrl + Alt + Del list This is my second submission and it is quite short too so please vote for me or write some comments
 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :Cool Ctrl + Alt + Del features class!!!
'**************************************
Option Explicit
'Put this in class module
'
'A Class module for the Ctrl + Alt + Del features:
'Remove app from the list
'Restore app to list
'Disable/Enable Ctrl + Alt + Del
'Ex.
'
'Sub A()
'Dim C As New CtrlAltDel
'
'C.RemoveFromList 'remove your application
' 'from the list
'End Sub
'
'Send comments and ideas to kamen@sofianet.net
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 Declare Function GetCurrentProcessId _
Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess _
Lib "kernel32" ( _
 ByVal dwProcessID As Long, _
 ByVal dwType As Long _
) As Long
Const SPI_SCREENSAVERRUNNING = 97
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Public Sub RemoveFromList()
 Dim lngProcessID As Long
 
 lngProcessID = GetCurrentProcessId
 Call RegisterServiceProcess(lngProcessID, RSP_SIMPLE_SERVICE)
End Sub
Public Sub RestoreToList()
 Dim lngProcessID As Long
 lngProcessID = GetCurrentProcessId()
 Call RegisterServiceProcess(lngProcessID, RSP_UNREGISTER_SERVICE)
End Sub
Public Sub Disable()
 Dim cad As Boolean
 Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, _
True, cad, 0)
End Sub
Public Sub Enable()
 Dim cad As Boolean
 
 Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, _
False, cad, 0)
End Sub
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Cool Ctrl + Alt + Del features class!!!
' Description:A short but handy and useful class module
Desable/Enable Ctrl + Alt + del
Show/ Hide application from Ctrl + Alt + Del list
This is my second submission and it is quite short too so please vote for me or write some comments
' By: Kamen (from psc cd)
'**************************************

'this stays on the form
Private Sub cmdHide_Click()
 Dim C As New CtrlAltDel
 
 C.RemoveFromList 'this hide your application 
'from the list
End Sub


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.