Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Window's System Menu, can't remove menu
Not to find how to trap window closing i'm trying to disable "X"-button,
and System menu. With API. API's "RemoveMenu" works with Forms but not with Worksheet Windows!!! "X"-button can be disabled, but System Menu - can't!! is it impossible to remove items of System Menu of a Worksheet Window???? Yury |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Window's System Menu, can't remove menu
I think people typically use Tools, Protection, Protect Workbook, Windows to
get to where you want to go. -- Jim Rech Excel MVP |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Window's System Menu, can't remove menu
Yuri,
If you make your userform full screen, *none* of the toolbars are accessible. Disable the "X" on your form and the only way a user can get out of the form is to click your Exit button on the form. Private Sub UserForm_Initialize() With Application Me.Top = .Top Me.Left = .Left Me.Height = .Height Me.Width = .Width End With End Sub HTH Henry "Yury Lobanov" wrote in message ... Not to find how to trap window closing i'm trying to disable "X"-button, and System menu. With API. API's "RemoveMenu" works with Forms but not with Worksheet Windows!!! "X"-button can be disabled, but System Menu - can't!! is it impossible to remove items of System Menu of a Worksheet Window???? Yury |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Window's System Menu, can't remove menu
Hi Yuri;
You can try (in the ThisWorkbook module): Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _ (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String _ , ByVal lpsz2 As String) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _ (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _ (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Sub Workbook_Open() Application.WindowState = xlMaximized With ActiveWindow .WindowState = xlNormal .Top = 0: .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With Dim hWnd(1 To 3) As Long hWnd(1) = FindWindow("XLMAIN", Application.Caption) hWnd(2) = FindWindowEx(hWnd(1), ByVal 0&, "XLDESK", vbNullString) hWnd(3) = FindWindowEx(hWnd(2), ByVal 0&, "EXCEL7", ActiveWindow.Caption) SetWindowLong hWnd(3), -16, GetWindowLong(hWnd(3), -16) And Not &HC00000 End Sub MP "Yury Lobanov" a écrit dans le message de ... Not to find how to trap window closing i'm trying to disable "X"-button, and System menu. With API. API's "RemoveMenu" works with Forms but not with Worksheet Windows!!! "X"-button can be disabled, but System Menu - can't!! is it impossible to remove items of System Menu of a Worksheet Window???? Yury |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove PDF menu | Excel Discussion (Misc queries) | |||
Drop dwn menu. Formula to count selection frm menu in anoth cell? | Excel Worksheet Functions | |||
Remove element from menu | Excel Discussion (Misc queries) | |||
Remove custom menu | Excel Discussion (Misc queries) | |||
Menu items added with menu item editor in older versions | Excel Discussion (Misc queries) |