Keeping Access Open - System Modal Min/Max 
Author Message
 Keeping Access Open - System Modal Min/Max

I'm porting a dedicated Access 2000 application from 2.0.  I need to
prevent the users from closing the application window and also from
minimizing it.  I did this in the past with GetSysModalWindow and the
like.  But that call is now obsolete.  Can anyone direct me to the
system calls that would allow me to do this.

P.S.  I'd like to exit the application only in code after cleanup and
getting past a password.  This has already been implemented.

Thanks.

Mark Longerbeam
BME Systems Inc.



Mon, 05 May 2003 03:00:00 GMT  
 Keeping Access Open - System Modal Min/Max
The only way I know to keep the user from closing the application without
going through your code is to load an invisible form at startup, and put the
code in that form's Unload event.  If it turns out that the application
shouldn't be closed, you can cancel that event by setting the Cancel
argument to the event procedure.  I don't know how bulletproof this method
is, but it will stop an casual attempt to close.

I'm not sure how to keep the app from being minimized;  you may need some
calls to the Windows API.  Try searching http://www.mvps.org/access, you may
find something there.

--

Dirk Goldgar
(remove NOSPAM from reply address)


Quote:
> I'm porting a dedicated Access 2000 application from 2.0.  I need to
> prevent the users from closing the application window and also from
> minimizing it.  I did this in the past with GetSysModalWindow and the
> like.  But that call is now obsolete.  Can anyone direct me to the
> system calls that would allow me to do this.

> P.S.  I'd like to exit the application only in code after cleanup and
> getting past a password.  This has already been implemented.

> Thanks.

> Mark Longerbeam
> BME Systems Inc.



Mon, 05 May 2003 03:00:00 GMT  
 Keeping Access Open - System Modal Min/Max
Dirk/Mark

The only other way to do this is to use api's to create function that acts
as a message hook and replaces the main Access window's standard
WindowProcedure.  (The standard procedure that responds to Window messages
such as WM_Close).    This method is somewhat less resource intensive
because you don't have to have the hidden window, however if you aren't
comfortable with apis and callbacks, then the hidden form method has been
used for years.

The api's to use are SetWindowLong and CallWindowProc.  There are a few MS
Kb articles on this in the Visual Basic section.   Do a search under
CallWindowProc.

HTH
--
Steve Arbaugh
ATTAC Consulting Group
http://ourworld.compuserve.com/homepages/attac-cg


Quote:
> The only way I know to keep the user from closing the application without
> going through your code is to load an invisible form at startup, and put
the
> code in that form's Unload event.  If it turns out that the application
> shouldn't be closed, you can cancel that event by setting the Cancel
> argument to the event procedure.  I don't know how bulletproof this method
> is, but it will stop an casual attempt to close.

> I'm not sure how to keep the app from being minimized;  you may need some
> calls to the Windows API.  Try searching http://www.mvps.org/access, you
may
> find something there.

> --

> Dirk Goldgar
> (remove NOSPAM from reply address)



> > I'm porting a dedicated Access 2000 application from 2.0.  I need to
> > prevent the users from closing the application window and also from
> > minimizing it.  I did this in the past with GetSysModalWindow and the
> > like.  But that call is now obsolete.  Can anyone direct me to the
> > system calls that would allow me to do this.

> > P.S.  I'd like to exit the application only in code after cleanup and
> > getting past a password.  This has already been implemented.

> > Thanks.

> > Mark Longerbeam
> > BME Systems Inc.



Wed, 07 May 2003 03:00:00 GMT  
 Keeping Access Open - System Modal Min/Max
Thanks, Steve, I've got that filed away now.

--

Dirk Goldgar
(to reply via email, remove NOSPAM from address)



Wed, 07 May 2003 03:00:00 GMT  
 Keeping Access Open - System Modal Min/Max

Quote:

>The only other way to do this is to use api's to create function that acts
>as a message hook and replaces the main Access window's standard
>WindowProcedure.  (The standard procedure that responds to Window messages
>such as WM_Close).    This method is somewhat less resource intensive
>because you don't have to have the hidden window, however if you aren't
>comfortable with apis and callbacks, then the hidden form method has been
>used for years.

Interesting, I've saved your message, but I think I'll stick with the
hidden form method.

Tony
----
Tony Toews, Microsoft Access MVP
   Please respond only in the newsgroups so that others can
read the entire thread of messages.
   Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
   VolStar http://www.volstar.com Manage hundreds or
thousands of volunteers for special events.



Thu, 08 May 2003 03:00:00 GMT  
 Keeping Access Open - System Modal Min/Max
Thanks Steve. The hidden form thing is neat, but  I've got to prevent
minimize too. So this is exactly what I figured I needed to do... I
just didn't know the calls.  I'm going to see if I can do it. Thanks
again.

MBL

On Sat, 18 Nov 2000 17:55:36 -0500, "Steve Arbaugh"

Quote:

>Dirk/Mark

>The only other way to do this is to use api's to create function that acts
>as a message hook and replaces the main Access window's standard
>WindowProcedure.  (The standard procedure that responds to Window messages
>such as WM_Close).    This method is somewhat less resource intensive
>because you don't have to have the hidden window, however if you aren't
>comfortable with apis and callbacks, then the hidden form method has been
>used for years.

>The api's to use are SetWindowLong and CallWindowProc.  There are a few MS
>Kb articles on this in the Visual Basic section.   Do a search under
>CallWindowProc.

>HTH
>--
>Steve Arbaugh
>ATTAC Consulting Group
>http://ourworld.compuserve.com/homepages/attac-cg



>> The only way I know to keep the user from closing the application without
>> going through your code is to load an invisible form at startup, and put
>the
>> code in that form's Unload event.  If it turns out that the application
>> shouldn't be closed, you can cancel that event by setting the Cancel
>> argument to the event procedure.  I don't know how bulletproof this method
>> is, but it will stop an casual attempt to close.

>> I'm not sure how to keep the app from being minimized;  you may need some
>> calls to the Windows API.  Try searching http://www.mvps.org/access, you
>may
>> find something there.

>> --

>> Dirk Goldgar
>> (remove NOSPAM from reply address)



>> > I'm porting a dedicated Access 2000 application from 2.0.  I need to
>> > prevent the users from closing the application window and also from
>> > minimizing it.  I did this in the past with GetSysModalWindow and the
>> > like.  But that call is now obsolete.  Can anyone direct me to the
>> > system calls that would allow me to do this.

>> > P.S.  I'd like to exit the application only in code after cleanup and
>> > getting past a password.  This has already been implemented.

>> > Thanks.

>> > Mark Longerbeam
>> > BME Systems Inc.



Sat, 10 May 2003 11:11:48 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Keeping Window open and available - SysModal - Min/Max

2. Max min and System tray.

3. Min-Max-System-Buttons

4. Min-Max-System-Buttons

5. Accessing and Changing IE30 Min & Max Buttons

6. min and max

7. Setting min and max values on chart's y-axis

8. Programming the min and max values of an axis

9. Setting Min and Max Scale for MSGraph8, also marker style and color

10. textbox character input max/min

11. Returning max and min column values

12. max / min value in a listbox

 

 
Powered by phpBB® Forum Software