Results 1 to 2 of 2

Thread: Making New Start Button - SetParent

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    Upstate NY
    Posts
    210
    I am making a program that limits the useage of a computer. It will disable certain icons, and functions, stop DOS programs from being run etc. Prevent access to key files such as win.ini, autoexec.bat, etc. I am trying to create a new start button, that will display only certain options. I have made a button that looks identical to the start menu, it is Command1. I am using SetParent to put the start button in place, once it is put into place, my program freezes and so does the new start button.
    Code:
    Option Explicit
    Private Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String)
    Private Declare Function SetParent& Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long)
    
    Private Sub Form_Load()
    Dim a&
    Dim b&
    a& = FindWindow("Shell_TrayWnd", vbNullString)
    Call SetParent(Command1.hwnd, a&)
    Command1.Left = 0
    Command1.Top = 1
    End Sub
    Can anyone help me with this?
    < o >

  2. #2
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    is this going to be a program that they have to run? If so, then why don't you make your program the shell instead of explorer.exe. No funny parent setting then (a good way to crash explorer, by the way).
    Instead of trying to disable certain things, you just never add them to start with.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

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