Steuerungsmenü des Dialogfeldrahmens entfernen

FindWindowA, GetWindowLongA, SetWindowLongA
...oder auf hochdeutsch: Excel-Menü ausblenden (oben links im Fenster) und im DATEI-Menü die BEENDEN-Schaltfläche deaktivieren...
Declare Function FindWindowA Lib "user32" (ByVal lpClassName As Any, _
  ByVal lpWindowName As String) As Long
Declare Function GetWindowLongA Lib "user32" (ByVal hwnd As Long, _
  ByVal nIndex As Integer) As Long
Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, _
  ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
Global Const GWL_STYLE = (-16)
Global Const WS_SYSMENU = &H80000
Sub RemoveControlMenuExcel32() Assign to dialogframe's OnAction event.
Dim WindowStyle As Long, hwnd As Long, Result
 hwnd = FindWindowA("bosa_sdm_xl", _ bosa_sdm_xl is the class name for an Excel 5/7 dialog box. In Excel97
   ActiveDialog.DialogFrame.Text) it is bosa_sdm_xl8 (i.e. XL 5/7 style dialogs in XL97, notuserforms).
 WindowStyle = GetWindowLongA(hwnd, GWL_STYLE) Get the current windowstyle.
 WindowStyle = WindowStyle And (Not WS_SYSMENU) Turn off the System menu.
 Result = SetWindowLongA(hwnd, GWL_STYLE, WindowStyle) Set the style.
End Sub

 Ranking-Hits zurück Sitemap
Designed by www.wbrnet.info