Results 1 to 3 of 3

Thread: Disable Start Button?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Post

    Hi! I'm working on a children's program and have two questions.I don't want the kids to get into windows apps so I want to disable the start button.
    Question 1: Is this dangerous if the program should crash or freeze? I want start button to work if I alt-control-delete.
    Question 2: How do I disable start button?
    Thank You,
    Joey O

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Post

    Thanks Again Aaron,
    Next question:
    Same thing but disable Start Key on keyboard.
    This dangerous?

  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    This Example Disables the StartButton.. If it crashes/freezes then the button will remain Disabled, but you can Still Access the Menu via the Keyboard.
    Code:
    Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    
    Private Sub Command1_Click()
        Static bDisabled As Boolean
        Dim lHwnd As Long
        
        bDisabled = Not bDisabled
        lHwnd = FindWindowEx(0&, 0&, "Shell_TrayWnd", vbNullString)
        Call EnableWindow(FindWindowEx(lHwnd, 0&, "Button", vbNullString), Not bDisabled)
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    ajyoung@pressenter.com


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