Fixed capacity parameter for GetWindowText(). Fixed debug string format that is printed when GetWindowText() fails.

This commit is contained in:
the_fiddler 2010-10-28 10:36:28 +00:00
parent 177f70e3bf
commit c99571acac

View file

@ -817,8 +817,8 @@ namespace OpenTK.Platform.Windows
get get
{ {
sb_title.Remove(0, sb_title.Length); sb_title.Remove(0, sb_title.Length);
if (Functions.GetWindowText(window.WindowHandle, sb_title, sb_title.MaxCapacity) == 0) if (Functions.GetWindowText(window.WindowHandle, sb_title, sb_title.Capacity) == 0)
Debug.Print("Failed to retrieve window title (window:{0}, reason:{2}).", window.WindowHandle, Marshal.GetLastWin32Error()); Debug.Print("Failed to retrieve window title (window:{0}, reason:{1}).", window.WindowHandle, Marshal.GetLastWin32Error());
return sb_title.ToString(); return sb_title.ToString();
} }
set set