MENGHILANGKAN FUNGSI ICON "X" DI FORM KALIAN
tinggaL kOpas aJa di Form...
Private Declare Function _
GetSystemMenu Lib "user32" ( _
ByVal hwnd As Long, _
ByVal bRevert As Boolean) As Long
Private Declare Function _
GetMenuItemCount Lib "user32" ( _
ByVal hMenu 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 Declare Function _
DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Const MF_REMOVE = &H1000&
Public Sub NonAktifClose(frm As Form, _
Optional Disable As Boolean = True)
Dim hMenu As Long
Dim nCount As Long
If Disable Then
hMenu = GetSystemMenu(frm.hwnd, False)
nCount = GetMenuItemCount(hMenu)
Call RemoveMenu(hMenu, nCount - 1, MF_REMOVE Or _
MF_BYPOSITION)
Call RemoveMenu(hMenu, nCount - 2, MF_REMOVE Or _
MF_BYPOSITION)
DrawMenuBar frm.hwnd
Else
GetSystemMenu frm.hwnd, True
DrawMenuBar frm.hwnd
End If
End Sub
Private Sub MDIForm_Load()
NonAktifClose Me, True
End Sub
Selamat Mencoba kawan...
