Sign in to follow this  
Trentelshark

WIN32: Question on Resize/Style Change After Creation

Recommended Posts

Hi, I've searched high and low for any answers to this and consulted numerous pages in my Programming Windows reference, but I can't seem to track down a solution that works. Currently, my application creates a window on startup which is a splash screen centred on the user's desktop as a POPUP style. Further along during initialization, I change the display settings (via ChangeDisplaySettings) to fullscreen which is behaving as expected. Now however, I want to resize the window I created as my splash window, and potentially change its style (if the user wants windowed mode) but the following function calls continually return failures: ::SetWindowPos ::MoveWindow Beyond this, I see no way of doing what I require without totally tearing the window down and recreating it based on a fullscreen or windowed mode setting. However, as DirectX manages to do this without destroying the window, I'm convinced there's some way to do it using the WIN32 and GDI. Does anyone have any ideas on this one for me? Thanks, Trentelshark

Share this post


Link to post
Share on other sites
What failure codes do those functions return?
It should work perfectly fine, I have done this many times. I've simply used SetWindowLongPtr to set the window style, and then SetWindowPos to reposition/resize/redraw the window.
I haven't used it with ChangeDisplaySettings though, but I doubt it should make a difference. You can always try skipping it, and simply modify your window with the default desktop resolution as a debugging step.

Share this post


Link to post
Share on other sites
Erik,

I don't recall the errors I was receiving off the top of my head, I'll likely need to write a test application tonight to reproduce the errors. I reworked some things and have made the splash screen a seperate window (with it's own WNDCLASS since the WndProc is different) and destroy it just prior to creating the core application window. This will suffice for now; however at least by your comments I realise I'm not nutts and there is in fact a way to do it :).

I was reading through endless MSDN documents last night and noted that SetWindowLongPtr (as has SetWindowLong) behaviour has been modified for VISTA and the 64-bit O/S and it now performs checks on the user and process rights to determine what action can be taken. I happen to be on VISTA 64-bit (double whammy :)), so perhaps this change is impacting me even though I have full system rights, but again I would need to reproduce the errors and make a call to ::GetLastError so I can be sure I'm not providing the incorrect codes.

Thanks,

Trentelshark

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