我是按这里原文做的:
http://dev.csdn.net/develop/article/22/22765.shtm我调用方法如下:procedure TForm1.Button1Click(Sender: TObject);
var
ModuleHandle: THandle;
TmpWndHandle: THandle;
s:TSOCKET;//创建Socket对象
Info:string;
BufSend,BufRecv:pchar;
Re:Integer;
begin
TmpWndHandle := 0;
TmpWndHandle := FindWindow(nil, 'flashfxp');
if not isWindow(TmpWndHandle) then
begin
MessageBox(self.Handle, '没有找到窗口', '!!!', MB_OK);
exit;
end;
ModuleHandle := LoadLibrary('Hook.dll');
@InstallHook := GetProcAddress(ModuleHandle, 'InstallHook');
@UnHook := GetProcAddress(ModuleHandle, 'UnHook');
if InstallHook(FindWindow(nil, 'Untitled')) then
ShowMessage('Hook OK');
GetMem(BufRecv,1024);
ZeroMemory(bufRecv,1024);
re := MyRecv(s, BufRecv^, 1024, 0); //执行到这里出错~~
if re>0 then
begin
Info:=StrPas(bufRecv);
memo1.Text:=info;
end;
end;请问怎样解决了?
http://dev.csdn.net/develop/article/22/22765.shtm我调用方法如下:procedure TForm1.Button1Click(Sender: TObject);
var
ModuleHandle: THandle;
TmpWndHandle: THandle;
s:TSOCKET;//创建Socket对象
Info:string;
BufSend,BufRecv:pchar;
Re:Integer;
begin
TmpWndHandle := 0;
TmpWndHandle := FindWindow(nil, 'flashfxp');
if not isWindow(TmpWndHandle) then
begin
MessageBox(self.Handle, '没有找到窗口', '!!!', MB_OK);
exit;
end;
ModuleHandle := LoadLibrary('Hook.dll');
@InstallHook := GetProcAddress(ModuleHandle, 'InstallHook');
@UnHook := GetProcAddress(ModuleHandle, 'UnHook');
if InstallHook(FindWindow(nil, 'Untitled')) then
ShowMessage('Hook OK');
GetMem(BufRecv,1024);
ZeroMemory(bufRecv,1024);
re := MyRecv(s, BufRecv^, 1024, 0); //执行到这里出错~~
if re>0 then
begin
Info:=StrPas(bufRecv);
memo1.Text:=info;
end;
end;请问怎样解决了?
解决方案 »
- 请问ftBCD和ftCurrency 这两个类型有什么不同?
- 如果判断鼠标位置在stringgrid的第几行列?
- delphi sql 2000 恢复
- DELPHI中只能使用OLE嵌入WORD文档吗,是否有其它更好的控件?
- 我给TTreeView加了个CheckBox,现在把代码都拿出来,大家看看可以怎么改比较好。
- ADOStoredProc的问题,高手请进!
- 求助 急 在线等!
- 请问怎么样获得系统的时间
- 请问怎样获取一个系统(如win2000)中已经注册的文件类型的图标!
- 我刚学报表,请问,打印预览的Navigator,即“上一页”“下一页”怎么做,有没有这个控件
- 动态类应该如何生成?
- [能不能实现这样的功能]动态指定用哪个变量来进行计算
改成
re := MyRecv(s, BufRecv, 1024, 0);
如何