[DllImport("user32.dll")]
static extern bool SetWindowText(IntPtr hWnd, string lpString);
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function SetWindowText(ByVal hwnd As IntPtr, ByVal lpString As System.Text.StringBuilder) As Integer
End Function 'SetWindowText
Declare Auto Function SetWindowText Lib "user32" (ByVal hWnd As IntPtr, ByVal lpstring As String) As Boolean
None.
None.
Please add some!
C# Example
private bool SetText(IntPtr handle, string text)
{
System.text.StringBuilder sb = new System.text.StringBuilder(text);
return (SetWindowText(handle, sb) != 0);
}
VB.Net Example
Private Function SetText(ByVal handle As IntPtr, ByVal text As String) As Boolean
Dim sb As New System.text.StringBuilder(text)
Return (SetWindowText(handle, sb) <> 0)
End Function 'SetText
Do you know one? Please contribute it!