ðH geocities.com /Heartland/Pond/4805/API10.htm geocities.com/Heartland/Pond/4805/API10.htm .delayed x ²PÔJ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ 0Wì v0 OK text/html €çh v0 ÿÿÿÿ b‰.H Sun, 20 Jan 2002 12:58:33 GMT 2 Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) en, * ²PÔJ v0
The
information in this article applies to:
Advanced: Requires expert coding, interoperability, and
multiuser skills. SUMMARYIt is possible to quit Microsoft Windows from within a Microsoft Access application by using a Windows application programming interface (API) function. To do this, you must create a module that declares the API function and a procedure to call the API function. MORE INFORMATIONThe call to the Windows dynamic-link library (DLL) below
behaves in the same way as the Shut Down command on the Start
menu in Microsoft Windows 95, Microsoft Windows 98, Microsoft Windows
Millennium Edition (Me), Microsoft Windows NT 4.0, and Microsoft Windows
2000. Each program must agree to be closed; for example, if you click Cancel
when you are prompted to save a file, your quit request is also canceled.
2. Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As _ Long, ByVal dwReserved As Long) As Long
Function ShutDownWindows() 'This will quit all applications and shut down Windows. Dim x As Long x = ExitWindowsEx(1, 0) application.Quit acExit End Function
NOTE: If you are using Microsoft Windows NT or Windows 2000, or if you would like to quit all applications but not log off the user, you can change the first ExitWindowsEx argument to 0, as follows: x = ExitWindowsEx(0, 0)
You can now add the code to a
form and use it as you would any other Microsoft Access procedure. |