Sign in to follow this  
vladic2000x

Problem with windows xp style window

Recommended Posts

vladic2000x    252
Hi there. I develop a full-screen DirectX9 based application. I use Windows XP and I usually work in classic style (windows and buttons), but recently I have switched back to XP style (Display properties->Appearance) and I noticed a strange bug in my application. Here it is: I run my application in 800x600 full-screen mode. When I move the mouse in region [0,0,4,4] (left,top,right,bottom) and click there, suddenly the event is transmitted to both my application window and to the rest of the system (for example the folder window which was opened before or the desktop) and the system switches the focus to the previous window and minimizes my DX9 application. The same happens with the rectangle [798,0,799,4]. This problem does not occur with classic style of windows in Windows XP. I think that this could be related to some parameters passed to CreateWindow() function. I have tried to change some, but that didn't help. I also tested the same thing in a couple of samples which come with DirectX SDK, and this problem was not found there. Can somebody give me a hint where to search for the bug in my application?

Share this post


Link to post
Share on other sites
Evil Steve    2017
A fullscreen window should have the WS_POPUP style, and a non-fullscreen window should have WS_OVERLAPPEDWINDOW probably, and you'll want to use AdjustWindowRectEx to make sure you get the correct window size (CreateWindowEx takes the dimensions of the window rect, not the client rect).

if you're not doing those two things, give them a go and see if that fixes it.

Share this post


Link to post
Share on other sites
vladic2000x    252
Evil Steve was right. My application window was created with WS_OVERLAPPEDWINDOW flag which is fine for windowed mode, but when you move to full-screen you have to change the style to WS_POPUP.

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this