Hi Forest.

Your question fits better in a forum for MFC or Windows programming.
You can use the Win32 API function GetForegroundWindow to see which
window has the focus or you can use GetWindowPlacement to get the
state about a specific window.
You should also consider using "on-demand rendering" mode in OSG to
reduce the CPU usage. Search for it in this mailing list or visit the
OSG blog to see what it is. Good luck!

Best regards

Jakob Ruhe

2009/11/25 forest <fores...@163.com>:
> hi all,
>        When I use osgMFCViewer, I create multiple rendering context,that's
> to say there are many HWND, each HWND is related to one Render thread ,so
> much CPU resource is taken up.  This is what I want to do: When one viewport
> is maximazed, the others will be hidden ,so these hidden context do not need
> continue the rendering. I want to suspend and resume some rendering thread
> depends on message CWnd::OnSize(UINT nType,   int cx, int cy ). I checked
> the MSDN and find that the parameter nType can be one of the following
> values
> SIZE_MAXIMIZED   Window has been maximized.
> SIZE_MINIMIZED   Window has been minimized.
> SIZE_RESTORED   Window has been resized, but neither SIZE_MINIMIZED nor
> SIZE_MAXIMIZED applies.
> SIZE_MAXHIDE   Message is sent to all pop-up windows when some other window
> is maximized.
> SIZE_MAXSHOW   Message is sent to all pop-up windows when some other window
> has been restored to its former size.
>
> My problem is that I never get SIZE_MAXHIDE or SIZE_MAXSHOW message.
> Is there anyone who has used SIZE_MAXHIDE or SIZE_MAXSHOW message? Or is
> there any other way to reduce the CPU resource usage?
>
> thanks in advance
> best regards
> forest
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to