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

📄 propedit.pas

📁 DSPack is a set of Components and class to write Multimedia Applications using MS Direct Show and Di
💻 PAS
字号:
unit PropEdit;

interface

uses SysUtils, Windows, Messages, Classes, Graphics, Controls, StdCtrls,
  ExtCtrls, Forms, BaseClass, ComObj, StdVcl, AxCtrls, DirectShow9, dsutil;

type
  TFormPropEdit = class(TFormPropertyPage)
    ListBox: TListBox;
    procedure FormDeactivate(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  public
    pin: IPin;
    Enum: TEnumMediaType;
    function OnConnect(Unknown: IUnknown): HRESULT; override;
    function OnDisconnect: HRESULT; override;
    function OnApplyChanges: HRESULT; override;
  end;

const
    CLSID_NullIPPropertyPage : TGUID = '{8928AD20-2FEE-11cf-BCB1-444553540000}';

implementation
uses main;

{$R *.DFM}


{ TFormPropEdit }

function TFormPropEdit.OnConnect(Unknown: IUnKnown): HRESULT;
var NullFilter: INullIPP;
begin
  Unknown.QueryInterface(INullIPP, NullFilter);
  NullFilter.get_IPin(pin);
  result := NOERROR;
end;

function TFormPropEdit.OnDisconnect: HRESULT;
begin
  Pin := nil;
  result := NOERROR;
end;

procedure TFormPropEdit.FormActivate(Sender: TObject);
var
  i: integer;
begin
  ListBox.Clear;
  if Pin = nil then exit;
  Enum:= TEnumMediaType.Create(pin);
  if Enum.Count > 0 then
    for i := 0 to Enum.Count - 1 do
      ListBox.Items.Add(Enum.MediaDescription[i]);
end;

procedure TFormPropEdit.FormDeactivate(Sender: TObject);
begin
  Enum.Free;
end;

function TFormPropEdit.OnApplyChanges: HRESULT;
begin
  result := NOERROR;
end;

initialization

  TBCClassFactory.CreatePropertyPage(TFormPropEdit, CLSID_NullIPPropertyPage);

end.
 

⌨️ 快捷键说明

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