一种利用Windows未公开函数实现机器上所做的各种操作

2019-10-08 09:56:00王旭

  end;
  procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  begin
  //在程序退出的同时删除监视
  if Boolean(m_pidlDesktop) then
  SHNotify_Unregister;
  end;
  procedure TForm1.Button1Click(Sender: TObject); //Button1的Click消息
  begin
  m_hSHNotify:=0;
  if SHNotify_Register(Form1.Handle) then begin //注册Shell监视
  ShowMessage( 'Shell监视程序成功注册 ');
  Button1.Enabled := False;
  end
  else
  ShowMessage( 'Shell监视程序注册失败 ');
  end;
  procedure TForm1.FormCreate(Sender: TObject);
  begin
  Button1.Caption := '打开监视 ';