home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / mobjm260 / sfx200.pa_ / sfx200.pa
Encoding:
Text File  |  1994-09-06  |  34.3 KB  |  1,158 lines

  1. (*******************************************************************)
  2. (*                                                                 *)
  3. (*          Microworks ObjectMate 2.6                                                      *)
  4. (*                                                                 *)
  5. (*     Windows Interface Develpment Kit the Borland Languages.     *)
  6. (*                                                                 *)
  7. (*         SFX200.PAS : SFX Object Unit                                    *)
  8. (*                                                                                                                           *)
  9. (*     Copyright 1992-94 Microworks Sydney, Australia.               *)
  10. (*                                                                 *)
  11. (*******************************************************************)
  12.  
  13. unit SFX200;
  14.  
  15. interface
  16.  
  17. uses WinTypes, WinProcs, Win31,
  18.          {$IFDEF Ver15}
  19.              WObjects;
  20.          {$ELSE}
  21.              Objects, OWindows, ODialogs;
  22.          {$ENDIF}
  23.  
  24. const
  25.     { Border styles }
  26.     bd_Recessed         = $01;
  27.     bd_Raised           = $02;
  28.  
  29.     { Extra combo box style flag that specifies a SpecialFX combo box with no 3D border. }
  30.     cbs_No3DBorder      = $8000;
  31.  
  32.     { Extra wm_CtlColor value that identifies a SpecialFX combo box }
  33.     ctlcolor_ComboBox   = $0F;
  34.  
  35.     { Common dialog templates }
  36.     dlg_Color           = 1;
  37.     dlg_ExColor         = 2;
  38.     dlg_OpenSave        = 3;
  39.     dlg_ExOpenSave      = 4;
  40.     dlg_Print           = 5;
  41.     dlg_PrintSetup      = 6;
  42.     dlg_Find            = 7;
  43.     dlg_Replace         = 8;
  44.     dlg_Font            = 9;
  45.     dlg_ExFont          = 10;
  46.     dlg_OpenDir         = 11;
  47.  
  48.     { Old common dialog template ID's for backward compatibility }
  49.     dlg_ChooseColor     = 1;
  50.     dlg_ExChooseColor   = 2;
  51.  
  52.     { Extends standard button ID's from 7 to 11 }
  53.     idHelp              = 8;
  54.     idBrowse            = 9;
  55.     idGo                = 10;
  56.     idStop              = 11;
  57.  
  58.     { Extends standard button ID's from 7 to 11 }
  59.     id_Help             = 8;
  60.     id_Browse           = 9;
  61.     id_Go               = 10;
  62.     id_Stop             = 11;
  63.  
  64.     { Turns Edit mode on and off in a list edit box. wParam and lParam must be zero. }
  65.     lb_ListEditOn       = wm_User + $1001;
  66.     lb_ListEditOff      = wm_User + $1002;
  67.  
  68.     { Extra list box style flags }
  69.     lbs_No3DBorder      = $2000; { No 3D Border }
  70.     lbs_SFXListEdit     = $4000; { List edit box }
  71.     lbs_SFXMultipleSel  = $8000; { Right mouse button only multiple selection list box ]
  72.  
  73.     { Extra message box button combinations }
  74.     mb_Go               = $000A;
  75.     mb_GoStop           = $000B;
  76.     mb_OkCancelHelp     = $000C;
  77.     mb_YesNoHelp        = $000D;
  78.  
  79.     { Microworks button style flags }
  80.     mbs_PushButton      = bs_PushButton;
  81.     mbs_CheckBox        = bs_CheckBox;
  82.     mbs_AutoCheckBox    = bs_AutoCheckBox;
  83.     mbs_RadioButton     = bs_RadioButton;
  84.     mbs_3State          = bs_3State;
  85.     mbs_Auto3State      = bs_Auto3State;
  86.     mbs_AutoRadioButton = bs_AutoRadioButton;
  87.     mbs_IconButton      = $000E;
  88.     mbs_DefFont         = $0010;
  89.     mbs_LeftText        = $0020;
  90.     mbs_RaisedText      = $0040;
  91.     mbs_RecessedText    = $0080;
  92.     mbs_Red             = $0100;
  93.     mbs_Lime            = $0200;
  94.     mbs_Blue            = $0300;
  95.     mbs_Magenta         = $0400;
  96.     mbs_Maroon          = $0500;
  97.     mbs_Green           = $0600;
  98.     mbs_Navy            = $0700;
  99.     mbs_Purple          = $0800;
  100.     mbs_Yellow          = $0900;
  101.     mbs_Flush                = $1000;
  102.     mbs_Raised          = $1000;
  103.     mbs_Bitmap          = $2000;
  104.     mbs_BitmapButton    = $4000;
  105.     mbs_TextButton      = $8000;
  106.  
  107.     { Microworks percent style flags }
  108.     mps_Top             = $0001;
  109.     mps_Bottom          = $0002;
  110.     mps_Red             = $0010;
  111.     mps_Lime            = $0020;
  112.     mps_Blue            = $0030;
  113.     mps_Magenta         = $0040;
  114.     mps_Maroon          = $0050;
  115.     mps_Green           = $0060;
  116.     mps_Navy            = $0070;
  117.     mps_Purple          = $0080;
  118.  
  119.     { Microworks scroll bar style flags }
  120.     msb_Horz            = $0000;
  121.     msb_Vert            = $0001;
  122.     msb_TopLeft         = $0010;
  123.     msb_Bottomright     = $0020;
  124.  
  125.     { Microworks shade style flags }
  126.     msh_Left            = $0000;
  127.     msh_LtGray          = $0000;
  128.     msh_Rect            = $0000;
  129.     msh_Frame           = $0001;
  130.     msh_VLine           = $0002;
  131.     msh_HLine           = $0004;
  132.     msh_Recessed        = $0008;
  133.     msh_Raised          = $0010;
  134.     msh_Borstyle        = $0020;
  135.     msh_Center          = $0040;
  136.     msh_Right           = $0080;
  137.     msh_RecessedText    = $0100;
  138.     msh_RaisedText      = $0200;
  139.     msh_DefFont         = $0400;
  140.     msh_NoPrefix        = $0800;
  141.     msh_Steel           = $1000;
  142.     msh_Glaze           = $2000;
  143.     msh_Red             = $3000;
  144.     msh_Lime            = $4000;
  145.     msh_Blue            = $5000;
  146.     msh_Magenta         = $6000;
  147.     msh_Maroon          = $7000;
  148.     msh_Green           = $8000;
  149.     msh_Navy            = $9000;
  150.     msh_Purple          = $A000;
  151.     msh_Black           = $B000;
  152.     msh_WinColor        = $C000;
  153.     msh_Transparent     = $D000;
  154.     msh_VHump           = msh_VLine + msh_Raised;
  155.     msh_VDip            = msh_VLine + msh_Recessed;
  156.     msh_HHump           = msh_HLine + msh_Raised;
  157.     msh_HDip            = msh_HLine + msh_Recessed;
  158.     msh_RaisedFrame     = msh_Raised + msh_Frame;
  159.     msh_RecessedFrame   = msh_Recessed + msh_Frame;
  160.  
  161.     { Microworks static style flags }
  162.     mss_Text            = $0000;
  163.     mss_Top             = $0000;
  164.     mss_Left            = $0000;
  165.     mss_RecessedText    = $0001;
  166.     mss_RaisedText      = $0002;
  167.     mss_ShadowText      = $0003;
  168.     mss_Bitmap          = $0004;
  169.     mss_BitmapWindow    = $0005;
  170.     mss_HCenter         = $0010;
  171.     mss_Right           = $0020;
  172.     mss_Bottom          = $0040;
  173.     mss_VCenter         = $0080;
  174.     mss_Recessed        = $0100;
  175.     mss_Raised          = $0200;
  176.     mss_Frame           = $0400;
  177.     mss_WordWrap        = $0800;
  178.     mss_SingleLine      = $1000;
  179.     mss_NoPrefix        = $2000;
  180.     mss_SFXPaint        = $2000;
  181.     mss_ExpandTabs      = $4000;
  182.     mss_DefFont         = $8000;
  183.     mss_Center          = mss_VCenter + mss_HCenter;
  184.     mss_CenterBitmap    = mss_BitmapWindow + mss_Center;
  185.     mss_RaisedFrame     = mss_Raised + mss_Frame;
  186.     mss_RecessedFrame   = mss_Recessed + mss_Frame;
  187.  
  188.     { Offset to the static control window handle in an aligned toolbar or status bar }
  189.     mtb_WndStatic       = 2;
  190.  
  191.      { Offset to the text string containing the toolbar title and current button ID's }
  192.     mtb_WndText         = 4;
  193.  
  194.     { Microworks toolbar style flags }
  195.     mtb_Row1            = $0001;
  196.     mtb_Row2            = $0002;
  197.     mtb_Row3            = $0003;
  198.     mtb_Row4            = $0004;
  199.     mtb_Row5            = $0005;
  200.     mtb_Row6            = $0006;
  201.     mtb_Row7            = $0007;
  202.     mtb_Row8            = $0008;
  203.     mtb_Row9            = $0009;
  204.     mtb_Row10           = $000A;
  205.     mtb_Row11           = $000B;
  206.     mtb_Row12           = $000C;
  207.     mtb_Row13           = $000D;
  208.     mtb_Row14           = $000E;
  209.     mtb_Row15           = $000F;
  210.     mtb_Column1         = $0010;
  211.     mtb_Column2         = $0020;
  212.     mtb_Column3         = $0030;
  213.     mtb_Column4         = $0040;
  214.     mtb_Column5         = $0050;
  215.     mtb_Column6         = $0060;
  216.     mtb_Column7         = $0070;
  217.     mtb_Column8         = $0080;
  218.     mtb_Column9         = $0090;
  219.     mtb_Column10        = $00A0;
  220.     mtb_Column11        = $00B0;
  221.     mtb_Column12        = $00C0;
  222.     mtb_Column13        = $00D0;
  223.     mtb_Column14        = $00E0;
  224.     mtb_Column15        = $00F0;
  225.     mtb_Top             = $0100;
  226.     mtb_Left            = $0200;
  227.     mtb_Right           = $0300;
  228.     mtb_Bottom          = $0400;
  229.     mtb_Float           = $0500;
  230.     mtb_Status          = $0600;
  231.     mtb_3DFrame         = $1000;
  232.     mtb_Flush           = $2000;
  233.     mtb_Radio           = $4000;
  234.     mtb_BitmapButton    = $8000;
  235.  
  236.     { Microworks window style flags }
  237.     mws_SFXCaption      = $0200;
  238.     mws_FramedClient    = $0400;
  239.     mws_RaisedClient    = $0800;
  240.     mws_Gray            = $0800;
  241.     mws_3DFrame         = $1000;
  242.     mws_3DGray          = $1000;
  243.     mws_SFXFrame        = $2000;
  244.     mws_Glaze           = $4000;
  245.     mws_Steel           = $8000;
  246.     mws_3DGlaze         = mws_Glaze + mws_3DFrame;
  247.     mws_3DSteel         = mws_Steel + mws_3DFrame;
  248.     mws_Framed3DFrame   = mws_3DFrame + mws_FramedClient;
  249.     mws_Framed3DGlaze   = mws_3DGlaze + mws_FramedClient;
  250.     mws_Framed3DSteel   = mws_3DSteel + mws_FramedClient;
  251.     mws_Raised3DFrame   = mws_3DFrame + mws_RaisedClient;
  252.     mws_Raised3DGlaze   = mws_3DGlaze + mws_RaisedClient;
  253.     mws_Raised3DSteel   = mws_3DSteel + mws_RaisedClient;
  254.  
  255.     { Old window style flags included for compatiblity }
  256.     mws_Flat3DFrame     = mws_3DFrame;
  257.     mws_Flat3DGlaze     = mws_3DGlaze;
  258.     mws_Flat3DSteel     = mws_3DSteel;
  259.  
  260.     { Hide menu item indentifier on the toolbar system menu }
  261.     sc_Hide             = $FF00;
  262.  
  263.     { High order word values of lParam identifying the control sending a wm_SFXCtlColor message }
  264.     sfxctlcolor_Button  = $10;
  265.     sfxctlcolor_Check   = $11;
  266.     sfxctlcolor_Combo   = $12;
  267.     sfxctlcolor_Dlg     = $13;
  268.     sfxctlcolor_Radio   = $14;
  269.     sfxctlcolor_Shade   = $15;
  270.     sfxctlcolor_Static  = $16;
  271.     sfxctlcolor_Percent = $17;
  272.  
  273.     { Version number of SFX200.DLL -> 2.6 }
  274.     sfxversion          = $0260;
  275.  
  276.     { Undocumented window message posted in a window's message queue when a menu is cancelled.
  277.         If the closing menu is the system menu wParam is 1. Otherwise it's zero. }
  278.     wm_ExitMenuLoop     = $0212;
  279.  
  280.     { Extra window messages }
  281.     wm_AlignToolbar     = wm_User + $1003;
  282.     wm_DrawPercent      = wm_User + $1004;
  283.     wm_GetCheck         = wm_User + $1005;
  284.     wm_ResetPercent     = wm_User + $1006;
  285.     wm_SetBitmap        = wm_User + $1007;
  286.     wm_SetBrush         = wm_User + $1008;
  287.     wm_SetCheck         = wm_User + $1009;
  288.     wm_SetPen           = wm_User + $100A;
  289.     wm_SFXCtlColor      = wm_User + $100B;
  290.     wm_SFXApplyColor    = wm_User + $100C;
  291.     wm_SFXApplyFONT     = wm_User + $100D;
  292.     wm_SFXHelp          = wm_User + $100E;
  293.     wm_SFXInitDialog    = wm_User + $100F;
  294.  
  295.     { Stock object values used in the GetSFXObject function }
  296.     glaze_brush         = 1;
  297.     steel_brush         = 2;
  298.     red_brush           = 3;
  299.     lime_Brush          = 4;
  300.     blue_Brush          = 5;
  301.     magenta_Brush       = 6;
  302.     maroon_Brush        = 7;
  303.     green_Brush         = 8;
  304.     navy_Brush          = 9;
  305.     purple_brush        = 10;
  306.     fine_font           = 11;
  307.     bold_font           = 12;
  308.     red_pen             = 13;
  309.     blue_pen            = 14;
  310.     green_pen           = 15;
  311.     maroon_pen          = 16;
  312.     navy_pen            = 17;
  313.     purple_pen          = 18;
  314.     yellow_brush        = 19;
  315.     System_Fine_Font    = 20;
  316.  
  317. var
  318.     SFXLib   : THandle;
  319.     SaveExit : Pointer;
  320.  
  321.     { Functions exported by SFX200.DLL }
  322.     AlignBrush : procedure (Wnd: HWnd; DC: HDC; Brush: HBrush);
  323.  
  324.     BlackFrame : procedure (DC: HDC; X1, Y1, X2, Y2: Integer);
  325.  
  326.     CenterWindow : procedure (ParentWnd, Wnd: HWnd);
  327.  
  328.     ChildToParentRect : function (Wnd: HWnd): PRect;
  329.  
  330.     DrawBorder : procedure (DC: HDC; X, Y, W, H: Integer; Style: Word);
  331.  
  332.     Draw3DBorder : procedure (DC: HDC; X, Y, W, H: Integer; Style: Word);
  333.  
  334.     EraseObject : function (Handle: THandle): Bool;
  335.  
  336.     GetSFXCtrlFont : function (Wnd: HWnd): HFont;
  337.  
  338.     GetSFXInstance : function : THandle;
  339.  
  340.     GetSFXObject : function (Index: Integer): THandle;
  341.  
  342.     GetSFXTemplate : function (Class: PChar; Template: Word): PChar;
  343.  
  344.     GetSFXTemplateId : function (Class: PChar; Template: Word): Integer;
  345.  
  346.     GetSFXVersion : function : Word;
  347.  
  348.     IsNCActive : function (Wnd: HWnd): Bool;
  349.  
  350.     PtInClient : function (Wnd: HWnd; Point: TPoint): Bool;
  351.  
  352.     PtInWindow : function (Wnd: HWnd; Point: TPoint): Bool;
  353.  
  354.     SFXDefDlgProc : function (Dlg: HWnd; Msg, wParam: Word; lParam: Longint): Longint;
  355.  
  356.     SFXDefWindowProc : function (Wnd: HWnd; Msg, wParam: Word; lParam: Longint): Longint;
  357.  
  358.     (* SFXDefFrameProc has changed. It now includes the client window handle as a parameter
  359.      *)
  360.     SFXDefFrameProc : function (Wnd, ClientWnd: HWnd; Msg, wParam: Word; lParam: Longint): Longint;
  361.  
  362.     SFXDefMDIChildProc : function (Wnd: HWnd; Msg, wParam: Word; lParam: Longint): Longint;
  363.  
  364.     SFXDirBox : function (WndParent: HWnd; Caption, Dir: PChar; Flags, Style: Word): Integer;
  365.  
  366.     SFXMsgBox : function (WndParent: HWnd; Txt, Caption: PChar; TextType, Style: Word):Integer;
  367.  
  368.     SFXInputBox : function (WndParent: HWnd; Caption, Prompt, Text: PChar; MaxCount: Integer;
  369.                                                     Style: Word): Integer;
  370.  
  371.     (* New Function: displays a directory selection common dialog box
  372.      *)
  373.     SFXOpenDir : function (WndParent: HWnd; Buffer, Title: PChar; OFNFlags: LongInt;
  374.                                                  Template: Integer; Center: Boolean): BOOL;
  375.  
  376.     (* New Function: displays a 'Open File' common dialog box
  377.      *)
  378.     SFXOpenFile : function (WndParent: HWnd; Buffer, Filters: PChar; OFNFlags: LongInt;
  379.                                                     Template: Integer; Center: Boolean; Title: PChar;
  380.                                                     var FilterIndex: LongInt; DefExt: PChar): BOOL;
  381.  
  382.     (* New Function: displays a 'Save File As' common dialog box
  383.      *)
  384.     SFXSaveFile : function (WndParent: HWnd; Buffer, Filters: PChar; OFNFlags: LongInt;
  385.                                                     Template: Integer; Center: Boolean; Title: PChar;
  386.                                                     var FilterIndex: LongInt; DefExt: PChar): BOOL;
  387.  
  388.     (* New Function: displays a 'Choose Color' common dialog box
  389.      *)
  390.     SFXChooseColor : function (WndParent: HWnd; var RGBColor: LongInt; CCFlags: LongInt;
  391.                                                          Template: Integer; Center: Boolean; CustomColors: PLongInt): BOOL;
  392.  
  393.     (* New Function: displays a 'Choose Font' common dialog box
  394.      *)
  395.     SFXChooseFont : function (WndParent: HWnd; var LogFont: TLogFont; CFFlags: LongInt;
  396.                                                         Template: Integer; Center: Boolean; var RGBColor: LongInt): BOOL;
  397.  
  398. type
  399.     { ObjectWindows Objects specific to SFX200 }
  400.  
  401.     PSFXButton = ^TSFXButton;
  402.     TSFXButton = object(TButton)
  403.         constructor Init (AParent: PWindowsObject; AnID: Integer; AText: PChar; X, Y, W, H: Integer);
  404.         constructor InitResource (AParent: PWindowsObject; ResourceID: Word);
  405.         function  GetClassName: PChar; virtual;
  406.         procedure SetButton (NewID: Integer);
  407.         procedure SetIcon (NewIcon: HIcon);
  408.         procedure SetText (ATextString: PChar);
  409.     end;
  410.  
  411.     PSFXStatic = ^TSFXStatic;
  412.     TSFXStatic = object(TStatic)
  413.         function GetClassName: PChar; virtual;
  414.     end;
  415.  
  416.     PSFXShade = ^TSFXShade;
  417.     TSFXShade = object(TGroupBox)
  418.         constructor Init(AParent: PWindowsObject; AnID: Integer; AText: PChar; X, Y, W, H: Integer);
  419.         constructor InitResource (AParent: PWindowsObject; ResourceID: Word);
  420.         function GetClassName: PChar; virtual;
  421.     end;
  422.  
  423.     PSFXCheckBox = ^TSFXCheckBox;
  424.     TSFXCheckBox = object(TCheckBox)
  425.         function GetClassName: PChar; virtual;
  426.     end;
  427.  
  428.     PSFXRadioButton = ^TSFXRadioButton;
  429.     TSFXRadioButton = object(TRadioButton)
  430.         function GetClassName: PChar; virtual;
  431.     end;
  432.  
  433.     PSFXScrollBar = ^TSFXScrollBar;
  434.     TSFXScrollBar = object(TScrollBar)
  435.         function GetClassName: PChar; virtual;
  436.     end;
  437.  
  438.     PSFXEdit = ^TSFXEdit;
  439.     TSFXEdit = object(TEdit)
  440.         function GetClassName: PChar; virtual;
  441.     end;
  442.  
  443.     PSFXListBox = ^TSFXListBox;
  444.     TSFXListBox = object(TListBox)
  445.         function GetClassName: PChar; virtual;
  446.     end;
  447.  
  448.     PSFXComboBox = ^TSFXComboBox;
  449.     TSFXComboBox = object(TComboBox)
  450.         function GetClassName: PChar; virtual;
  451.     end;
  452.  
  453.     PSFXToolbar = ^TSFXToolbar;
  454.     TSFXToolbar = object(TWindow)
  455.         (* SetFont, SetText and SetTool are new. SetFont and SetText and are used
  456.          * only for status bars.
  457.          *)
  458.         constructor Init (AParent: PWindowsObject; AnID: Integer; ATitle: PChar;
  459.                                             X, Y: Integer; IsChild: Boolean);
  460.         constructor InitResource (AParent: PWindowsObject; ResourceID: Word);
  461.         function  GetClassName: PChar; virtual;
  462.         function  Register: Boolean; virtual;
  463.         procedure WMPaint (var Msg: TMessage); virtual wm_First + wm_Paint;
  464.         procedure GetTitle (ATextString: PChar);
  465.         procedure AlignToolbar;
  466.         function  GetCheck (ToolID: Integer): Word;
  467.         procedure CheckTool (ToolID: Integer);
  468.         procedure UncheckTool (ToolID: Integer);
  469.         function  IsToolEnabled(ToolID: Integer): BOOL;
  470.         procedure EnableTool(ToolID: Integer; Enabled: BOOL);
  471.         procedure GetText (ATextString: PChar);
  472.         procedure SetText (ATextString: PChar);
  473.         procedure SetFont (Font: HFont);
  474.         procedure SetTool (NewID, ToolID: Integer);
  475.         function  StatusWindow: HWnd;
  476.     end;
  477.  
  478.     PSFXPercent = ^TSFXPercent;
  479.     TSFXPercent = object(TControl)
  480.         constructor Init (AParent: PWindowsObject; AnID: Integer;    X, Y, W, H: Integer);
  481.         constructor InitResource (AParent: PWindowsObject; ResourceID: Word);
  482.         function  GetClassName: PChar; virtual;
  483.         function  SetPercent (Percent: Word): LongInt;
  484.         procedure Reset;
  485.     end;
  486.  
  487.     PSFXDivider = ^TSFXDivider;
  488.     TSFXDivider = object(TControl)
  489.         constructor Init (AParent: PWindowsObject; AnID, X, Y, Length: Integer;
  490.                                             IsVertical, IsHump, Borstyle: Boolean);
  491.         constructor InitResource (AParent: PWindowsObject; ResourceID: Word);
  492.         function GetClassName: PChar; virtual;
  493.     end;
  494.  
  495.     PSFXBitmap = ^TSFXBitmap;
  496.     TSFXBitmap = object(TControl)
  497.         constructor Init (AParent: PWindowsObject; AnID: Integer; X, Y: Integer);
  498.         constructor InitResource (AParent: PWindowsObject; ResourceID: Word);
  499.         function GetClassName: PChar; virtual;
  500.     end;
  501.  
  502.     PSFXWindow = ^TSFXWindow;
  503.     TSFXWindow = object(TWindow)
  504.         constructor Init (AParent: PWindowsObject; AName: PChar);
  505.         constructor Load (var S: TStream);
  506.         procedure Store (var S: TStream);
  507.     end;
  508.  
  509.     PSFXMDIClient = ^TSFXMDIClient;
  510.     TSFXMDIClient = object(TMDIClient)
  511.         constructor Init(AParent: PMDIWindow; SFXClient: Boolean);
  512.         function GetClassName: PChar; virtual;
  513.     private
  514.         IsSFXClient : Boolean;
  515.     end;
  516.  
  517.     PSFXMDIWindow = ^TSFXMDIWindow;
  518.     TSFXMDIWindow = object(TMDIWindow)
  519.         constructor Init(ATitle: PChar; AMenu: HMenu);
  520.         procedure GetWindowClass (var AWndClass: TWndClass); virtual;
  521.         procedure InitClientWindow; virtual;
  522.         procedure DefWndProc (var Msg: TMessage);    virtual;
  523.     end;
  524.  
  525.     function  SFXDefMsgBox (WndParent: HWnd; Txt, Caption: PChar; TextType: Word): Integer;
  526.  
  527.     procedure RegisterSFX200;
  528.  
  529.     procedure UnitExit;
  530.  
  531. const
  532.     { Stream registration records }
  533.     RSFXButton : TStreamRec = (
  534.         ObjType : 15201;
  535.         VmtLink : Ofs(TypeOf(TSFXButton)^);
  536.         Load    : @TSFXButton.Load;
  537.         Store   : @TSFXButton.Store);
  538.  
  539.     RSFXStatic : TStreamRec = (
  540.         ObjType : 15202;
  541.         VmtLink : Ofs(TypeOf(TSFXStatic)^);
  542.         Load    : @TSFXStatic.Load;
  543.         Store   : @TSFXStatic.Store);
  544.  
  545.     RSFXShade : TStreamRec = (
  546.         ObjType : 15203;
  547.         VmtLink : Ofs(TypeOf(TSFXShade)^);
  548.         Load    : @TSFXShade.Load;
  549.         Store   : @TSFXShade.Store);
  550.  
  551.     RSFXCheckBox : TStreamRec = (
  552.         ObjType : 15204;
  553.         VmtLink : Ofs(TypeOf(TSFXCheckBox)^);
  554.         Load    : @TSFXCheckBox.Load;
  555.         Store   : @TSFXCheckBox.Store);
  556.  
  557.     RSFXRadioButton : TStreamRec = (
  558.         ObjType : 15205;
  559.         VmtLink : Ofs(TypeOf(TSFXRadioButton)^);
  560.         Load    : @TSFXRadioButton.Load;
  561.         Store   : @TSFXRadioButton.Store);
  562.  
  563.     RSFXScrollBar : TStreamRec = (
  564.         ObjType : 15206;
  565.         VmtLink : Ofs(TypeOf(TSFXScrollBar)^);
  566.         Load    : @TSFXScrollBar.Load;
  567.         Store   : @TSFXScrollBar.Store);
  568.  
  569.     RSFXEdit : TStreamRec = (
  570.         ObjType : 15207;
  571.         VmtLink : Ofs(TypeOf(TSFXEdit)^);
  572.         Load    : @TSFXEdit.Load;
  573.         Store   : @TSFXEdit.Store);
  574.  
  575.     RSFXListBox : TStreamRec = (
  576.         ObjType : 15208;
  577.         VmtLink : Ofs(TypeOf(TSFXListBox)^);
  578.         Load    : @TSFXListBox.Load;
  579.         Store   : @TSFXListBox.Store);
  580.  
  581.     RSFXComboBox : TStreamRec = (
  582.         ObjType : 15209;
  583.         VmtLink : Ofs(TypeOf(TSFXComboBox)^);
  584.         Load    : @TSFXComboBox.Load;
  585.         Store   : @TSFXComboBox.Store);
  586.  
  587.     RSFXMDIClient : TStreamRec = (
  588.         ObjType : 15210;
  589.         VmtLink : Ofs(TypeOf(TSFXMDIClient)^);
  590.         Load    : @TSFXMDIClient.Load;
  591.         Store   : @TSFXMDIClient.Store);
  592.  
  593.     RSFXToolbar : TStreamRec = (
  594.         ObjType : 15211;
  595.         VmtLink : Ofs(TypeOf(TSFXToolbar)^);
  596.         Load    : @TSFXToolbar.Load;
  597.         Store   : @TSFXToolbar.Store);
  598.  
  599.     RSFXPercent : TStreamRec = (
  600.         ObjType : 15212;
  601.         VmtLink : Ofs(TypeOf(TSFXPercent)^);
  602.         Load    : @TSFXPercent.Load;
  603.         Store   : @TSFXPercent.Store);
  604.  
  605.     RSFXDivider : TStreamRec = (
  606.         ObjType : 15213;
  607.         VmtLink : Ofs(TypeOf(TSFXDivider)^);
  608.         Load    : @TSFXDivider.Load;
  609.         Store   : @TSFXDivider.Store);
  610.  
  611.     RSFXBitmap : TStreamRec = (
  612.         ObjType : 15214;
  613.         VmtLink : Ofs(TypeOf(TSFXBitmap)^);
  614.         Load    : @TSFXBitmap.Load;
  615.         Store   : @TSFXBitmap.Store);
  616.  
  617.     RSFXWindow : TStreamRec = (
  618.         ObjType : 15215;
  619.         VmtLink : Ofs(TypeOf(TSFXWindow)^);
  620.         Load    : @TSFXWindow.Load;
  621.         Store   : @TSFXWindow.Store);
  622.  
  623.     RSFXMDIWindow : TStreamRec = (
  624.         ObjType : 15218;
  625.         VmtLink : Ofs(TypeOf(TSFXMDIWindow)^);
  626.         Load    : @TSFXMDIWindow.Load;
  627.         Store   : @TSFXMDIWindow.Store);
  628.  
  629. implementation
  630.  
  631. {********** TSFXButton **********}
  632.  
  633. constructor TSFXButton.Init (AParent: PWindowsObject; AnID: Integer; AText: PChar;
  634.                                                          X, Y, W, H: Integer);
  635. begin
  636.     TButton.Init(AParent, AnID, AText, X, Y, W, H, False);
  637. end;
  638.  
  639. constructor TSFXButton.InitResource (AParent: PWindowsObject; ResourceID: Word);
  640. begin
  641.     TButton.InitResource(AParent, ResourceID);
  642. end;
  643.  
  644. function TSFXButton.GetClassName: PChar;
  645. begin
  646.     GetClassName := 'SFXButton';
  647. end;
  648.  
  649. procedure TSFXButton.SetButton (NewID: Integer);
  650. begin
  651.     (* Sets the button id to AnID and changes the button's bitmaps, if any?
  652.      *)
  653.     SendMessage(HWindow, wm_SetBitmap, NewID, 0);
  654. end;
  655.  
  656. procedure TSFXButton.SetIcon (NewIcon: HIcon);
  657. var
  658.     lStyle : LongInt;
  659. begin
  660.     (* If the button is an icon button (MBS_ICONBUTTON style), SetIcon changes
  661.      * the icon displayed by the button to NewIcon. SFX200.DLL doesn't delete
  662.      * the icon handle, that's your responsibilty.
  663.      *)
  664.     lStyle := GetWindowLong(HWindow, GWL_STYLE);
  665.     if lStyle and $F = mbs_IconButton then
  666.         SendMessage(HWindow, wm_SetBitmap, NewIcon, 0);
  667. end;
  668.  
  669. procedure TSFXButton.SetText (ATextString: PChar);
  670. begin
  671.     (* Sets a text button's text to ATextString.
  672.      *)
  673.     SetWindowText(HWindow, ATextString);
  674. end;
  675.  
  676. {********** TSFXStatic **********}
  677.  
  678. function TSFXStatic.GetClassName: PChar;
  679. begin
  680.     GetClassName := 'SFXStatic';
  681. end;
  682.  
  683. {********** TSFXShade **********}
  684.  
  685. constructor TSFXShade.Init(AParent: PWindowsObject; AnID: Integer;
  686.                                                      AText: PChar; X, Y, W, H: Integer);
  687. begin
  688.     (* DO NOT set the bs_GroupBox style flag, TSFXShade doesn't use it!
  689.      *)
  690.     TGroupBox.Init(AParent, AnId, AText, X, Y, W, H);
  691.     Attr.Style := ws_Child or ws_Visible or ws_ClipSiblings;
  692. end;
  693.  
  694. constructor TSFXShade.InitResource (AParent: PWindowsObject; ResourceID: Word);
  695. begin
  696.     TGroupBox.InitResource(AParent, ResourceID);
  697. end;
  698.  
  699. function TSFXShade.GetClassName: PChar;
  700. begin
  701.     GetClassName := 'SFXShade';
  702. end;
  703.  
  704. {********** TSFXCheckBox **********}
  705.  
  706. function TSFXCheckBox.GetClassName: PChar;
  707. begin
  708.     GetClassName := 'SFXCheck';
  709. end;
  710.  
  711. {********** TSFXRadioButton **********}
  712.  
  713. function TSFXRadioButton.GetClassName: PChar;
  714. begin
  715.     GetClassName := 'SFXRadio';
  716. end;
  717.  
  718. {********** TSFXScrollBar **********}
  719.  
  720. function TSFXScrollBar.GetClassName: PChar;
  721. begin
  722.     GetClassName := 'SFXScrollBar';
  723. end;
  724.  
  725. {********** TSFXEdit **********}
  726.  
  727. function TSFXEdit.GetClassName: PChar;
  728. begin
  729.     GetClassName := 'SFXEdit';
  730. end;
  731.  
  732. {********** TSFXListBox **********}
  733.  
  734. function TSFXListBox.GetClassName: PChar;
  735. begin
  736.     GetClassName := 'SFXListBox';
  737. end;
  738.  
  739. {********** TSFXComboBox **********}
  740.  
  741. function TSFXComboBox.GetClassName: PChar;
  742. begin
  743.     GetClassName := 'SFXComboBox';
  744. end;
  745.  
  746. {********** TSFXToolbar **********}
  747.  
  748. constructor TSFXToolbar.Init (AParent: PWindowsObject; AnID: Integer; ATitle: PChar;
  749.                                                             X, Y: Integer; IsChild: Boolean);
  750. begin
  751.     TWindow.Init(AParent, ATitle);
  752.     SetFlags(wb_MDIChild, False);
  753.     if IsChild then
  754.     begin
  755.         Attr.Style := ws_Child or ws_Visible or ws_Group or ws_Tabstop;
  756.         Attr.ID := AnID;
  757.     end
  758.     else
  759.         Attr.Style := ws_PopupWindow or ws_Caption or ws_Visible or mtb_3DFrame;
  760.     Attr.X := X;
  761.     Attr.Y := Y;
  762. end;
  763.  
  764. constructor TSFXToolbar.InitResource (AParent: PWindowsObject; ResourceID: Word);
  765. begin
  766.     TWindow.InitResource(AParent, ResourceID);
  767. end;
  768.  
  769. function TSFXToolbar.Register: Boolean;
  770. begin
  771.     Register := True;
  772. end;
  773.  
  774. function TSFXToolbar.GetClassName: PChar;
  775. begin
  776.     GetClassName := 'SFXToolbar';
  777. end;
  778.  
  779. procedure TSFXToolbar.WMPaint (var Msg: TMessage);
  780. begin
  781.     DefWndProc(Msg);
  782. end;
  783.  
  784. procedure TSFXToolbar.GetTitle (ATextString: PChar);
  785. var
  786.     HText : THandle;
  787.     PText : PChar;
  788. begin
  789.     (* GetTitle retrieves the full title text that was used to create the toolbar.
  790.      *)
  791.     HText := GetWindowWord(HWindow, 4);
  792.     if HText <> 0 then
  793.     begin
  794.         PText := GlobalLock(HText);
  795.         lstrcpyn(ATextString, PText, lstrlen(PText) + 1);
  796.         GlobalUnlock(HText);
  797.     end;
  798. end;
  799.  
  800. procedure TSFXToolbar.AlignToolbar;
  801. begin
  802.     (* Realigns a top, left, right or bottom aligned toolbar and status bar. You
  803.      * should add AlignToolbar to your window's WM_SIZE method so that the toolbar
  804.      * (or status bar) is properly realigned when ever the window is resized.
  805.      *)
  806.     SendMessage(HWindow, wm_AlignToolbar, 0, 0);
  807. end;
  808.  
  809. function TSFXToolbar.GetCheck (ToolID: Integer): Word;
  810. begin
  811.     (* GetCheck returns the check state (bf_Checked or bf_Unchecked) of the
  812.      * radiobutton-style toolbar button identified by ToolID.
  813.      *)
  814.     GetCheck := SendMessage(HWindow, wm_GetCheck, ToolID, 0);
  815. end;
  816.  
  817. procedure TSFXToolbar.CheckTool (ToolID: Integer);
  818. begin
  819.     (* CheckTool checks the toolbar button identified by ToolID. All other
  820.      * toolbar buttons are unchecked.
  821.      *)
  822.     SendMessage(HWindow, wm_SetCheck, ToolID, 1);
  823. end;
  824.  
  825. procedure TSFXToolbar.UncheckTool (ToolID: Integer);
  826. begin
  827.     (* UncheckTool unchecks the toolbar button identifed by ToolID.
  828.      *)
  829.     SendMessage(HWindow, wm_SetCheck, ToolID, 0);
  830. end;
  831.  
  832. function TSFXToolbar.IsToolEnabled (ToolID: Integer): BOOL;
  833. begin
  834.     (* IsToolEnabled returns TRUE if the toolbar button identifed by ToolID
  835.      * is enabled. Otherwise it returns FALSE.
  836.      *)
  837.     IsToolEnabled := IsWindowEnabled(GetDlgItem(HWindow, ToolID));
  838. end;
  839.  
  840. procedure TSFXToolbar.EnableTool (ToolID: Integer; Enabled: BOOL);
  841. begin
  842.     (* EnableTool enables/disables the toolbar button identfied by ToolID.
  843.      * If Enabled is TRUE ToolID is enabled. If its FALSE its disabled.
  844.      *)
  845.     if (Enabled and not IsToolEnabled(ToolID)) then
  846.     begin
  847.         EnableWindow(GetDlgItem(HWindow, ToolID), True);
  848.         InvalidateRect(GetDlgItem(HWindow, ToolID), nil, True);
  849.     end
  850.     else
  851.     if (IsToolEnabled(ToolID) and not Enabled) then
  852.     begin
  853.         EnableWindow(GetDlgItem(HWindow, ToolID), False);
  854.         InvalidateRect(GetDlgItem(HWindow, ToolID), nil, True);
  855.     end
  856. end;
  857.  
  858. procedure TSFXToolbar.GetText (ATextString: PChar);
  859. begin
  860.     (* GetText retrieves the text displayed in a toolbar/statusbar.
  861.      *)
  862.     GetWindowText(StatusWindow, ATextString, SizeOf(ATextString));
  863. end;
  864.  
  865. procedure TSFXToolbar.SetText (ATextString: PChar);
  866. begin
  867.     (* SetText sets the text in a toolbar/statusbar.
  868.      *)
  869.     if (Attr.Style and $F00 <> mtb_Left) and (Attr.Style and $F00 <> mtb_Right) and
  870.          (Attr.Style and $F00 <> mtb_Float) then
  871.         SetWindowText(StatusWindow, ATextString);
  872. end;
  873.  
  874. procedure TSFXToolbar.SetFont (Font: HFont);
  875. begin
  876.     (* SetFont sets the toolbar/statusbar font to 'Font'.
  877.      *)
  878.     SendMessage(StatusWindow, wm_SetFont, Font, 1);
  879. end;
  880.  
  881. procedure TSFXToolbar.SetTool (NewID, ToolID: Integer);
  882. begin
  883.     (* SetTool changes a toolbar button's ID and bitmaps. AnID is the new button ID
  884.          and ToolID is the current button ID. Resource bitmaps must be specified
  885.          for AnID.
  886.      *)
  887.     SendMessage(HWindow, wm_SetBitmap, NewID, ToolID);
  888. end;
  889.  
  890. function TSFXToolbar.StatusWindow: HWnd;
  891. begin
  892.     (* StatusWindow returns a handle to the toolbar/statusbar static control.
  893.      *)
  894.     StatusWindow := GetWindowWord(HWindow, mtb_WndStatic);
  895. end;
  896.  
  897. {********** TSFXPercent **********}
  898.  
  899. constructor TSFXPercent.Init (AParent: PWindowsObject; AnID: Integer;    X, Y, W, H: Integer);
  900. begin
  901.     TControl.Init(AParent, AnID, nil, X, Y, W, H);
  902.     DisableTransfer;
  903. end;
  904.  
  905. constructor TSFXPercent.InitResource (AParent: PWindowsObject; ResourceID: Word);
  906. begin
  907.     TControl.InitResource(AParent, ResourceID);
  908.     DisableTransfer;
  909. end;
  910.  
  911. function TSFXPercent.GetClassName: PChar;
  912. begin
  913.     GetClassName := 'SFXPercent';
  914. end;
  915.  
  916. function TSFXPercent.SetPercent (Percent: Word): LongInt;
  917. begin
  918.     (* SetPercent sets the percentage drawn to 'Percent'. Percent must be in
  919.      * the range 0 to 100%. When then percentage drawn reaches 100% the return
  920.      * value is 1. Otherwise the return value is zero.
  921.      *)
  922.     SetPercent := SendMessage(HWindow, wm_DrawPercent, Percent, 0);
  923. end;
  924.  
  925. procedure TSFXPercent.Reset;
  926. begin
  927.     (* Reset resets the percentage drawn to zero.
  928.      *)
  929.     SendMessage(HWindow, wm_ResetPercent, 0, 0);
  930. end;
  931.  
  932. {********** TSFXDivider **********}
  933.  
  934. constructor TSFXDivider.Init (AParent: PWindowsObject; AnID, X, Y, Length: Integer;
  935.                                                             IsVertical, IsHump, Borstyle: Boolean);
  936. begin
  937.     TControl.Init(AParent, AnID, nil, X, Y, 0, 0);
  938.   DisableTransfer;
  939.     Attr.Style := Attr.Style and (not ws_Tabstop);
  940.     if IsVertical then
  941.     begin
  942.         if IsHump then
  943.             Attr.Style := Attr.Style or msh_VHump
  944.     else
  945.             Attr.Style := Attr.Style or msh_VDip;
  946.         Attr.H := Length;
  947.     end
  948.     else
  949.     begin
  950.         if IsHump then
  951.             Attr.Style := Attr.Style or msh_HHump
  952.     else
  953.             Attr.Style := Attr.Style or msh_HDip;
  954.         Attr.W := Length;
  955.     end;
  956.     if Borstyle then
  957.         Attr.Style := Attr.Style or msh_BorStyle;
  958. end;
  959.  
  960. constructor TSFXDivider.InitResource (AParent: PWindowsObject; ResourceID: Word);
  961. begin
  962.     TControl.InitResource(AParent, ResourceID);
  963.   DisableTransfer;
  964. end;
  965.  
  966. function TSFXDivider.GetClassName: PChar;
  967. begin
  968.     GetClassName := 'SFXShade';
  969. end;
  970.  
  971. {********** TSFXBitmap **********}
  972.  
  973. constructor TSFXBitmap.Init (AParent: PWindowsObject; AnId: Integer; X, Y: Integer);
  974. begin
  975.     TControl.Init(AParent, AnId, nil, X, Y, 0, 0);
  976.     Attr.Style := (Attr.Style or mbs_Bitmap) and (not ws_Tabstop);
  977.   DisableTransfer;
  978. end;
  979.  
  980. constructor TSFXBitmap.InitResource (AParent: PWindowsObject; ResourceID: Word);
  981. begin
  982.   TControl.InitResource(AParent, ResourceID);
  983.   DisableTransfer;
  984. end;
  985.  
  986. function TSFXBitmap.GetClassName: PChar;
  987. begin
  988.     GetClassName := 'SFXButton';
  989. end;
  990.  
  991. {********** TSFXWindow **********}
  992.  
  993. constructor TSFXWindow.Init (AParent: PWindowsObject; AName: PChar);
  994. begin
  995.     TWindow.Init(AParent, AName);
  996.     if IsFlagSet(wb_MDIChild) then
  997.         DefaultProc := @SFXDefMDIChildProc
  998.     else
  999.         DefaultProc := @SFXDefWindowProc;
  1000. end;
  1001.  
  1002. constructor TSFXWindow.Load(var S: TStream);
  1003. begin
  1004.     TWindow.Load(S);
  1005.     S.Read(DefaultProc, SizeOf(DefaultProc));
  1006. end;
  1007.  
  1008. procedure TSFXWindow.Store(var S: TStream);
  1009. begin
  1010.     TWindow.Store(S);
  1011.     S.Write(DefaultProc, SizeOf(DefaultProc));
  1012. end;
  1013.  
  1014. {********** TSFXMDIClient **********}
  1015.  
  1016. constructor TSFXMDIClient.Init(AParent: PMDIWindow; SFXClient: Boolean);
  1017. begin
  1018.     TMDIClient.Init(AParent);
  1019.     if SFXClient then
  1020.         IsSFXClient := True
  1021.     else
  1022.         IsSFXClient := False;
  1023. end;
  1024.  
  1025. function TSFXMDIClient.GetClassName: PChar;
  1026. begin
  1027.     if IsSFXClient then
  1028.         GetClassName := 'SFXMDIClient'
  1029.     else
  1030.         GetClassName := 'SFX3DMDIClient'
  1031. end;
  1032.  
  1033. {********** TSFXMDIWindow **********}
  1034.  
  1035. constructor TSFXMDIWindow.Init(ATitle: PChar; AMenu: HMenu);
  1036. begin
  1037.     TMDIWindow.Init(ATitle, AMenu);
  1038.     with Attr do
  1039.         Style := Style or mws_3DFrame;
  1040. end;
  1041.  
  1042. procedure TSFXMDIWindow.GetWindowClass (var AWndClass: TWndClass);
  1043. begin
  1044.     TMDIWindow.GetWindowClass(AWndClass);
  1045.     AWndClass.hbrBackground := 0;
  1046. end;
  1047.  
  1048. procedure TSFXMDIWindow.InitClientWindow;
  1049. begin
  1050.     ClientWnd := New(PSFXMDIClient, Init(@Self, False));
  1051. end;
  1052.  
  1053. procedure TSFXMDIWindow.DefWndProc (var Msg: TMessage);
  1054. begin
  1055.     with Msg do
  1056.         Result := SFXDefFrameProc(HWindow, ClientWnd^.HWindow, Message, wParam, lParam);
  1057. end;
  1058.  
  1059. {********** SFXDefMsgBox **********}
  1060.  
  1061. function SFXDefMsgBox (WndParent: HWnd; Txt, Caption: PChar; TextType: Word): Integer;
  1062. begin
  1063.     (* SFXDefMsgBox is used to substitute an SFX style message box for the Windows API
  1064.      * MessageBox. The SFXMsgBox function can't be used directly because it takes an
  1065.      * extra argument. You can change the default message box by changing the
  1066.      * SFXMsgBox's wStyle argument.
  1067.      *)
  1068.     SFXDefMsgBox := SFXMsgBox(WndParent, Txt, Caption, TextType, MWS_SFXFRAME);
  1069. end;
  1070.  
  1071. {********** RegisterSFX200 **********}
  1072.  
  1073. procedure RegisterSFX200;
  1074. begin
  1075.     RegisterType(RSFXButton);
  1076.     RegisterType(RSFXStatic);
  1077.     RegisterType(RSFXShade);
  1078.     RegisterType(RSFXCheckBox);
  1079.     RegisterType(RSFXRadioButton);
  1080.     RegisterType(RSFXScrollBar);
  1081.     RegisterType(RSFXEdit);
  1082.     RegisterType(RSFXListBox);
  1083.     RegisterType(RSFXComboBox);
  1084.     RegisterType(RSFXMDIClient);
  1085.     RegisterType(RSFXToolbar);
  1086.     RegisterType(RSFXPercent);
  1087.     RegisterType(RSFXDivider);
  1088.     RegisterType(RSFXBitmap);
  1089.     RegisterType(RSFXWindow);
  1090.     RegisterType(RSFXMDIWindow);
  1091. end;
  1092.  
  1093. {********** Unit Exit Procedure **********}
  1094.  
  1095. procedure UnitExit;
  1096. begin
  1097.     FreeLibrary(SFXLib);
  1098.     ExitProc := SaveExit;
  1099. end;
  1100.  
  1101. begin
  1102.     { This unit automatically loads and unloads SFX200.DLL }
  1103.     SetErrorMode(SEM_NoOpenFileErrorBox);
  1104.     SFXLib := LoadLibrary('SFX200.DLL');
  1105.     if SFXLib < HINSTANCE_ERROR then
  1106.     begin
  1107.         MessageBox(0, 'SFX200.dll could not be found!  This application requires SFX200.dll ' +
  1108.                                     'to be in your Windows system subdirectory.',
  1109.                                     'Unable to load application', mb_Ok or mb_IconStop);
  1110.         Halt(1);
  1111.     end
  1112.     else
  1113.     begin
  1114.         @AlignBrush := GetProcAddress(SFXLib, PChar(7));
  1115.         @BlackFrame := GetProcAddress(SFXLib, PChar(8));
  1116.         @CenterWindow := GetProcAddress(SFXLib, PChar(9));
  1117.         @ChildToParentRect := GetProcAddress(SFXLib, PChar(10));
  1118.         @DrawBorder := GetProcAddress(SFXLib, PChar(11));
  1119.         @Draw3DBorder := GetProcAddress(SFXLib, PChar(12));
  1120.         @EraseObject := GetProcAddress(SFXLib, PChar(13));
  1121.         @GetSFXInstance := GetProcAddress(SFXLib, PChar(14));
  1122.         @GetSFXObject := GetProcAddress(SFXLib, PChar(15));
  1123.         @GetSFXTemplate := GetProcAddress(SFXLib, PChar(16));
  1124.         @GetSFXTemplateId := GetProcAddress(SFXLib, PChar(17));
  1125.         @GetSFXVersion := GetProcAddress(SFXLib, PChar(18));
  1126.         @IsNCActive := GetProcAddress(SFXLib, PChar(19));
  1127.         @PtInClient := GetProcAddress(SFXLib, PChar(20));
  1128.         @PtInWindow := GetProcAddress(SFXLib, PChar(21));
  1129.         @SFXDirBox := GetProcAddress(SFXLib, PChar(22));
  1130.         @SFXOpenDir := GetProcAddress(SFXLib, PChar(23));
  1131.         @SFXOpenFile := GetProcAddress(SFXLib, PChar(24));
  1132.         @SFXSaveFile := GetProcAddress(SFXLib, PChar(25));
  1133.         @SFXChooseColor := GetProcAddress(SFXLib, PChar(26));
  1134.         @SFXChooseFont := GetProcAddress(SFXLib, PChar(27));
  1135.         @GetSFXCtrlFont := GetProcAddress(SFXLib, PChar(28));
  1136.         @SFXDefWindowProc := GetProcAddress(SFXLib, PChar(1));
  1137.         @SFXDefDlgProc := GetProcAddress(SFXLib, PChar(2));
  1138.         @SFXDefFrameProc := GetProcAddress(SFXLib, PChar(3));
  1139.         @SFXDefMDIChildProc := GetProcAddress(SFXLib, PChar(4));
  1140.         @SFXMsgBox := GetProcAddress(SFXLib, PChar(5));
  1141.         @SFXInputBox := GetProcAddress(SFXLib, PChar(6));
  1142.         RegisterSFX200;
  1143.  
  1144.         (* Substitutes DefDlgProc with SFXDefDlgProc and MessageBox with SFXDefMsgBox.
  1145.          * SFXDefDlgProc becomes the default dialog procedure. Any calls to the API
  1146.          * MessageBox function displays the SFX style message box declared in SFXDefMsgBox.
  1147.          *)
  1148.         {$IFDEF Ver15}
  1149.             WObjects.DefDlgProc := SFXDefDlgProc;
  1150.             WObjects.MessageBox := SFXDefMsgBox;
  1151.         {$ELSE}
  1152.             OWindows.DefDlgProc := SFXDefDlgProc;
  1153.             OWindows.MessageBox := SFXDefMsgBox;
  1154.         {$ENDIF}
  1155.         ExitProc := @UnitExit;
  1156.     end;
  1157. end.
  1158.