PurpleendurerOriginal
2005.12.07 1st
To enable full-screen flash display, we need to add a full-screen playback button for the playback window, and add a bool member variable m_isfullscr for the dialog box used as the flash playback window, to record whether the status is full screen. Because the flash control itself has the property of displaying it in front of other controls, we only need to set the flash control size to full screen without hiding other controls. However, because the program uses a timer to dynamically display the relationship between the current number of frames, the current number of frames will still be displayed, affecting the full screen playback effect of flash, so we need to hide the status bar, or kill the timer.
The processing code when a user clicks the full screen playback button is as follows:
Void cswfplayerdlg: onbtnfullscr () // full screen playback
{
// Todo: add your control notification handler code here
If (false = m_isfullscr)
{
Getwindowplacement (& m_defdlgpos );
: Showwindow (m_hstatuswindow, sw_hide); // hide the status bar
Setwindowlong (m_hdlg, gwl_style, getwindowlong (m_hdlg, gwl_style)-ws_caption); // remove the title bar
Cclientdc DC (this );
Int horzres = Dc. getdevicecaps (horzres );
Int vertres = Dc. getdevicecaps (vertres );
This-> movewindow (0, 0, horzres, vertres );
M_swfbox.setwindowpos (& cwnd: wndtop, 0, 0, horzres, vertres, swp_showwindow); // display the flash in full screen mode.
M_isfullscr = true;
}
}
When the playback window is displayed in full screen, In order to exit the full screen state by pressing the ESC key, we add a pretranslatemessage method for the dialog box used as the flash playback window. The Code is as follows:
Bool cswfplayerdlg: pretranslatemessage (MSG * PMSG)
{
If (PMSG-> message = wm_keydown & PMSG-> wparam = vk_escape) // If you press the ESC key
{
If (true = m_isfullscr) // full screen display
{
Setwindowlong (m_hdlg, gwl_style, getwindowlong (m_hdlg, gwl_style) + ws_caption); // restore the title bar
Showwindow (sw_hide );
Setwindowplacement (& m_defdlgpos );
M_isfullscr = false;
: Showwindow (m_hstatuswindow, sw_show); // display the status bar
}
Return true; // prevent pressing ESC to close the dialog box
}
Return cdialog: pretranslatemessage (PMSG );
}