Microsoft KB Archive/100165: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 29: | Line 29: | ||
== MORE INFORMATION == | == 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 | 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.<br /> | ||
<br /> | <br /> | ||
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.<br /> | 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.<br /> | ||
Line 42: | Line 42: | ||
Option Explicit | Option Explicit | ||
Declare Function GetModuleHandle% Lib | Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpModuleName$) | ||
Declare Function Ctl3dAutoSubClass% Lib | Declare Function Ctl3dAutoSubClass% Lib "Ctl3D.DLL" (ByVal hInst%) | ||
Declare Function Ctl3dRegister% Lib | Declare Function Ctl3dRegister% Lib "Ctl3D.DLL" (ByVal hInst%) | ||
Declare Function Ctl3dUnRegister% Lib | Declare Function Ctl3dUnRegister% Lib "Ctl3D.DLL" (ByVal hInst%) | ||
'------------------------------------------------------------------ | '------------------------------------------------------------------ | ||
Line 56: | Line 56: | ||
Dim Inst% | Dim Inst% | ||
Dim ret | Dim ret | ||
Inst% = GetModuleHandle( | Inst% = GetModuleHandle("MSACCESS.EXE") | ||
ret = Ctl3dRegister(Inst%) | ret = Ctl3dRegister(Inst%) | ||
ret = Ctl3dAutoSubClass(Inst%) | ret = Ctl3dAutoSubClass(Inst%) | ||
Line 68: | Line 68: | ||
Dim Inst% | Dim Inst% | ||
Dim ret | Dim ret | ||
Inst% = GetModuleHandle( | Inst% = GetModuleHandle("MSACCESS.EXE") | ||
ret = Ctl3dUnRegister(Inst%) | ret = Ctl3dUnRegister(Inst%) | ||
End Function </pre> | End Function </pre> |
Latest revision as of 12:29, 19 July 2020
ACC1x: How to Use the CTL3D.DLL in Your MS Access Database |
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
Issue type : kbhowto
Technology :
Last Reviewed: November 4, 2000 |