By trying to compile some code lines with VC 1.52, I found a program that used 3D controls with Ctl3dRegister and Ctl3dUnAutoSubclass features.
I cannot obviously compile it... because CTL3D.H, CTL3D.LIB or CTL3DS.LIB aren't in the Resource Kit 3.1 and these features are not documented...
The KB97361 article is supposed to explain that... but the download link is dead!
I managed to find CTL3D.DLL and CTL3DV2.DLL, though.
| CTL3D.DLL and CTL3DV2.DLL (23 Ko) Clics : 129 |
To return to my code lines: when I attempted to compile them, I was still without the header and libs. So, I created functions to dynamically and transparent add 3D effects.
The following example is interesting since it can work as well in 16-bit as in 32-bit environments, without any error message due to lack of DLL file.
Code : Tout sélectionner #include <windows.h>
HINSTANCE hCtl3d;
void WINAPI Ctl3dLoad(HINSTANCE hInst)
{
BOOL (WINAPI *Ctl3dRegister)(HANDLE);
BOOL (WINAPI *Ctl3dAutoSubclass)(HANDLE);
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
hCtl3d = LoadLibrary("ctl3dv2.dll");
if ((UINT)hCtl3d <= HINSTANCE_ERROR)
hCtl3d = LoadLibrary("ctl3d.dll");
if ((UINT)hCtl3d <= HINSTANCE_ERROR)
{
hCtl3d = 0;
return;
}
Ctl3dRegister = (BOOL (WINAPI *)(HANDLE))GetProcAddress(hCtl3d, "Ctl3dRegister");
Ctl3dAutoSubclass = (BOOL (WINAPI *)(HANDLE))GetProcAddress(hCtl3d, "Ctl3dAutoSubclass");
if (Ctl3dRegister && Ctl3dAutoSubclass)
{
Ctl3dRegister(hInst);
Ctl3dAutoSubclass(hInst);
}
SetErrorMode(0);
}
void WINAPI Ctl3dUnload(HINSTANCE hInst)
{
BOOL (WINAPI *Ctl3dUnRegister)(HANDLE);
if (hCtl3d)
{
Ctl3dUnRegister = (BOOL (WINAPI *)(HANDLE))GetProcAddress(hCtl3d, "Ctl3dUnRegister");
if (Ctl3dUnRegister)
Ctl3dUnRegister(hInst);
FreeLibrary(hCtl3d);
}
}
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
Ctl3dLoad(hInstance);
MessageBox(NULL, "With CTL3D", "Test", MB_OK + MB_ICONINFORMATION);
Ctl3dUnload(hInstance);
MessageBox(NULL, "Without CTL3D", "Test", MB_OK + MB_ICONINFORMATION);
return FALSE;
}
|
==> ![[ img ]](http://www.win3x.org/screens/357ops8.gif)
Naturally, for the only purpose of programming in 32-bit environment, there is no point

![[ img ]](http://www.win3x.org/screens/15nvtbm.gif)