Then you are doing what the docs say you should not do. Consider yourself
lucky it works on XP.
Yes, you're right, i was not accurate enought
- It's a child CWnd (a CDialog to be more accurate)
- There is no control inside - I just use the CWnd->m_hWnd var to
create an OpenGL context
- I also use it to capture Mouse move / Left mouse button / Keyboard
input when mouse is on view
- There is no operation performed in the associated class - The
mouse/keyboard events are stored in a list
- I don't change the windows style during the creation
I've changed the code to:
GetClientRect(&oldRect);
SetWindowPos(&wndTopMost,0,0,GetSystemMetrics(),GetSystemMetrics(),SWP_SHOWWINDOW);
SetFocus();
Nothing else and it works - BUT i loose focus when toggle to another
app and never get it back... Looks like i'm missing something important,
but i'm quiet new to mfc
To go back from full screen :
SetWindowPos(&wndTop,oldRect(Thinigs),SWP_SHOWWINDOW);
SetFocus();
That's all
It works on XP but not on Vista ........ I don't get it. Also another
question : I used OnKillFocus Message/Method to disable full screen when
lost focus and it works on XP but not on Vista ... I still don't get it
Thanks
"Jonathan Wood" <jwood@softcircuits.com> a ?crit dans le message de news:
OCybJ0ihIHA.1212@TK2MSFTNGP05.phx.gbl...
As i said, it works like that, but only on XP and not on vista (only
once and then freeze) ... why ? Is it the OpenGL context attached to the
Cwnd ? Anyway, i'll give a try to SW_SHOWMAXIMIZED
Huh? You mentioned a bunch of stuff using SetParent, etc. You said
nothing about using ShowWindow as I suggested. SetParent() is
specifically problematic and you may very well run into trouble using it.
(Is your window a child window? Did you change the child style bit? Etc.,
etc.)
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Nord Pierre" <non> wrote in message
news:47dae3a3$0$9791$426a74cc@news.free.fr...
"Jonathan Wood" <jwood@softcircuits.com> a ?crit dans le message de
news: %23RxyMNhhIHA.200@TK2MSFTNGP02.phx.gbl...
What happens with ShowWindow(SW_SHOWMAXIMIZED)?
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Nord Pierre" <non> wrote in message
news:47dae15f$0$9123$426a74cc@news.free.fr...
Hello,
I just have a small problem, my app need to go in full screen and
get the input focus. Not all the app but just a CWnd inside with an
OpenGL context - I've tried many things and finally found this way :
When full screen :
- oldParent = GetParent();
- GetClientRect(&oldRect);
- SetParent(GetDestopWindow());
-
SetWindowPos(&wndTopMost,0,0,GetSystemMetrics(...),GetSystemMetrics(...),SWP_SHOWWINDOW);
- SetFocus();
When want to get out of full screen
- SetParent(oldParent);
-
SetWindowPos(&wndTop,0,0,oldRect.Width(),oldRect.Height(),SWP_SHOWWINDOW);
This works fine... But only on XP ! When i try on Vista, it works
once - If i try to go in full screen a second time, the app is locked
and i can't even access to any other window ! I can only kill it to
get back my system.
Does anyone already experience this problem ? Does anyone have a
better solution ?