我在D5开发人员指南上看到一个:
var
s: string;
begin
s := 'hello';
SendMessage(someEdit.Handle, WM_SETTEXT, 0, integer(PChar(s)));
end;
我的理解是把s的地址传过去,不知道是不是这样……sendmessage()的最后一个参数是起什么作用的呢?
SendMessage(
HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
具体解释是:
lParam:Specifies additional message-specific information. 这样的解释对我这样的菜鸟来说,没有太多指导意义。
var
s: string;
begin
s := 'hello';
SendMessage(someEdit.Handle, WM_SETTEXT, 0, integer(PChar(s)));
end;
我的理解是把s的地址传过去,不知道是不是这样……sendmessage()的最后一个参数是起什么作用的呢?
SendMessage(
HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
具体解释是:
lParam:Specifies additional message-specific information. 这样的解释对我这样的菜鸟来说,没有太多指导意义。
解决方案 »
- C 代码 转delphi
- 用TXMLDocument怎么生成XML文件?谢谢高手们
- 查看某台机器上的某个服务是否已经启动?(解决后马上给分!!)
- 好长时间没来CSDN了我参与的问题怎么都没了
- 谁能给个读取数据库的简单例子(使用线程的)
- 我动态给SQL语句参数赋值出现找不到第二个参数B
- 学Delphi买什么书好?
- 请问怎样在一个窗体中调用另一个窗体的Table组件?(在线等待)
- 请教高手,ADO控件问题
- DELPHI串口通信,可以采用USB接口。希望给些建议,谢谢~本想多给分的,可是只能这么多,如果需要,可以再加!
- delphi中有没有把文本数据导入数据库的函数或控件!
- 我想开发个组件,不知道继承哪个类好,请指教(最好说明为什么)。
wParam = 0; // not used; must be zero
lParam = (LPARAM)(LPCTSTR)lpsz; // address of window-text string
ParameterslpszValue of lParam. Points to a null-terminated string that is the window text. Return ValuesThe return value is TRUE if the text is set. It is FALSE (for an edit control), LB_ERRSPACE (for a list box), or CB_ERRSPACE (for a combo box) if insufficient space is available to set the text in the edit control. It is CB_ERR if this message is sent to a combo box without an edit control. Default ActionThe DefWindowProc function sets and displays the window text. ResFor an edit control, the text is the contents of the edit control. For a combo box, the text is the contents of the edit-control portion of the combo box. For a button, the text is the button name. For other windows, the text is the window title.
This message does not change the current selection in the list box of a combo box. An application should use the CB_SELECTSTRING message to select the item in a list box that matches the text in the edit control.