D
dalse
Unregistered / Unconfirmed
GUEST, unregistred user!
如下代码,首先是通过FindWindow查找主窗口的句柄,然后通过FindwindowEx查找子窗口的句柄,能否实现不通过FinWindow达到查找子窗口句柄,而是通过应用程序名来查找呢? LoadLibrary('E:/Dll.dll'); if DllHandle>32 then try //通过窗口标题用FindWindow找到要注入的程序的主窗口句柄pwnd PWND := FindWindow(Nil,'无标题 - 记事本'); //用FindwindowEx(hMain,0,nil,nil)找到要处理的子窗口句柄hChild hChild := FindWindowEx(PWND,0,Nil,Nil); //用getwindowThreadProcessid(hChild,nil)找到要注入的线程 dwThreadID := GetWindowThreadProcessid(hChild,Nil); .......except On E:Exception do Application.MessageBox(Pchar(E.Message),Pchar(Caption),MB_IconError+MB_Ok); end;end;