home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4740 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  4.1 KB

  1. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!uka!irau35!s_furrer
  2. From: s_furrer@irau35.ira.uka.de (Andreas Furrer)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: CTL3D.DLL and TPW
  5. Date: 8 Jan 1993 12:53:48 GMT
  6. Organization: University of Karlsruhe, FRG
  7. Lines: 120
  8. Distribution: world
  9. Message-ID: <1ijtgsINN9sm@iraul1.ira.uka.de>
  10. NNTP-Posting-Host: irau35.ira.uka.de
  11.  
  12. You can also use the CTL3D.DLL from Microsoft with Turbo Pascal for Windows.
  13. Just compile the unit CTL3D.PAS and use the functions an in C.
  14. To compile the simple demonstration program you have to create a resource
  15. file TEST3D.RES with a dialog 'TEST3D'. In this dialog you can
  16. create checkboxes, radio buttons or listboces or anything else you want.
  17. Now, compile and run TEST3D.PAS. (You must have CTL3D.DLL in your search path!)
  18. IF you click on the mainwindow of TEST3D you will see your dialog with
  19. the new 3D-lookout.
  20.  
  21. But please: Do not mail any questions about 'where to get CTL3D from'
  22.             or 'what is the meaning of function...' to me.
  23.             There are some articles in this newsgroup which covers all this
  24.             questions.
  25.  
  26.  
  27. Andreas Furrer
  28. s_furrer@ira.uka.de
  29.  
  30.  
  31.  
  32. ============================= CTL3D.PAS ===================================
  33.  
  34. (**************************************************)
  35. (*                                                *)
  36. (*   Unit CTL3D                                   *)
  37. (*                                                *)
  38. (*   for use with CTL3D.DLL from Microssoft       *)
  39. (**************************************************)
  40.  
  41. unit Ctl3D;
  42.  
  43. interface
  44.  
  45. uses WinTypes;
  46.  
  47. const CTL3D_BUTTONS      = $0001;
  48.       CTL3D_LISTBOXES    = $0002;
  49.       CTL3D_EDITS        = $0004;
  50.       CTL3D_COMBOS       = $0008;
  51.       CTL3D_STATICTEXTS  = $0010;
  52.       CTL3D_STATICFRAMES = $0020;
  53.       CTL3D_ALL          = $ffff;
  54.  
  55. function Ctl3dGetVer : WORD;
  56. function Ctl3dSubclassDlg(HWindow : HWND; Ctrls : WORD) : bool;
  57. function Ctl3dSubclassCtl(HWindow : HWND) : bool;
  58. function Ctl3dCtlColor(DC : HDC; Color : TColorRef) : HBrush; {ARCHAIC, use Ctl3dCtlColorEx}
  59. function Ctl3dEnabled : bool;
  60. function Ctl3dColorChange : bool;
  61. function Ctl3dRegister(Instance : THandle) : bool;
  62. function Ctl3dUnregister(Instance : THandle) : bool;
  63. function Ctl3dAutoSubclass(Instance : THandle) : bool;
  64. function Ctl3dCtlColorEx(Message, wParam : WORD; lParam : LONGINT) : HBrush;
  65.  
  66.  
  67. implementation
  68.  
  69. function Ctl3dGetVer;       external 'Ctl3d' index 1;
  70. function Ctl3dSubclassDlg;  external 'Ctl3d' index 2;
  71. function Ctl3dSubclassCtl;  external 'Ctl3d' index 3;
  72. function Ctl3dCtlColor;     external 'Ctl3d' index 4;
  73. function Ctl3dEnabled;      external 'Ctl3d' index 5;
  74. function Ctl3dColorChange;  external 'Ctl3d' index 6;
  75. function Ctl3dRegister;     external 'Ctl3d' index 12;
  76. function Ctl3dUnregister;   external 'Ctl3d' index 13;
  77. function Ctl3dAutoSubclass; external 'Ctl3d' index 16;
  78. function Ctl3dCtlColorEx;   external 'Ctl3d' index 18;
  79. end.
  80.  
  81. ============================= Test3D.PAS ===================================
  82.  
  83. (**************************************************)
  84. (*                                                *)
  85. (*   Test3D                                       *)
  86. (*                                                *)
  87. (*   Copyright (c) 1993 by A. Furrer              *)
  88. (*                                                *)
  89. (**************************************************)
  90.  
  91. program Test3D;
  92.  
  93.  
  94. {$R test3d.res}
  95.  
  96. uses WinTypes, WinProcs, WObjects, Ctl3d;
  97.  
  98. type
  99.    Applikation =
  100.       object(TApplication)
  101.          procedure InitMainWindow; virtual;
  102.       end;
  103.  
  104.    PMainwindow = ^TMainwindow;
  105.    TMainwindow =
  106.       object(TWindow)
  107.          procedure WMLButtonDown(var Msg : TMessage); virtual wm_first + wm_LButtonDown;
  108.       end;
  109.  
  110. procedure TMainwindow.WMLButtonDown;
  111. begin
  112.   Application^.ExecDialog(NEW(PDialog,Init(@Self,'Test3D')));
  113. end;
  114.  
  115. procedure Applikation.InitMainWindow;
  116. begin
  117.   MainWindow := New(PMainwindow, Init(nil, 'Test3D'));
  118. end;
  119.  
  120. var Prg : Applikation;
  121.  
  122. begin
  123.    Ctl3dRegister(HInstance);
  124.    Ctl3dAutoSubclass(HInstance);
  125.  
  126.    Prg.Init('Test3D');
  127.    Prg.Run;
  128.    Prg.Done;
  129.  
  130.    Ctl3dUnregister(HInstance);
  131. end.
  132.