I'm currently designing my project by applying skin. At this moment, my code for disabling close button is being disregarded to the form where the activeskin is applied.
Can somebody tell me what code should I'm goin to change/add here:
'module
Option Explicit
Public Declare Function GetSystemMenu Lib "user32" _
(ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Public Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Public Const MF_BYPOSITION = &H400&
Public Sub DisableCloseWindowButton(frm As Form)
Dim hSysMenu As Long
hSysMenu = GetSystemMenu(frm.hwnd, 0)
RemoveMenu hSysMenu, 6, MF_BYPOSITION
RemoveMenu hSysMenu, 5, MF_BYPOSITION
End Sub
And this short code for the form:
DisableCloseWindowButton Me

New Topic/Question
Reply



MultiQuote







|