Results 1 to 3 of 3

Thread: go away you dang x

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93

    Question

    help , 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.

  2. #2
    Guest
    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

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946


    '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
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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