[Win32] Problems with fullscreen window

Started by
0 comments, last by aqrit 12 years, 11 months ago
Hey everyone

Im having a window which is in a fullscreen mode. It fills the whole screen and has WS_POPUP as its style and is set as the topmost window. When i receive a WM_NCACTIVATE indicating that the window was deactivated i set it to the bottom window and minimize it. When WM_NCACTIVATE indicates that the window was reactivated i set it to the topmost window again and restore the window. In code it looks like that


case Native.WM.WM_NCACTIVATE:
{
bool activate = wParam.ToInt32() != 0;
if (activate)
{
if (IsFullScreen)
{
Native.UnsafeNativeMethods.ShowWindow(Handle, Native.UnsafeNativeMethods.SW.SW_RESTORE);
Native.UnsafeNativeMethods.SetWindowPos(Handle, new IntPtr(-1), 0, 0, 0, 0, 3);
Native.UnsafeNativeMethods.SetForegroundWindow(Handle);
Console.WriteLine("Activate");
}
}
else
{
if (IsFullScreen)
{
Native.UnsafeNativeMethods.ShowWindow(Handle, Native.UnsafeNativeMethods.SW.SW_MINIMIZE);
Native.UnsafeNativeMethods.SetWindowPos(Handle, new IntPtr(1), 0, 0, 0, 0, 3);
Console.WriteLine("Deactivate");
}
}
}
break;


Now while deactivating works perfectly i get problems with reactivating the window. When i click on the entry in the taskbar the window gets the activating message, windows makes a beep like when a messagebox is shown and the window becomes active. But the problem is that window is not shown. It gets the keyboard focus and it also receives all the input messages like keyboard messages or mouse messages but its not shown.


Do i have to do something special to make the window be shown again?

Greetings
Muepe


Advertisement
WM_NCACTIVATE does NOT indicate that the window was reactivated
you should be watching for WM_ACTIVATE or WM_ACTIVATEAPP

what are you using in "fullscreen mode" ( d3d, opengl, directinput, etc )?
would something with them need to happen when you restore fullscreen mode?

This topic is closed to new replies.

Advertisement