AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

How to disable the X button of the controlbox?

Create a new .exe project and in the load event of form1 put:

Const MF_BYPOSITION = &H400
Private Declare Function GetSystemMenu Lib "User32" _
(ByVal hWnd As Long, ByVal bRevert _
As Long) As Long
Private Declare Function RemoveMenu Lib "User32" _
(ByVal hMenu As Long, ByVal nPosition _
As Long, ByVal wFlags As Long) As Long
Private Sub Form_Load()
    RemoveMenu GetSystemMenu(Me.hWnd, 0), 6, MF_BYPOSITION
End Sub


Execute the app. (F5) and you`ll see the X ("close") button is disabled

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/