|
Thread: Vb6
-
Dec 2nd, 2002, 08:16 PM
#1
Thread Starter
Addicted Member
Vb6
Hi,
I hava a form in which I have given the user the
TERMINATE button.
I dont want the user to click on the (CLOSE WINDOW) button
of the form ( on the top right corner) .
Can I defuse that close sign which is next to the
minimize and maximize button with the help pf form
properties.
thnks
-
Dec 2nd, 2002, 08:18 PM
#2
This question has been asked and answered many times. Please use the forum Search and you'll find the answer. You should also click the How to Get Your Questions Answered link in my signature.
-
Dec 2nd, 2002, 08:19 PM
#3
This will disable the Close button.
VB Code:
Option Explicit
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 Const SC_CLOSE = &HF060&
Private Const MF_BYCOMMAND = &H0&
Private Sub Form_Load()
Dim hMnu As Long
hMnu = GetSystemMenu(Me.hwnd, False)
Call RemoveMenu(hMnu, SC_CLOSE, MF_BYCOMMAND)
End Sub
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 2nd, 2002, 08:20 PM
#4
Originally posted by MartinLiss
This question has been asked and answered many times. Please use the forum Search and you'll find the answer. You should also click the How to Get Your Questions Answered link in my signature.
Yeah, that too.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 2nd, 2002, 08:29 PM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|