帮忙分析一下这个函数(help)

asbeforelong 2003-10-06 04:21:28
function Write_Socket(sockfd:TSocket; const s:string):Integer;
//功能:将字符串S写入sockfd
begin
setwindowtext(win.hInfo,pchar(s));
Result:=Send(sockfd,pointer(s)^,Length(s),0)
end;

问题:
1、setwindowtext(win.hInfo,pchar(s)); 里面的win.hInfo是什么意思?
2、帮忙解释一下Send(sockfd,pointer(s)^,Length(s),0) 这一行吧。
不好意思,菜鸟一个,对delphi和winsock都在学习当中...
...全文
55 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
asbeforelong 2003-10-06
  • 打赏
  • 举报
回复
可是这段代码是在没有窗口的程序中啊?关键问题win.hInfo是干什么用的\?
oracs 2003-10-06
  • 打赏
  • 举报
回复
win.hInfo因该是Form的Handle,SetWindowText也既是像窗体的标题栏赋值
Send应该是向sockfd传递字符串s
asbeforelong 2003-10-06
  • 打赏
  • 举报
回复
win.hInfo 是个句柄?什么东西的句柄?
zxqian 2003-10-06
  • 打赏
  • 举报
回复
看MSDN,上面有API说明
SetWindowText
This function changes the text of the specified window’s title bar, if it has one. If the specified window is a control, the text of the control is changed.

BOOL SetWindowText(
HWND hWnd,
LPCTSTR lpString );

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧