HOWTO: Use CTL3D.DLL in Your Visual Basic ProgramID: Q113898
|
You can use CTL3D.DLL to add three-dimensional (3-D) effects to the
common dialog boxes and message boxes for a Visual Basic application.
However, CTL3D.DLL does not work currently for the controls on a
Visual Basic form or for the form itself.
To get 3-D effects for the controls on a form, use the controls found
in the THREED.VBX custom control.
To use CTL3D.DLL to enhance the common dialog boxes and message boxes from
Visual Basic, follow these steps:
Option Explicit
Const GWW_HINSTANCE = (-6)
' Enter each declaration as one, single line:
Declare Function GetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal
nIndex As Integer) As Integer
Declare Function Ctl3dAutoSubclass Lib "Ctl3D.DLL" (ByVal hInst As
Integer) As Integer
Declare Function Ctl3dRegister Lib "Ctl3D.DLL" (ByVal hInst As Integer)
As Integer
Declare Function Ctl3dUnregister Lib "Ctl3D.DLL" (ByVal hInst As
Integer) As Integer
Sub Form_Load ()
Dim hInst As Integer, ret As Integer
hInst = GetWindowWord(Me.hWnd, GWW_HINSTANCE) ' Get Instance Handle
ret = Ctl3dRegister(hInst) ' Register program w/ Ctl3d.
ret = Ctl3dAutoSubclass(hInst) ' Subclass the program.
End Sub
Sub Form_Unload (Cancel As Integer)
Dim hInst As Integer, ret As Integer
hInst = GetWindowWord(Me.hWnd, GWW_HINSTANCE) ' Get Instance Handle
ret = Ctl3dUnregister(hInst) ' Unregister the program.
End Sub
Sub Command2_Click ()
MsgBox "This is a 3-D Message Box"
End Sub
The information in this article is taken from the CTL3D.HLP help file.
You can find CTL3D.EXE, a self-extracting file, on these services:
The following file is available for download from the Microsoft Software
Library:
~ Ctl3d.exe
For more information about downloading files from the Microsoft Software
Library, please see the following article in the Microsoft Knowledge Base:
Q119591 : How to Obtain Microsoft Support Files from Online Services
Q97361 : INF: Adding 3D Controls Using CTL3D.DLL
Additional query words: 3.00 softlib kbDSupport
Keywords : kbcode
Version : 2.00 3.00
Platform : WINDOWS
Issue type :
Last Reviewed: June 21, 1999