Patrick Dähne skrev:
> Hello,
>
> Am 06.09.2006 um 13:26 schrieb Marcus Lindblom:
>
>   
>> This might also be of interest. It automatically 'maximizes' a
>> window-rect to fullscreen on the monitor that is most covered by the
>> rect. Quite useful:
>>
>>     RECT r;
>>     r.left = m_pos[0];
>>     r.top = m_pos[1];
>>     r.right = m_pos[0] + m_size[0];
>>     r.bottom = m_pos[1] + m_size[1];
>>
>>     if (m_fullscreen) {
>>         HMONITOR mon = MonitorFromRect(&r, MONITOR_DEFAULTTONEAREST);
>>         MONITORINFOEX mi;
>>         mi.cbSize = sizeof(mi);
>>         GetMonitorInfo(mon, &mi);
>>         r = mi.rcWork;
>>         s_log.info("Going fullscreen on monitor '%s' %s.",  
>> mi.szDevice,
>>                    mi.dwFlags & MONITORINFOF_PRIMARY ?  
>> "(primary)" : "");
>>     }
>>     
>
> Hmmm, what about the following piece of code:
>
> ShowWindow(m_hwnd, m_fullscreen ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL);
I haven't tried that. :)

But my code computes the maximized size before showing the window, from 
a initial rect which roughly defines where the window should be. It's 
nice if you need the maximized size of the window before showing it (not 
that I do.. yet. :).

I only use SW_SHOW and SW_HIDE to avoid altering that state of the 
window, so I make something orthogonal to that. I was also using 
different window-styles for fullscreen and non-fullscreen, so I call 
CreateWindow() anew when I switch between windowed and fullscreen.

But I suppose your style could work, even for borderless windows.

/Marcus



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to