Disable Maximize/Minimize/Restore in Access 2007

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • evenlater

    Disable Maximize/Minimize/Restore in Access 2007

    Is there a way to disable the maximize, minimize and restore buttons
    of the Access window in A2K7? I can't seem to find one. I am setting
    up an application that will be launched via Terminal Services but
    don't have seamless windows so I need to make sure the users can't get
    to the desktop.

    Thanks!
  • Tom van Stiphout

    #2
    Re: Disable Maximize/Minimize/Restore in Access 2007

    On Tue, 20 May 2008 10:37:33 -0700 (PDT), evenlater
    <evancater@gmai l.comwrote:

    Have you tried to set some form-level properties such as AutoResize
    and MinMaxButtons?

    -Tom.

    >Is there a way to disable the maximize, minimize and restore buttons
    >of the Access window in A2K7? I can't seem to find one. I am setting
    >up an application that will be launched via Terminal Services but
    >don't have seamless windows so I need to make sure the users can't get
    >to the desktop.
    >
    >Thanks!

    Comment

    • evenlater

      #3
      Re: Disable Maximize/Minimize/Restore in Access 2007

      On May 21, 8:57 pm, Tom van Stiphout <no.spam.tom7.. .@cox.netwrote:
      Have you tried to set some form-level properties such as AutoResize
      and MinMaxButtons?
      Yes, but that only applies to the form, not the Access window. I am
      trying to prevent my users from getting to the desktop at all.

      Comment

      • Tom van Stiphout

        #4
        Re: Disable Maximize/Minimize/Restore in Access 2007

        On Thu, 22 May 2008 19:13:56 -0700 (PDT), evenlater
        <evancater@gmai l.comwrote:

        That requires a fairly advanced level of programming, including
        subclassing of that window. You'll need a thorough understanding of
        the Windows API.

        -Tom.


        >On May 21, 8:57 pm, Tom van Stiphout <no.spam.tom7.. .@cox.netwrote:
        >Have you tried to set some form-level properties such as AutoResize
        >and MinMaxButtons?
        >
        >Yes, but that only applies to the form, not the Access window. I am
        >trying to prevent my users from getting to the desktop at all.

        Comment

        • Chuck Grimsby

          #5
          Re: Disable Maximize/Minimize/Restore in Access 2007


          Actually, the code for doing this was posted in the newsgroup a few
          years back, and it doesn't take all that much in the way of API calls.

          The real problem however, could be resolved by anyone competent in
          setting up Terminal Server and applications that run on them. The OP
          should *really* look at hiring one of those to set this application
          up.

          (There are ways around the API calls that make it next to useless for
          what the OP has stated as a requirement.)


          On Thu, 22 May 2008 20:51:54 -0700, Tom van Stiphout
          <no.spam.tom774 4@cox.netwrote:
          >On Thu, 22 May 2008 19:13:56 -0700 (PDT), evenlater
          ><evancater@gma il.comwrote:
          >
          >That requires a fairly advanced level of programming, including
          >subclassing of that window. You'll need a thorough understanding of
          >the Windows API.
          >
          >-Tom.
          >
          >
          >
          >>On May 21, 8:57 pm, Tom van Stiphout <no.spam.tom7.. .@cox.netwrote:
          >>Have you tried to set some form-level properties such as AutoResize
          >>and MinMaxButtons?
          >>
          >>Yes, but that only applies to the form, not the Access window. I am
          >>trying to prevent my users from getting to the desktop at all.
          --
          Please Post Any Replies To This Message Back To the Newsgroup.
          There are "Lurkers" around who can benefit by our exchange!

          Comment

          • The Frog

            #6
            Re: Disable Maximize/Minimize/Restore in Access 2007

            Hi Chuck,

            I did a quick skooch through the older posts but could not seem to
            locate the specific discussion you mention. Do you per chance happen
            to have a link you could post?

            Cheers

            The Frog

            Comment

            • Arno R

              #7
              Re: Disable Maximize/Minimize/Restore in Access 2007


              "The Frog" <Mr.Frog.to.you @googlemail.com schreef in bericht news:208ec9a5-d8a2-4021-bfc1-61212de6cf79@26 g2000hsk.google groups.com...
              Hi Chuck,

              I did a quick skooch through the older posts but could not seem to
              locate the specific discussion you mention. Do you per chance happen
              to have a link you could post?

              Cheers

              The Frog
              Paste the following code into a module, then call it with
              Call Buttons(false)
              To turn them off and
              Call Buttons(True)
              to turn them on

              ********** Code Start *************
              Option Explicit

              Private Const GWL_STYLE = (-16)
              Private Const WS_CAPTION = &HC00000
              Private Const WS_MINIMIZEBOX = &H20000
              Private Const WS_MAXIMIZEBOX = &H10000
              Private Const WS_SYSMENU = &H80000


              Private Const SWP_NOSIZE = &H1
              Private Const SWP_NOMOVE = &H2
              Private Const SWP_NOZORDER = &H4
              Public Const SWP_FRAMECHANGE D = &H20

              Private Declare Function GetWindowLong _
              Lib "user32" Alias "GetWindowLongA " ( _
              ByVal hwnd As Long, _
              ByVal nIndex As Long _
              ) 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 SetWindowPos _
              Lib "user32" ( _
              ByVal hwnd As Long, _
              ByVal hWndInsertAfter As Long, _
              ByVal X As Long, _
              ByVal Y As Long, _
              ByVal cx As Long, _
              ByVal cy As Long, _
              ByVal wFlags As Long _
              ) As Long
              ' *************** *************** *************** *****
              '

              Function AccessTitleBar( Show As Boolean) As Long
              Dim hwnd As Long
              Dim nIndex As Long
              Dim dwNewLong As Long
              Dim dwLong As Long
              Dim wFlags As Long

              hwnd = hWndAccessApp
              nIndex = GWL_STYLE
              wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGE D + SWP_NOMOVE

              dwLong = GetWindowLong(h wnd, nIndex)

              If Show Then
              dwNewLong = (dwLong Or WS_CAPTION)
              Else
              dwNewLong = (dwLong And Not WS_CAPTION)
              End If

              Call SetWindowLong(h wnd, nIndex, dwNewLong)
              Call SetWindowPos(hw nd, 0&, 0&, 0&, 0&, 0&, wFlags)
              End Function


              Function Buttons(Show As Boolean) As Long
              Dim hwnd As Long
              Dim nIndex As Long
              Dim dwNewLong As Long
              Dim dwLong As Long

              hwnd = hWndAccessApp
              nIndex = GWL_STYLE

              Const wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGE D + SWP_NOMOVE
              Const FLAGS_COMBI = WS_MINIMIZEBOX Or WS_MAXIMIZEBOX Or WS_SYSMENU

              dwLong = GetWindowLong(h wnd, nIndex)

              If Show Then
              dwNewLong = (dwLong Or FLAGS_COMBI)
              Else
              dwNewLong = (dwLong And Not FLAGS_COMBI)
              End If

              Call SetWindowLong(h wnd, nIndex, dwNewLong)
              Call SetWindowPos(hw nd, 0&, 0&, 0&, 0&, 0&, wFlags)
              End Function
              ' ********** Code End *************

              BTW: I think this code originates fromTerry Kreft

              Arno R

              Comment

              • Chuck Grimsby

                #8
                Re: Disable Maximize/Minimize/Restore in Access 2007


                When I said "a few years back", I was serious. You'll have to go back
                quite a few years to find the posts (1997-99 time frame). Search for
                "NoControlB ox" at Google, and you'll probably find the thread.

                I think that thread just discusses how to disable the controls,
                however there was also another thread that discussed totally removing
                the controls from the title bar, but I also remember we dropped the
                thread fairly quickly when we "were made aware of" what we were
                posting. (That thread may have been over in one of the VB discussion
                groups however....)

                Yeah, it's cool and rather fun to do, but it just makes users jump
                through hoops to overcome a "neat" little hack of yours. And the
                _last_ thing you want a user to do (especially in a database!) is to
                find their own "neat" tricks.


                On Wed, 28 May 2008 00:38:56 -0700 (PDT), The Frog
                <Mr.Frog.to.you @googlemail.com wrote:
                >I did a quick skooch through the older posts but could not seem to
                >locate the specific discussion you mention. Do you per chance happen
                >to have a link you could post?
                --
                Please Post Any Replies To This Message Back To the Newsgroup.
                There are "Lurkers" around who can benefit by our exchange!

                Comment

                • The Frog

                  #9
                  Re: Disable Maximize/Minimize/Restore in Access 2007

                  Thanks Arno and Chuck,

                  I will give this a crack with an MDE. Hopefully the code will work
                  happily in the MDE and not leave any permanent scars on the users
                  brains :-) It might just prove to be a bit of fun to tease some of the
                  IT guys 'upstairs' with (Tee hee hee).

                  Thanks Fellas

                  Cheers

                  The Frog

                  Comment

                  Working...