home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!uka!irau35!s_furrer
- From: s_furrer@irau35.ira.uka.de (Andreas Furrer)
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: CTL3D.DLL and TPW
- Date: 8 Jan 1993 12:53:48 GMT
- Organization: University of Karlsruhe, FRG
- Lines: 120
- Distribution: world
- Message-ID: <1ijtgsINN9sm@iraul1.ira.uka.de>
- NNTP-Posting-Host: irau35.ira.uka.de
-
- You can also use the CTL3D.DLL from Microsoft with Turbo Pascal for Windows.
- Just compile the unit CTL3D.PAS and use the functions an in C.
- To compile the simple demonstration program you have to create a resource
- file TEST3D.RES with a dialog 'TEST3D'. In this dialog you can
- create checkboxes, radio buttons or listboces or anything else you want.
- Now, compile and run TEST3D.PAS. (You must have CTL3D.DLL in your search path!)
- IF you click on the mainwindow of TEST3D you will see your dialog with
- the new 3D-lookout.
-
- But please: Do not mail any questions about 'where to get CTL3D from'
- or 'what is the meaning of function...' to me.
- There are some articles in this newsgroup which covers all this
- questions.
-
-
- Andreas Furrer
- s_furrer@ira.uka.de
-
-
-
- ============================= CTL3D.PAS ===================================
-
- (**************************************************)
- (* *)
- (* Unit CTL3D *)
- (* *)
- (* for use with CTL3D.DLL from Microssoft *)
- (**************************************************)
-
- unit Ctl3D;
-
- interface
-
- uses WinTypes;
-
- const CTL3D_BUTTONS = $0001;
- CTL3D_LISTBOXES = $0002;
- CTL3D_EDITS = $0004;
- CTL3D_COMBOS = $0008;
- CTL3D_STATICTEXTS = $0010;
- CTL3D_STATICFRAMES = $0020;
- CTL3D_ALL = $ffff;
-
- function Ctl3dGetVer : WORD;
- function Ctl3dSubclassDlg(HWindow : HWND; Ctrls : WORD) : bool;
- function Ctl3dSubclassCtl(HWindow : HWND) : bool;
- function Ctl3dCtlColor(DC : HDC; Color : TColorRef) : HBrush; {ARCHAIC, use Ctl3dCtlColorEx}
- function Ctl3dEnabled : bool;
- function Ctl3dColorChange : bool;
- function Ctl3dRegister(Instance : THandle) : bool;
- function Ctl3dUnregister(Instance : THandle) : bool;
- function Ctl3dAutoSubclass(Instance : THandle) : bool;
- function Ctl3dCtlColorEx(Message, wParam : WORD; lParam : LONGINT) : HBrush;
-
-
- implementation
-
- function Ctl3dGetVer; external 'Ctl3d' index 1;
- function Ctl3dSubclassDlg; external 'Ctl3d' index 2;
- function Ctl3dSubclassCtl; external 'Ctl3d' index 3;
- function Ctl3dCtlColor; external 'Ctl3d' index 4;
- function Ctl3dEnabled; external 'Ctl3d' index 5;
- function Ctl3dColorChange; external 'Ctl3d' index 6;
- function Ctl3dRegister; external 'Ctl3d' index 12;
- function Ctl3dUnregister; external 'Ctl3d' index 13;
- function Ctl3dAutoSubclass; external 'Ctl3d' index 16;
- function Ctl3dCtlColorEx; external 'Ctl3d' index 18;
- end.
-
- ============================= Test3D.PAS ===================================
-
- (**************************************************)
- (* *)
- (* Test3D *)
- (* *)
- (* Copyright (c) 1993 by A. Furrer *)
- (* *)
- (**************************************************)
-
- program Test3D;
-
-
- {$R test3d.res}
-
- uses WinTypes, WinProcs, WObjects, Ctl3d;
-
- type
- Applikation =
- object(TApplication)
- procedure InitMainWindow; virtual;
- end;
-
- PMainwindow = ^TMainwindow;
- TMainwindow =
- object(TWindow)
- procedure WMLButtonDown(var Msg : TMessage); virtual wm_first + wm_LButtonDown;
- end;
-
- procedure TMainwindow.WMLButtonDown;
- begin
- Application^.ExecDialog(NEW(PDialog,Init(@Self,'Test3D')));
- end;
-
- procedure Applikation.InitMainWindow;
- begin
- MainWindow := New(PMainwindow, Init(nil, 'Test3D'));
- end;
-
- var Prg : Applikation;
-
- begin
- Ctl3dRegister(HInstance);
- Ctl3dAutoSubclass(HInstance);
-
- Prg.Init('Test3D');
- Prg.Run;
- Prg.Done;
-
- Ctl3dUnregister(HInstance);
- end.
-