Category

마메의여행기 (252)
사진 (84)
여행 (11)
등산 (30)
정보 (91)
개발 (36)

Search

Blog Menu

[C#.NET] Close [x] 버튼 표시하지 않기


'標準モジュール
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function EnableMenuItem Lib "user32" (ByVal hMenu As Long, ByVal wIDEnableItem As Long, ByVal wEnable As Long) As Long
   
Public Const MF_DISABLED = &H2&
Public Const MF_ENABLED = &H0&
Public Const SC_CLOSE = &HF060&

'Form Load
Dim hMenu As Long
Dim lret As Long
  
hMenu = GetSystemMenu(Me.hwnd, 0)
lret = EnableMenuItem(hMenu, SC_CLOSE, MF_DISABLED)