ACC1x: How to Use the CTL3D.DLL in Your MS Access Database

Last reviewed: June 6, 1997
Article ID: Q100165
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SUMMARY

This article describes how to achieve a three-dimensional look in your Microsoft Access database by using the CTL3D.DLL dynamic link library (DLL). Calling CTL3D.DLL APIs gives your dialog boxes a three- dimensional appearance.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with creating Microsoft Access applications with the programming tools provided with Microsoft Access. For more information on Access Basic, please refer to the "Introduction to Programming" manual.

You can use CTL3D.DLL to add effects to the common dialog boxes and message boxes in an Access Basic application. CTL3D.DLL does not currently work for the controls on an Access Basic form. To use CTL3D.DLL to enhance the common dialog boxes and message boxes in Access Basic, follow the steps below.

NOTE: You may have some Windows API functions defined in an existing Microsoft Access library; therefore, your declarations may be duplicates. If you receive the duplicate procedure name error, remove or comment the declare statement from your code.

   ' Note: Each command should be entered on one line.
   '---------------------------------------
   'GLOBAL DECLARATIONS SECTION
   '---------------------------------------
   Option Explicit

   Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpModuleName$)
   Declare Function Ctl3dAutoSubClass% Lib "Ctl3D.DLL" (ByVal hInst%)
   Declare Function Ctl3dRegister% Lib "Ctl3D.DLL" (ByVal hInst%)
   Declare Function Ctl3dUnRegister% Lib "Ctl3D.DLL" (ByVal hInst%)

   '------------------------------------------------------------------
   ' The following function needs to be called when your application
   '    starts.
   ' This will register Access and subclass dialogs and message boxes
   '    with the 3D look.
   '------------------------------------------------------------------
   Function Init ()
      Dim Inst%
      Dim ret
      Inst% = GetModuleHandle("MSACCESS.EXE")
      ret = Ctl3dRegister(Inst%)
      ret = Ctl3dAutoSubClass(Inst%)
   End Function

   '------------------------------------------------------------------
   ' The following function needs to be called when your application
   '    quits.
   '------------------------------------------------------------------
   Function ShutDown ()
      Dim Inst%
      Dim ret
      Inst% = GetModuleHandle("MSACCESS.EXE")
      ret = Ctl3dUnRegister(Inst%)
   End Function

After running the Init() function from the Immediate window, an AutoExec macro, or a RunCode macro action, you can see the three- dimensional effects by running a macro or function that displays a message box.

NOTE: Remember to run the ShutDown() function before quitting Microsoft Access.


Additional query words: 3-D
Keywords : kbprg PgmApi
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 6, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.