Change bool to IntPtr.

WindowProc returns an IntPtr not a bool, so let Handle* functions return
IntPtr?. If they return a value we return that, if they return null we
call DefWindowProc and return the result from that.
This commit is contained in:
Fraser Waters 2014-02-22 14:08:18 +00:00 committed by thefiddler
parent 9239fd08e3
commit 9ed32e4445

View file

@ -388,15 +388,15 @@ namespace OpenTK.Platform.Windows
}
}
private bool HandleSetCursor(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
private IntPtr? HandleSetCursor(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
{
if (cursor != MouseCursor.Default)
{
Functions.SetCursor(curson_handle);
return true;
return new IntPtr(1);
}
return false;
return null;
}
void HandleChar(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
@ -666,7 +666,7 @@ namespace OpenTK.Platform.Windows
IntPtr WindowProcedure(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
{
bool result = false;
IntPtr? result = null;
switch (message)
{
@ -791,10 +791,9 @@ namespace OpenTK.Platform.Windows
#endregion
}
if (result)
if (result.HasValue)
{
// Return TRUE
return new IntPtr(1);
return result.Value;
}
else
{