+ Reply to Thread
Results 1 to 7 of 7

Maximise and Minimise buttons

  1. #1
    Jason Zischke
    Guest

    Maximise and Minimise buttons

    Hi All,

    Is there a way to disable the minimise and maximise buttons at the top right
    hand corner in excel I've got the close button to disable so that the only to
    close the program is my way but is there any way to disable these?

    Thanks in advance

    Jason

  2. #2
    Tom Ogilvy
    Guest

    Re: Maximise and Minimise buttons

    http://support.microsoft.com/kb/213502/EN-US/
    XL2000: How to Programmatically Disable Microsoft Excel Control Menu
    Commands

    --
    Regards,
    Tom Ogilvy



    "Jason Zischke" <[email protected]> wrote in message
    news:[email protected]...
    > Hi All,
    >
    > Is there a way to disable the minimise and maximise buttons at the top

    right
    > hand corner in excel I've got the close button to disable so that the only

    to
    > close the program is my way but is there any way to disable these?
    >
    > Thanks in advance
    >
    > Jason




  3. #3
    Jason Zischke
    Guest

    Re: Maximise and Minimise buttons

    Hi Tom

    This worked on disabling them in the right click menu but didn't disable the
    buttons.

    Regards

    Jason

    "Tom Ogilvy" wrote:

    > http://support.microsoft.com/kb/213502/EN-US/
    > XL2000: How to Programmatically Disable Microsoft Excel Control Menu
    > Commands
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > "Jason Zischke" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi All,
    > >
    > > Is there a way to disable the minimise and maximise buttons at the top

    > right
    > > hand corner in excel I've got the close button to disable so that the only

    > to
    > > close the program is my way but is there any way to disable these?
    > >
    > > Thanks in advance
    > >
    > > Jason

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Maximise and Minimise buttons

    In contrast, It worked for me.

    Did you actually try the buttons.

    The buttons were still there and would depress, but did nothing.


    --
    Regards,
    Tom Ogilvy




    "Jason Zischke" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Tom
    >
    > This worked on disabling them in the right click menu but didn't disable

    the
    > buttons.
    >
    > Regards
    >
    > Jason
    >
    > "Tom Ogilvy" wrote:
    >
    > > http://support.microsoft.com/kb/213502/EN-US/
    > > XL2000: How to Programmatically Disable Microsoft Excel Control Menu
    > > Commands
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > >
    > > "Jason Zischke" <[email protected]> wrote in

    message
    > > news:[email protected]...
    > > > Hi All,
    > > >
    > > > Is there a way to disable the minimise and maximise buttons at the top

    > > right
    > > > hand corner in excel I've got the close button to disable so that the

    only
    > > to
    > > > close the program is my way but is there any way to disable these?
    > > >
    > > > Thanks in advance
    > > >
    > > > Jason

    > >
    > >
    > >




  5. #5
    Jason Zischke
    Guest

    Re: Maximise and Minimise buttons

    Hi Tom

    I tried it again and still got the same result, am I doing something wrong
    below is the code.

    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

    Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, _
    ByVal bRevert As Integer) As Integer

    Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Integer, _
    ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer

    Sub Disable_Control()
    Dim X As Integer, hwnd As Long
    hwnd = FindWindow("XLMain", Application.Caption)
    For X = 1 To 9
    'Delete the first menu command and loop until
    'all commands are deleted
    Call DeleteMenu(GetSystemMenu(hwnd, False), 0, 1024)
    Next X
    End Sub

    Sub RestoreSystemMenu()
    Dim hwnd As Long
    'get the window handle of the Excel application
    hwnd = FindWindow("xlMain", Application.Caption)
    'restore system menu to original state
    hMenu% = GetSystemMenu(hwnd, 1)
    End Sub


    Sub Disable_Control2()
    Dim X As Integer, hwnd As Long
    hwnd = FindWindow("XLMain", Application.Caption)
    Call DeleteMenu(GetSystemMenu(FindWindow("xlMain", _
    Application.Caption), False), 4, 1024)
    Call DeleteMenu(GetSystemMenu(FindWindow("xlMain", _
    Application.Caption), False), 3, 1024)
    End Sub

    Any help would be Greatly Appreciated

    Jason


    "Tom Ogilvy" wrote:

    > In contrast, It worked for me.
    >
    > Did you actually try the buttons.
    >
    > The buttons were still there and would depress, but did nothing.
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    >
    > "Jason Zischke" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi Tom
    > >
    > > This worked on disabling them in the right click menu but didn't disable

    > the
    > > buttons.
    > >
    > > Regards
    > >
    > > Jason
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > http://support.microsoft.com/kb/213502/EN-US/
    > > > XL2000: How to Programmatically Disable Microsoft Excel Control Menu
    > > > Commands
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > >
    > > >
    > > > "Jason Zischke" <[email protected]> wrote in

    > message
    > > > news:[email protected]...
    > > > > Hi All,
    > > > >
    > > > > Is there a way to disable the minimise and maximise buttons at the top
    > > > right
    > > > > hand corner in excel I've got the close button to disable so that the

    > only
    > > > to
    > > > > close the program is my way but is there any way to disable these?
    > > > >
    > > > > Thanks in advance
    > > > >
    > > > > Jason
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Tom Ogilvy
    Guest

    Re: Maximise and Minimise buttons

    I tested the code in the article (your first two procedures) in xl97 on
    Windows 98 SE and xl2002 on Windows 2000. It worked in both cases. I
    tested you Disable_Control2 in xl2002 on Windows 2000. It worked in all
    cases. In all cases, the code was placed in a general module with the
    declarations at the top of the module above any procedures.

    A later version of the article
    http://support.microsoft.com/default...b;en-us;814562

    for xl2002 also has references to the version for xl97 and xl2000. None
    talk about a specific operating system, so to the best of my knowledge, it
    should work in Windows XP as well.

    --
    Regards,
    Tom Ogilvy


    "Jason Zischke" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Tom
    >
    > I tried it again and still got the same result, am I doing something wrong
    > below is the code.
    >
    > Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    > (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    >
    > Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, _
    > ByVal bRevert As Integer) As Integer
    >
    > Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Integer, _
    > ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
    >
    > Sub Disable_Control()
    > Dim X As Integer, hwnd As Long
    > hwnd = FindWindow("XLMain", Application.Caption)
    > For X = 1 To 9
    > 'Delete the first menu command and loop until
    > 'all commands are deleted
    > Call DeleteMenu(GetSystemMenu(hwnd, False), 0, 1024)
    > Next X
    > End Sub
    >
    > Sub RestoreSystemMenu()
    > Dim hwnd As Long
    > 'get the window handle of the Excel application
    > hwnd = FindWindow("xlMain", Application.Caption)
    > 'restore system menu to original state
    > hMenu% = GetSystemMenu(hwnd, 1)
    > End Sub
    >
    >
    > Sub Disable_Control2()
    > Dim X As Integer, hwnd As Long
    > hwnd = FindWindow("XLMain", Application.Caption)
    > Call DeleteMenu(GetSystemMenu(FindWindow("xlMain", _
    > Application.Caption), False), 4, 1024)
    > Call DeleteMenu(GetSystemMenu(FindWindow("xlMain", _
    > Application.Caption), False), 3, 1024)
    > End Sub
    >
    > Any help would be Greatly Appreciated
    >
    > Jason
    >
    >
    > "Tom Ogilvy" wrote:
    >
    > > In contrast, It worked for me.
    > >
    > > Did you actually try the buttons.
    > >
    > > The buttons were still there and would depress, but did nothing.
    > >
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > >
    > >
    > > "Jason Zischke" <[email protected]> wrote in

    message
    > > news:[email protected]...
    > > > Hi Tom
    > > >
    > > > This worked on disabling them in the right click menu but didn't

    disable
    > > the
    > > > buttons.
    > > >
    > > > Regards
    > > >
    > > > Jason
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > http://support.microsoft.com/kb/213502/EN-US/
    > > > > XL2000: How to Programmatically Disable Microsoft Excel Control Menu
    > > > > Commands
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > >
    > > > >
    > > > > "Jason Zischke" <[email protected]> wrote in

    > > message
    > > > > news:[email protected]...
    > > > > > Hi All,
    > > > > >
    > > > > > Is there a way to disable the minimise and maximise buttons at the

    top
    > > > > right
    > > > > > hand corner in excel I've got the close button to disable so that

    the
    > > only
    > > > > to
    > > > > > close the program is my way but is there any way to disable these?
    > > > > >
    > > > > > Thanks in advance
    > > > > >
    > > > > > Jason
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




  7. #7
    Jason Zischke
    Guest

    Re: Maximise and Minimise buttons

    Hi Tom,

    Thanks, the later version of the article worked great.

    Jason

    "Tom Ogilvy" wrote:

    > I tested the code in the article (your first two procedures) in xl97 on
    > Windows 98 SE and xl2002 on Windows 2000. It worked in both cases. I
    > tested you Disable_Control2 in xl2002 on Windows 2000. It worked in all
    > cases. In all cases, the code was placed in a general module with the
    > declarations at the top of the module above any procedures.
    >
    > A later version of the article
    > http://support.microsoft.com/default...b;en-us;814562
    >
    > for xl2002 also has references to the version for xl97 and xl2000. None
    > talk about a specific operating system, so to the best of my knowledge, it
    > should work in Windows XP as well.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Jason Zischke" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi Tom
    > >
    > > I tried it again and still got the same result, am I doing something wrong
    > > below is the code.
    > >
    > > Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    > > (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    > >
    > > Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, _
    > > ByVal bRevert As Integer) As Integer
    > >
    > > Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Integer, _
    > > ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
    > >
    > > Sub Disable_Control()
    > > Dim X As Integer, hwnd As Long
    > > hwnd = FindWindow("XLMain", Application.Caption)
    > > For X = 1 To 9
    > > 'Delete the first menu command and loop until
    > > 'all commands are deleted
    > > Call DeleteMenu(GetSystemMenu(hwnd, False), 0, 1024)
    > > Next X
    > > End Sub
    > >
    > > Sub RestoreSystemMenu()
    > > Dim hwnd As Long
    > > 'get the window handle of the Excel application
    > > hwnd = FindWindow("xlMain", Application.Caption)
    > > 'restore system menu to original state
    > > hMenu% = GetSystemMenu(hwnd, 1)
    > > End Sub
    > >
    > >
    > > Sub Disable_Control2()
    > > Dim X As Integer, hwnd As Long
    > > hwnd = FindWindow("XLMain", Application.Caption)
    > > Call DeleteMenu(GetSystemMenu(FindWindow("xlMain", _
    > > Application.Caption), False), 4, 1024)
    > > Call DeleteMenu(GetSystemMenu(FindWindow("xlMain", _
    > > Application.Caption), False), 3, 1024)
    > > End Sub
    > >
    > > Any help would be Greatly Appreciated
    > >
    > > Jason
    > >
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > In contrast, It worked for me.
    > > >
    > > > Did you actually try the buttons.
    > > >
    > > > The buttons were still there and would depress, but did nothing.
    > > >
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > >
    > > >
    > > >
    > > > "Jason Zischke" <[email protected]> wrote in

    > message
    > > > news:[email protected]...
    > > > > Hi Tom
    > > > >
    > > > > This worked on disabling them in the right click menu but didn't

    > disable
    > > > the
    > > > > buttons.
    > > > >
    > > > > Regards
    > > > >
    > > > > Jason
    > > > >
    > > > > "Tom Ogilvy" wrote:
    > > > >
    > > > > > http://support.microsoft.com/kb/213502/EN-US/
    > > > > > XL2000: How to Programmatically Disable Microsoft Excel Control Menu
    > > > > > Commands
    > > > > >
    > > > > > --
    > > > > > Regards,
    > > > > > Tom Ogilvy
    > > > > >
    > > > > >
    > > > > >
    > > > > > "Jason Zischke" <[email protected]> wrote in
    > > > message
    > > > > > news:[email protected]...
    > > > > > > Hi All,
    > > > > > >
    > > > > > > Is there a way to disable the minimise and maximise buttons at the

    > top
    > > > > > right
    > > > > > > hand corner in excel I've got the close button to disable so that

    > the
    > > > only
    > > > > > to
    > > > > > > close the program is my way but is there any way to disable these?
    > > > > > >
    > > > > > > Thanks in advance
    > > > > > >
    > > > > > > Jason
    > > > > >
    > > > > >
    > > > > >
    > > >
    > > >
    > > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1