jump to navigation

Disable CTRL-ALT-DEL Thu - Mar 14, 2002

Posted by supriyatna in Programming, Windows.
Tags: , , ,
trackback

Kadang kalanya kita menginginkan agar user tidak dapat sembarang menekan tombol sakti CTL-ALT-DEL, sehingga tidak mengganggu kerja sistem yang ada.

Trik untuk mengarasi hal ini yaitu dengan menggunakan API. Logika sebenarnya adalah memaksa window ke modus screen server, sehingga seolah-olah window sedang menjalankan screen server.

Option Explicit

Private Const SPI_SCREENSAVERRUNNING = 97&

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 Sub Command1_Click()
  ' Disable ctrl-alt-del dan alt-tab
  Dim lngRetVal    As Long
  Dim blnPrevValue As Boolean
  lngRetVal = SystemParametersInfo(SPI_SCREENSAVERRUNNING, _
    True, _
    blnPrevValue, 0&)
End Sub

Private Sub Command2_Click()
  'Enable ctrl-alt-del dan alt-tab
  Dim lngRetVal    As Long
  Dim blnPrevValue As Boolean
  lngRetVal = SystemParametersInfo(SPI_SCREENSAVERRUNNING, _
    False, _
    blnPrevValue, 0&)
End Sub

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: