已知Edit句柄,怎样把字符串传进去?
用什么API,最好给代码提示。 问题点数:70、回复次数:3Top
1 楼zyl910(编程的乐趣在于编程控制硬件,与用图形学实现绚丽效果)回复于 2002-07-20 04:42:09 得分 20
发送WM_SETTEXT消息
WM_SETTEXT
An application sends a WM_SETTEXT message to set the text of a window.
WM_SETTEXT
wParam = 0; // not used; must be zero
lParam = (LPARAM)(LPCTSTR)lpsz; // address of window-text string
Parameters
lpsz
Value of lParam. Pointer to a null-terminated string that is the window text.
Return Values
The 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.
Top
2 楼Chice_wxg(学)(习)回复于 2002-07-20 07:38:45 得分 50
Dim szStr As String
szStr = "AAAAAA"
SendMessage txtMyText.hwnd, WM_SETTEXT, 0, ByVal szStr
注意!必须用ByValTop




