·  Start ·  Programme ·  Codes ·  Tipps ·  ActiveX ·  Tutorials · 



Mit diesem Beispiel deaktivieren Sie den "X"-Button rechts oben (Form_Close)

Private Declare Function GetSystemMenu Lib "user32" _
(ByVal hwnd As Long, ByVal bRevert As Long) As Long
 
Private Declare Function GetMenuItemCount Lib "user32" _
(ByVal hMenu As Long) As Long
 
Private Declare Function DrawMenuBar Lib "user32" _
(ByVal hwnd 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 MF_BYPOSITION = &H400&
Private Const MF_REMOVE = &H1000&
 
Private Sub Form_Load()
 
Dim hwndSysMen As Long
Dim nCount As Long
 
Me.Show
 
' Handle des Systemmenüs
hwndSysMen = GetSystemMenu(Me.hwnd, False)
 
If hwndSysMen Then
' Anzahl der Menü-Items
nCount = GetMenuItemCount(hwndSysMen)
 
  If nCount Then
    RemoveMenu hwndSysMen, nCount - 1, MF_BYPOSITION Or MF_REMOVE
    RemoveMenu hwndSysMen, nCount - 2, MF_BYPOSITION Or MF_REMOVE
    DrawMenuBar Me.hwnd
  End If
End If
 
End Sub
Aktualisiert: 12.02.2008, 14:10 Uhr Copyright © 2001 - 2010 by ST-software Navigation zurück  |  Navigation vorwärts  |  Zum Seitenanfang     
Ihre IP: 38.107.191.84 ·  Seite erstellt in: 0.439 Sekunden ·  Dateigröße:  2988 Bytes