Permalink
Browse files

DvcObserver. DvcList 등록

  • Loading branch information...
1 parent ad00512 commit 6baa912e53711bb8951c5a2df30aba1ca3e94600 @gomsun2 committed Mar 4, 2014
@@ -0,0 +1,18 @@
+object vMain: TvMain
+ Left = 0
+ Top = 0
+ Caption = 'vMain'
+ ClientHeight = 150
+ ClientWidth = 210
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ OldCreateOrder = False
+ OnCreate = FormCreate
+ OnDestroy = FormDestroy
+ PixelsPerInch = 96
+ TextHeight = 13
+end
@@ -0,0 +1,91 @@
+unit _v.Main;
+
+interface
+
+uses
+ mDeviceObserver.Windows.Common, mDeviceObserver.Windows,
+ mDeviceList.Windows, mDeviceList.Windows.Common, mDevice.Windows,
+
+ Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
+ Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
+
+type
+ TvMain = class(TForm)
+ procedure FormCreate(Sender: TObject);
+ procedure FormDestroy(Sender: TObject);
+ private
+ FDvcOb: TWinDeviceObserver;
+ procedure OnNodeChange(Sender: TObject; Node: Integer);
+ procedure OnArrived(Sender: TObject; Value: PDEV_BROADCAST_DEVICEINTERFACE);
+ procedure OnRemoved(Sender: TObject; Value: PDEV_BROADCAST_DEVICEINTERFACE);
+ public
+ end;
+
+var
+ vMain: TvMain;
+
+implementation
+
+{$R *.dfm}
+
+uses
+ mLog.CodeSite
+
+ ;
+
+procedure TvMain.FormCreate(Sender: TObject);
+begin
+ FDvcOb := TWinDeviceObserver.Create(Self);
+ FDvcOb.AddNotifycation(GUID_Ports);
+ FDvcOb.AddNotifycation(GUID_USB);
+ FDvcOb.AddNotifycation(GUID_Net);
+ FDvcOb.OnNodeChange := OnNodeChange;
+ FDvcOb.OnArrived := OnArrived;
+ FDvcOb.OnRemoved := OnRemoved;
+end;
+
+procedure TvMain.FormDestroy(Sender: TObject);
+begin
+ FreeAndNil(FDvcOb);
+end;
+
+procedure TvMain.OnArrived(Sender: TObject;
+ Value: PDEV_BROADCAST_DEVICEINTERFACE);
+var
+ LInfos: TStringList;
+ LItem: String;
+begin
+ Log.Enter('OnArrived');
+ LInfos := TDbDiTo.Infos(Value);
+ try
+ for LItem in LInfos do
+ Log.Msg(LItem);
+ finally
+ FreeAndNil(LInfos);
+ end;
+ Log.Exit('OnArrived');
+end;
+
+procedure TvMain.OnNodeChange(Sender: TObject; Node: Integer);
+begin
+ Log.Msg('OnNodeChange.Node %d', [Node]);
+end;
+
+procedure TvMain.OnRemoved(Sender: TObject;
+ Value: PDEV_BROADCAST_DEVICEINTERFACE);
+var
+ LInfos: TStringList;
+ LItem: String;
+begin
+ Log.Enter('OnRemoved');
+ LInfos := TDbDiTo.Infos(Value);
+ try
+ for LItem in LInfos do
+ Log.Msg(LItem);
+ finally
+ FreeAndNil(LInfos);
+ end;
+ Log.Exit('OnRemoved');
+end;
+
+end.
@@ -0,0 +1,14 @@
+program mDvcObserverWM_DEVICECHANGE;
+
+uses
+ Vcl.Forms,
+ _v.Main in '_v.Main.pas' {vMain};
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.MainFormOnTaskbar := True;
+ Application.CreateForm(TvMain, vMain);
+ Application.Run;
+end.
@@ -0,0 +1,185 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{D72E429A-5620-4111-8394-FBFC3E5536FF}</ProjectGuid>
+ <ProjectVersion>14.4</ProjectVersion>
+ <FrameworkType>VCL</FrameworkType>
+ <MainSource>mDvcObserverWM_DEVICECHANGE.dpr</MainSource>
+ <Base>True</Base>
+ <Config Condition="'$(Config)'==''">Debug</Config>
+ <Platform Condition="'$(Platform)'==''">Win32</Platform>
+ <TargetedPlatforms>1</TargetedPlatforms>
+ <AppType>Application</AppType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+ <Base_Win32>true</Base_Win32>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+ <Base_Win64>true</Base_Win64>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
+ <Cfg_1>true</Cfg_1>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
+ <Cfg_1_Win32>true</Cfg_1_Win32>
+ <CfgParent>Cfg_1</CfgParent>
+ <Cfg_1>true</Cfg_1>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
+ <Cfg_2>true</Cfg_2>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
+ <Cfg_2_Win32>true</Cfg_2_Win32>
+ <CfgParent>Cfg_2</CfgParent>
+ <Cfg_2>true</Cfg_2>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base)'!=''">
+ <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+ <Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
+ <Manifest_File>None</Manifest_File>
+ <DCC_UnitSearchPath>..\..\source\device.win;..\..\source\utils.win;..\..\source\utils;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
+ <VerInfo_Locale>1042</VerInfo_Locale>
+ <DCC_DcuOutput>.\dcu\$(Platform)$(Config)</DCC_DcuOutput>
+ <DCC_ExeOutput>.\bin\</DCC_ExeOutput>
+ <DCC_E>false</DCC_E>
+ <DCC_N>false</DCC_N>
+ <DCC_S>false</DCC_S>
+ <DCC_F>false</DCC_F>
+ <DCC_K>false</DCC_K>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base_Win32)'!=''">
+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+ <DCC_UsePackage>AnyDAC_PhysMySQL_D17;DBXSqliteDriver;fmx;TreeViewPresenter;IndySystem;i18n;DelphiXE3_RestApi;vclib;inetdbbde;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;AnyDAC_PhysMSAcc_D17;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;AnyDAC_PhysSQLITE_D17;TeeUI917;vcldb;vcldsnap;WTGrids.XE4;ChromeTabs_XE2_R;DBXDb2Driver;TestPackage;AnyDAC_ComI_D17;DBXOracleDriver;CustomIPTransport;AnyDAC_PhysMSSQL_D17;AnyDAC_Comp_D17;vclribbon;TeeDB917;dsnap;IndyIPServer;i18nDB;AnyDAC_PhysODBC_D17;fmxase;vcl;IndyCore;TeeLanguage917;AnyDAC_PhysPg_D17;IndyIPCommon;CloudService;DBXMSSQLDriver;CodeSiteExpressPkg;frxDB17;AnyDAC_PhysDb2_D17;wclr_dxe3;TeeWorld917;AnyDAC_PhysASA_D17;inetdbxpress;webdsnap;FMXTeePro917;JclDeveloperTools;AnyDAC_PhysOracle_D17;adortl;FMXTee917;FMXTeeDB917;TeeGL917;TeeTree2D17Tee9;FwComponents;fs17;frx17;bindcompfmx;DataBindingsVCL170;AnyDAC_GUIxForms_D17;vcldbx;rtl;dbrtl;DbxClientDriver;AnyDAC_PhysTDBX_D17;bindcomp;inetdb;JclContainers;DataBindings;DBXOdbcDriver;TeePro917;CPortLibDXE;xmlrtl;svnui;ibxpress;IndyProtocols;DBXMySQLDriver;vclactnband;bindengine;soaprtl;bindcompdbx;TSevenZip;bindcompvcl;Jcl;vclie;FmxTeeUI917;nrcommd17;vcltouch;websnap;AnyDAC_PhysADS_D17;AnyDAC_PhysIB_D17;VclSmp;DBXInformixDriver;Intraweb;DataSnapConnectors;dsnapcon;DBXFirebirdDriver;TIEHTTP_D12;inet;fsDB17;fmxobj;AnyDAC_Phys_D17;JclVcl;dorm_runtime_xe3;vclx;frxe17;svn;DBXSybaseASADriver;fmxdae;TeeImage917;Gomsun2Component;bdertl;VirtualTreesR;Tee917;FMXTeeLanguage917;dbexpress;DataSnapIndy10ServerTransport;EurekaLogCore;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
+ <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base_Win64)'!=''">
+ <DCC_UsePackage>AnyDAC_PhysMySQL_D17;DBXSqliteDriver;fmx;IndySystem;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;AnyDAC_PhysMSAcc_D17;dbxcds;DatasnapConnectorsFreePascal;AnyDAC_PhysSQLITE_D17;vcldb;vcldsnap;DBXDb2Driver;AnyDAC_ComI_D17;DBXOracleDriver;CustomIPTransport;AnyDAC_PhysMSSQL_D17;AnyDAC_Comp_D17;dsnap;IndyIPServer;AnyDAC_PhysODBC_D17;fmxase;vcl;IndyCore;AnyDAC_PhysPg_D17;IndyIPCommon;DBXMSSQLDriver;AnyDAC_PhysDb2_D17;wclr_dxe3;AnyDAC_PhysASA_D17;inetdbxpress;webdsnap;AnyDAC_PhysOracle_D17;adortl;bindcompfmx;AnyDAC_GUIxForms_D17;rtl;dbrtl;DbxClientDriver;AnyDAC_PhysTDBX_D17;bindcomp;inetdb;DBXOdbcDriver;xmlrtl;ibxpress;IndyProtocols;DBXMySQLDriver;vclactnband;bindengine;soaprtl;bindcompdbx;bindcompvcl;vclie;vcltouch;websnap;AnyDAC_PhysADS_D17;AnyDAC_PhysIB_D17;VclSmp;DBXInformixDriver;DataSnapConnectors;dsnapcon;DBXFirebirdDriver;inet;fmxobj;AnyDAC_Phys_D17;vclx;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1)'!=''">
+ <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+ <DCC_DebugDCUs>true</DCC_DebugDCUs>
+ <DCC_Optimize>false</DCC_Optimize>
+ <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+ <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
+ <DCC_RemoteDebug>true</DCC_RemoteDebug>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+ <DCC_RemoteDebug>false</DCC_RemoteDebug>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_2)'!=''">
+ <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+ <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+ <DCC_DebugInformation>false</DCC_DebugInformation>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
+ </PropertyGroup>
+ <ItemGroup>
+ <DelphiCompile Include="$(MainSource)">
+ <MainSource>MainSource</MainSource>
+ </DelphiCompile>
+ <DCCReference Include="_v.Main.pas">
+ <Form>vMain</Form>
+ <FormType>dfm</FormType>
+ </DCCReference>
+ <BuildConfiguration Include="Release">
+ <Key>Cfg_2</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Base">
+ <Key>Base</Key>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Debug">
+ <Key>Cfg_1</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ </ItemGroup>
+ <ProjectExtensions>
+ <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+ <Borland.ProjectType/>
+ <BorlandProject>
+ <Delphi.Personality>
+ <VersionInfo>
+ <VersionInfo Name="IncludeVerInfo">False</VersionInfo>
+ <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+ <VersionInfo Name="MajorVer">1</VersionInfo>
+ <VersionInfo Name="MinorVer">0</VersionInfo>
+ <VersionInfo Name="Release">0</VersionInfo>
+ <VersionInfo Name="Build">0</VersionInfo>
+ <VersionInfo Name="Debug">False</VersionInfo>
+ <VersionInfo Name="PreRelease">False</VersionInfo>
+ <VersionInfo Name="Special">False</VersionInfo>
+ <VersionInfo Name="Private">False</VersionInfo>
+ <VersionInfo Name="DLL">False</VersionInfo>
+ <VersionInfo Name="Locale">1042</VersionInfo>
+ <VersionInfo Name="CodePage">949</VersionInfo>
+ </VersionInfo>
+ <VersionInfoKeys>
+ <VersionInfoKeys Name="CompanyName"/>
+ <VersionInfoKeys Name="FileDescription"/>
+ <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
+ <VersionInfoKeys Name="InternalName"/>
+ <VersionInfoKeys Name="LegalCopyright"/>
+ <VersionInfoKeys Name="LegalTrademarks"/>
+ <VersionInfoKeys Name="OriginalFilename"/>
+ <VersionInfoKeys Name="ProductName"/>
+ <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+ <VersionInfoKeys Name="Comments"/>
+ <VersionInfoKeys Name="CFBundleName"/>
+ <VersionInfoKeys Name="CFBundleDisplayName"/>
+ <VersionInfoKeys Name="CFBundleIdentifier"/>
+ <VersionInfoKeys Name="CFBundleVersion"/>
+ <VersionInfoKeys Name="CFBundlePackageType"/>
+ <VersionInfoKeys Name="CFBundleSignature"/>
+ <VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
+ <VersionInfoKeys Name="CFBundleExecutable"/>
+ </VersionInfoKeys>
+ <Source>
+ <Source Name="MainSource">mDvcObserverWM_DEVICECHANGE.dpr</Source>
+ </Source>
+ <Excluded_Packages>
+ <Excluded_Packages Name="C:\realgridplus\WTGrids.XE3.eval.bpl">File C:\realgridplus\WTGrids.XE3.eval.bpl not found</Excluded_Packages>
+ <Excluded_Packages Name="C:\realgridplus\WTGrids.XE3.eval.release.bpl">File C:\realgridplus\WTGrids.XE3.eval.release.bpl not found</Excluded_Packages>
+ <Excluded_Packages Name="$(BDSBIN)\dcloffice2k170.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
+ <Excluded_Packages Name="$(BDSBIN)\dclofficexp170.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
+ </Excluded_Packages>
+ </Delphi.Personality>
+ <Deployment/>
+ <Platforms>
+ <Platform value="Win32">True</Platform>
+ <Platform value="Win64">False</Platform>
+ </Platforms>
+ </BorlandProject>
+ <ProjectFileVersion>12</ProjectFileVersion>
+ </ProjectExtensions>
+ <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
+ <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
+</Project>
+
+<!-- EurekaLog First Line
+[Exception Log]
+EurekaLog Version=7001
+Activate=0
+DeleteMapAfterCompile=1
+Encrypt Password=""
+EurekaLog Last Line -->
Oops, something went wrong.

0 comments on commit 6baa912

Please sign in to comment.