Browse Source

Fix window activation.

pull/39/head
Steven Kirk 11 years ago
parent
commit
3ef1114187
  1. 7
      Windows/Perspex.Win32/Interop/UnmanagedMethods.cs
  2. 11
      Windows/Perspex.Win32/WindowImpl.cs

7
Windows/Perspex.Win32/Interop/UnmanagedMethods.cs

@ -190,6 +190,13 @@ namespace Perspex.Win32.Interop
SM_SYSTEMDOCKED = 0x2004,
}
public enum WindowActivate
{
WA_INACTIVE,
WA_ACTIVE,
WA_CLICKACTIVE,
}
[Flags]
public enum WindowStyles : uint
{

11
Windows/Perspex.Win32/WindowImpl.cs

@ -163,17 +163,20 @@ namespace Perspex.Win32
switch ((UnmanagedMethods.WindowsMessage)msg)
{
case UnmanagedMethods.WindowsMessage.WM_ACTIVATE:
switch ((int)lParam & 0xffff)
var wa = (UnmanagedMethods.WindowActivate)((int)wParam & 0xffff);
switch (wa)
{
case 1:
case 2:
case UnmanagedMethods.WindowActivate.WA_ACTIVE:
case UnmanagedMethods.WindowActivate.WA_CLICKACTIVE:
if (this.Activated != null)
{
this.Activated();
}
break;
case 0:
case UnmanagedMethods.WindowActivate.WA_INACTIVE:
if (this.Deactivated != null)
{
this.Deactivated();

Loading…
Cancel
Save