help :confused:, i've just started visual basic 4.0. I wanted to know how I can make the x in the corner of the program to go away. I would also like to know how to disable ctrl+alt+delete.
if you reply, thanks.:D
Printable View
help :confused:, i've just started visual basic 4.0. I wanted to know how I can make the x in the corner of the program to go away. I would also like to know how to disable ctrl+alt+delete.
if you reply, thanks.:D
the X is called the Control button, set the property to false, note you may have to change the form to fixed single or something
'this code will disable [Alt-Tab ] or [ Ctrl-Alt-Del ]
'
'build a bas module and put this in it.
'
Private Declare Function EnableWindow Lib "user32" (ByVal hWnd As Integer, ByVal aBOOL As Integer) As Integer
Private Declare Function IsWindowEnabled Lib "user32" (ByVal hWnd As Integer) As Integer
Private Declare Function GetMenu Lib "user32" (ByVal hWnd As Integer) As Integer
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 TaskBarhWnd As Long
Private IsTaskBarEnabled As Integer
Private TaskBarMenuHwnd As Integer
Sub FastTaskSwitching(bEnabled As Boolean)
Dim X As Long, bDisabled As Long
bDisabled = Not bEnabled
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
Public Sub DisableTaskBar()
Dim EWindow As Integer
TaskBarhWnd = FindWindow("Shell_traywnd", "")
If TaskBarhWnd <> 0 Then
'check to see if window is enabled
EWindow = IsWindowEnabled(TaskBarhWnd)
If EWindow = 1 Then 'need to disable it
IsTaskBarEnabled = EnableWindow(TaskBarhWnd, 0)
End If
End If
End Sub
Public Sub EnableTaskBar()
If IsTaskBarEnabled = 0 Then
IsTaskBarEnabled = EnableWindow(TaskBarhWnd, 1)
End If
End Sub
'
'
' put 2 option buttons on your form
' option 1 = enable ....option 2 = disable
' code for click event of option buttons
Private Sub Option1_Click()
EnableTaskBar
FastTaskSwitching True
End Sub
Private Sub Option2_Click()
DisableTaskBar
FastTaskSwitching False
End Sub