用钩子勾住EM_CHANGE消息,判别消息是来自那一个应用程序(handle)<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var lppe: TProcessEntry32;<br> found : boolean;<br> Hand : THandle;<br>begin<br> Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);<br> found := Process32First(Hand,lppe);<br> if found then<br> begin<br> //<font color="#ff0000">这儿,一次获得每个窗口的句柄:lppe.th32ProcessID;</font><br> found := Process32Next(Hand,lppe);<br> end<br> else ListBox1.Items.Add('not found');<br>end;