摘要:
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 阅读全文
摘要:
设置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 . 阅读全文
摘要:
是否想为你的Windows加上一双眼睛,察看使用者在机器上所做的各种操作(例如建立、删除文件;改变文件或目录名字)呢? 这里介绍一种利用Windows未公开函数实现这个功能的方法。 在Windows下有一个未公开函数SHChangeNotifyRegister可以把你的窗口添加到系统的系统消息监视链中,该函数在Delphi中的定义如下: Function SHChangeNotifyRegister(hWnd,uFlags,dwEventID,uMSG,cItems:LongWord; lpps:PIDLSTRUCT):integer;stdcall;external 'She... 阅读全文