Answers
VB.NET code
Public Const WM_SETTEXT As Integer = 12
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Public Shared Function SendMessage( _
ByVal hWnd As HandleRef, _
ByVal msg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As StringBuilder) As IntPtr
End Function
Public Shared Sub SetText(ByVal hWnd As IntPtr, ByVal text As String)
Dim b As New StringBuilder(text)
SendMessage(New HandleRef(Nothing, hWnd), WM_SETTEXT, b.Capacity, b)
End Sub
经常晚到一步君
answered 13 years, 5 months ago