Use VC 6.0 to write Flash Player-5. Full Screen playback

Source: Internet
Author: User

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 );
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.