Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Playing Video In Dialogs

Playing Video In Dialogs

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasedata-structuresquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sweep123
    wrote on last edited by
    #1

    In my MFC application, I create a series of 4 dialog windows all idential (an array of dialogs). Now I play a different video on each dialog on an Animate control. For Dialog 1 (index 0) - see code below:- // Control of the video window facilities CAnimateCtrl m_screen; // Handle to the MCI window for playing video (.avi and .mpg) HWND hMCI[4] = {NULL, NULL, NULL, NULL}; hMCI[0] = MCIWndCreate(m_screen, AfxGetApp()->m_hInstance, MCIWNDF_SHOWALL | MCIWNDF_NOMENU | MCIWNDF_NOOPEN | MCIWNDF_NOPLAYBAR, "animation.mpg"); // PlayVideo(0); /* If the MCI video window has been activated the close it */ /* This is so it can be resized when restarted */ if(hMCI[index]) { MCIWndClose (hMCI[index]); m_MainText.ShowWindow (SW_SHOW); playVideo = true; displayed = false; m_screen.ShowWindow (SW_HIDE); } void CEmuDlg::PlayVideo(short index) { if(playVideo) { m_MainText.ShowWindow (SW_HIDE); m_screen.ShowWindow (SW_SHOW); // Arrange for the window to be maximised for the Animation control size stingray_animation.mpg ::ShowWindow(hMCI[index],SW_MAXIMIZE); // Play the video MCIWndPlay(hMCI[index]); /* Arrange for the video to be played repeatedly */ MCIWndSetRepeat(hMCI[index],TRUE); // Only works for actions on Menu Bar of the MCI playVideo = false; } else { // Hide the animation window MCIWndPause(hMCI[index]); //MCIWndStop(hMCI); //MCIWndClose(hMCI); m_screen.ShowWindow (SW_HIDE); playVideo = true; // Is the clear box checked? if(!m_pClear.GetCheck ()) m_MainText.ShowWindow (SW_SHOW); } } Now the video only plays on a single dialog window. Do I need to do anything else to allow a different video play on dialog 3 say at the same time. Can I only play on video per application?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups