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
}