⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simpleactiveformimpl1.h

📁 网络编程的一些实例
💻 H
字号:
//---------------------------------------------------------------------------
#ifndef SimpleActiveFormImpl1H
#define SimpleActiveFormImpl1H
//---------------------------------------------------------------------------
#include <classes.hpp>
#include <controls.hpp>
#include <stdCtrls.hpp>
#include <forms.hpp>
#include "SimpleActiveFormProj1_TLB.h"
#include <AxCtrls.hpp>
#include <Classes.hpp>
#include <Controls.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <StdCtrls.hpp>
//---------------------------------------------------------------------------
class TSimpleActiveForm : public TActiveForm
{
__published:	// IDE-managed Components
        TImage *Image1;
        TButton *Button1;
        void __fastcall Button1Click(TObject *Sender);
private:	// User declarations
public:		// User declarations
    __fastcall TSimpleActiveForm(HWND ParentWindow);
    __fastcall TSimpleActiveForm(TComponent* AOwner): TActiveForm(AOwner) {};
};
//---------------------------------------------------------------------------
extern PACKAGE TSimpleActiveForm *SimpleActiveForm;
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
class ATL_NO_VTABLE TSimpleActiveFormImpl:
  VCLCONTROL_IMPL(TSimpleActiveFormImpl, SimpleActiveForm, TSimpleActiveForm, ISimpleActiveForm, DIID_ISimpleActiveFormEvents)
{
  void __fastcall ActivateEvent(TObject *Sender);
  void __fastcall ClickEvent(TObject *Sender);
  void __fastcall CreateEvent(TObject *Sender);
  void __fastcall DblClickEvent(TObject *Sender);
  void __fastcall DeactivateEvent(TObject *Sender);
  void __fastcall DestroyEvent(TObject *Sender);
  void __fastcall KeyPressEvent(TObject *Sender, char &Key);
  void __fastcall PaintEvent(TObject *Sender);
public:

  void InitializeControl()
  {
    m_VclCtl->OnActivate = ActivateEvent;
    m_VclCtl->OnClick = ClickEvent;
    m_VclCtl->OnCreate = CreateEvent;
    m_VclCtl->OnDblClick = DblClickEvent;
    m_VclCtl->OnDeactivate = DeactivateEvent;
    m_VclCtl->OnDestroy = DestroyEvent;
    m_VclCtl->OnKeyPress = KeyPressEvent;
    m_VclCtl->OnPaint = PaintEvent;
  }

// The COM MAP entries declares the interfaces your object exposes (through
// QueryInterface). CComRootObjectEx::InternalQueryInterface only returns
// pointers for interfaces in the COM map. VCL controls exposed as OCXes
// have a minimum set of interfaces defined by the
// VCL_CONTROL_COM_INTERFACE_ENTRIES macro. Add other interfaces supported
// by your object with additional COM_INTERFACE_ENTRY[_xxx] macros.
//
BEGIN_COM_MAP(TSimpleActiveFormImpl)
  VCL_CONTROL_COM_INTERFACE_ENTRIES(ISimpleActiveForm)
END_COM_MAP()



// The PROPERTY map stores property descriptions, property DISPIDs,
// property page CLSIDs and IDispatch IIDs. You may use use
// IPerPropertyBrowsingImpl, IPersistPropertyBagImpl, IPersistStreamInitImpl,
// and ISpecifyPropertyPageImpl to utilize the information in you property
// map.
//
// NOTE: The BCB Wizard does *NOT* maintain your PROPERTY_MAP table. You must
//       add or remove entries manually.
//
BEGIN_PROPERTY_MAP(TSimpleActiveFormImpl)
  // PROP_PAGE(CLSID_SimpleActiveFormPage)
END_PROPERTY_MAP()

// The DECLARE_ACTIVEXCONTROL_REGISTRY macro declares a static 'UpdateRegistry' 
// routine which registers the basic information about your control. The
// parameters expected by the macro are the ProgId & the ToolboxBitmap ID of
// your control.
//
DECLARE_ACTIVEXCONTROL_REGISTRY("SimpleActiveFormProj1.SimpleActiveForm", 1);

protected: 
  STDMETHOD(_set_Font(IFontDisp** Value));
  STDMETHOD(get_Active(TOLEBOOL* Value));
  STDMETHOD(get_AutoScroll(TOLEBOOL* Value));
  STDMETHOD(get_AutoSize(TOLEBOOL* Value));
  STDMETHOD(get_AxBorderStyle(TxActiveFormBorderStyle* Value));
  STDMETHOD(get_BorderWidth(long* Value));
  STDMETHOD(get_Caption(BSTR* Value));
  STDMETHOD(get_Color(::OLE_COLOR* Value));
  STDMETHOD(get_Cursor(short* Value));
  STDMETHOD(get_DoubleBuffered(TOLEBOOL* Value));
  STDMETHOD(get_DropTarget(TOLEBOOL* Value));
  STDMETHOD(get_Enabled(TOLEBOOL* Value));
  STDMETHOD(get_Font(IFontDisp** Value));
  STDMETHOD(get_HelpFile(BSTR* Value));
  STDMETHOD(get_KeyPreview(TOLEBOOL* Value));
  STDMETHOD(get_PixelsPerInch(long* Value));
  STDMETHOD(get_PrintScale(TxPrintScale* Value));
  STDMETHOD(get_Scaled(TOLEBOOL* Value));
  STDMETHOD(get_Visible(TOLEBOOL* Value));
  STDMETHOD(set_AutoScroll(TOLEBOOL Value));
  STDMETHOD(set_AutoSize(TOLEBOOL Value));
  STDMETHOD(set_AxBorderStyle(TxActiveFormBorderStyle Value));
  STDMETHOD(set_BorderWidth(long Value));
  STDMETHOD(set_Caption(BSTR Value));
  STDMETHOD(set_Color(::OLE_COLOR Value));
  STDMETHOD(set_Cursor(short Value));
  STDMETHOD(set_DoubleBuffered(TOLEBOOL Value));
  STDMETHOD(set_DropTarget(TOLEBOOL Value));
  STDMETHOD(set_Enabled(TOLEBOOL Value));
  STDMETHOD(set_Font(IFontDisp* Value));
  STDMETHOD(set_HelpFile(BSTR Value));
  STDMETHOD(set_KeyPreview(TOLEBOOL Value));
  STDMETHOD(set_PixelsPerInch(long Value));
  STDMETHOD(set_PrintScale(TxPrintScale Value));
  STDMETHOD(set_Scaled(TOLEBOOL Value));
  STDMETHOD(set_Visible(TOLEBOOL Value));
};
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -