Results 1 to 2 of 2

Thread: Removing the Close 'X' from a form.......how?

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    52

    Question

    Can anyone please help me, i am writing a login script for win95 machines and i need to know how to remove the 'X' from the top right of a form so it cannot simlpy be closed.

    Additionally, does anyone know what the specific command is to execute the windows shutdown sequence without the option screen?


    All help would be much appreciated.

    Morpheus.

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

    <?>

    the ControlBox property will remove the min/max/and close button...if you want the other two on you can do this.

    Code:
    'disable the close and greying out the x of the form window
    
    Private Declare Function GetSystemMenu _
    Lib "User32" (ByVal hWnd As Integer, _
    ByVal bRevert As Integer) As Integer
    
    Private Declare Function RemoveMenu Lib _
    "User32" (ByVal hMenu As Integer, ByVal nPosition As Integer, _
    ByVal wFlags As Integer) As Integer
    Const MF_BYPOSITION = &H400
    
    Private Sub Form_Load()
        Call RemoveMenu(GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION)
    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