Use VC 6.0 to write the flash player -- 2. Add the status bar for the dialog box as the main window

Source: Internet
Author: User

PurpleendurerOriginal

2005.11.152Version

After successfully calling the "open file" dialog box, we need to add a status bar for the dialog box as the main window and divide the status bar into three parts, the first part shows the file description of the currently played FLASH file (drive letter:/path/filename.swf), and the second part shows the currently displayed frames, the second part shows the total number of frames of the currently played Flash files.

Using MFC to add the status bar as the dialog box of the main window is really tiring. (For details, refer to statusbar on dialogs-to add a status bar to the dialog box as the main window)

Or call the API function createstatuswindow () to create a pipeline.

The implementation method is as follows:

1. Add the status bar variable declaration to the cswfplayerdlg class definition:

Class cswfplayerdlg: Public cdialog
{
.....

Protected:
Hicon m_hicon;
Hwnd m_hstatuswindow; // declaration of adding the status bar variable
.....
};

2. In the oninitdialog () dialog box, call the API function to create the status bar.

Bool cswfplayerdlg: oninitdialog ()
{
Cdialog: oninitdialog ();

// Set the icon for this dialog. The framework does this automatically
// When the application's main window is not a dialog
Seticon (m_hicon, true); // set big icon
Seticon (m_hicon, false); // set small icon
 
// Todo: add extra initialization here

// Call the API function to create the status bar

M_hstatuswindow = createstatuswindow (ws_child | ws_visible | ws_border, // Style
Null, // information displayed on the status bar
Getsafehwnd (), // parent window handle
100); // resource ID

Uint indicators [] = {240,330,420,-1}; // set the interval
: Sendmessage (m_hstatuswindow, sb_setparts, sizeof (indicators)/sizeof (uint), (lparam) indicators );
: Sendmessage (m_hstatuswindow, sb_settext, 0, (lparam) text ("Author: Purple endurer "));
: Sendmessage (m_hstatuswindow, sb_settext, 1, (lparam) text ("the current frame "));
: Sendmessage (m_hstatuswindow, sb_settext, 2, (lparam) text ("total frames "));

Return true; // return true unless you set the focus to a control
}

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.