摘要:
在Delphi中,事件实际上是专门化的属性,它是一个过程(procedure)的指针。要添加事件,首先应在所定义的类中说明一个用来指向事件过程的指针,该指针的作用是当事件一旦发生,就通过这个指针执行所指向的处理这个事件的过程。最后通过指定符 published公布定义的事件属性以及与之关联的事件处理过程指针。private FpCalc : TNotifyEvent;//事件处理过程指针published property OnpCalc:TNotifyevent read FpCalc write FpCalc;{定义事件属性名}procedure TForm1.pCalc(Sender: 阅读全文
posted @ 2008-04-05 14:31
delphi中间件
阅读(542)
评论(0)
推荐(0)
摘要:
function MainApplicationHandle: HWND;var MainModule: HMODULE; CurrentPID: DWORD; WindowsPID: DWORD;begin MainModule := GetModuleHandle(nil); CurrentPID := GetCurrentProcessID(); Result := 0; while True do begin Result := FindWindowEx(0, Result, 'TApplication', nil); if (Result = 0) then Exit 阅读全文
posted @ 2008-04-05 14:15
delphi中间件
阅读(319)
评论(0)
推荐(0)
摘要:
设置TreeView的DragMode = dmAutoMaticprocedure TFmMain.TreeLeftDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);begin Accept := False ; //if (source is TTreeNode) or (Source is TListItem) then if (source is TTreeView) or (source is TListview) then Accept := true . 阅读全文
posted @ 2008-04-05 13:40
delphi中间件
阅读(591)
评论(0)
推荐(0)
摘要:
是否想为你的Windows加上一双眼睛,察看使用者在机器上所做的各种操作(例如建立、删除文件;改变文件或目录名字)呢? 这里介绍一种利用Windows未公开函数实现这个功能的方法。 在Windows下有一个未公开函数SHChangeNotifyRegister可以把你的窗口添加到系统的系统消息监视链中,该函数在Delphi中的定义如下: Function SHChangeNotifyRegister(hWnd,uFlags,dwEventID,uMSG,cItems:LongWord; lpps:PIDLSTRUCT):integer;stdcall;external 'She... 阅读全文
posted @ 2008-04-05 13:16
delphi中间件
阅读(254)
评论(0)
推荐(0)