SetStatusText freezes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello for all,
I use the program for example
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)>
Private Shared Function SetWindowText(ByVal hWnd As IntPtr, ByVal lpString As String) As Integer
End Function
<DllImport("user32.dll", SetLastError:=True)>
Private Shared Function FindWindowEx(ByVal hwndParent As IntPtr, ByVal hwndChildAfter As IntPtr, ByVal lpszClass As String, ByVal lpszWindow As String) As IntPtr
End Function
Public Shared Sub SetStatusText(ByVal mainWindows As IntPtr, ByVal text As String)
Dim statusBar As IntPtr = FindWindowEx(mainWindows, IntPtr.Zero, "msctls_statusbar32", "")
If statusBar <> IntPtr.Zero Then
SetWindowText(statusBar, text)
End If
End Sub
Dim revithandle As IntPtr = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle
Dim nb As Integer
For nb = 0 To 1000
Thread.Sleep(10) 'or other command
SetStatusText(revithandle, nb.ToString)
Next
After a while I realize that I program freezes towards 447
Is there a solution in order to unlock and continue to display the value of nb?
Can be a buffer to empty?
Thank you for your help
Alex