Jump to content
  • Advertisement
Sign in to follow this  
YanickSalzmann

[Win32] Problems with fullscreen window

This topic is 2698 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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


Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!