Results 1 to 9 of 9
  1. #1
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Application close button (XP)

    I am trying to force the user to use the quit command button and other navigation buttons. I want the application title bar close icon to be unavailable to the user (the red/white x ). Is this possible?
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Application close button (XP)

    Yes, that's possible with the use of some Windows API code. See MSKB article How to disable the Close button on the Application window and the Exit command on the File menu.

  3. #3
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application close button (XP)

    Thanks Hans.
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  4. #4
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application close button (XP)

    Hi Hans,

    I created the form, as per the article, which works fine. How do I get the code to run as the application is opened?
    Many thanks.
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Application close button (XP)

    If your database has a startup form, you can put SetEnabledState False in the On Open or On Load event of that form.

    If not, you can create a macro named AutoExecute that has one action: RunCode, with SetEnabledState(False) as argument.

  6. #6
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application close button (XP)

    Sorry to be so obtuse, Hans, but can you be a little more explicit. Do I just paste "SetEnabledState False" as it stands into the on load event of the switchboard form (which is my opening form)? I have tried this but it doesn't seem to work.
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  7. #7
    4 Star Lounger
    Join Date
    Sep 2002
    Location
    Stafford, Staffordshire, England
    Posts
    585
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application close button (XP)

    All figured out. I used "SetEnabledState(False)" in the event procedure, without my typo - a space before the "F" in "False". Thanks again, Hans, for the help.
    <font color=blue><font face="Script MT Bold"><big>Rob</big></font face=script></font color=blue>

  8. #8
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application close button (XP)

    <hr>Sorry to be so obtuse,<hr>
    You're a triangle? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Application close button (XP)

    Triangles can be quite acute on occasion!

Posting Permissions

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