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. Visual Basic
  4. MCiWnd api problem.

MCiWnd api problem.

Scheduled Pinned Locked Moved Visual Basic
comjsonhelptutorialquestion
4 Posts 3 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.
  • V Offline
    V Offline
    V G
    wrote on last edited by
    #1

    hey guys, im building a media player using the MCiWND class in VB 6.0. im using the SendMessageAsString function to send commands to the Mci device. it runs fine and all that, but after a song is done playing, the status of my window does not change. it keeps playing even after the file is done. i.e i cant find a way to read the status change of the Mci device. ive set the flags to Notify Mode change.. now my problem is, i dont know how to read the mode change that occurs after the song is done playing. can i treat the mode change as an event? or anything else i can do? here's what ive coded so far.:

    'Create a MciWND class
    Call MCIWndRegisterClass
    flags = WS_CHILD And MCIWNDF_NOTIFYMODE Or MCIWNDF_NOTIFYALL

    szFileName = Playlist1.Text

    hMCIWnd = CreateWindowExAsString(0&, "MCIWndClass", "ORCA", flags, _
    10&, 10&, 0&, 0&, _
    Me.hwnd, _
    0&, _
    App.hInstance, _
    szFileName)

    Call SendMessageAsString(hMCIWnd, MCIWNDM_SENDSTRING, flags, "play")

    here's a screenshot of the problem: http://img33.picoodle.com/img/img33/3/1/24/f_scrnshtm_5a52658.jpg[^] as u can see, its pretty basic.. lots of stuff to add :P suggestions and criticism are welcome.. :)

    C 1 Reply Last reply
    0
    • V V G

      hey guys, im building a media player using the MCiWND class in VB 6.0. im using the SendMessageAsString function to send commands to the Mci device. it runs fine and all that, but after a song is done playing, the status of my window does not change. it keeps playing even after the file is done. i.e i cant find a way to read the status change of the Mci device. ive set the flags to Notify Mode change.. now my problem is, i dont know how to read the mode change that occurs after the song is done playing. can i treat the mode change as an event? or anything else i can do? here's what ive coded so far.:

      'Create a MciWND class
      Call MCIWndRegisterClass
      flags = WS_CHILD And MCIWNDF_NOTIFYMODE Or MCIWNDF_NOTIFYALL

      szFileName = Playlist1.Text

      hMCIWnd = CreateWindowExAsString(0&, "MCIWndClass", "ORCA", flags, _
      10&, 10&, 0&, 0&, _
      Me.hwnd, _
      0&, _
      App.hInstance, _
      szFileName)

      Call SendMessageAsString(hMCIWnd, MCIWNDM_SENDSTRING, flags, "play")

      here's a screenshot of the problem: http://img33.picoodle.com/img/img33/3/1/24/f_scrnshtm_5a52658.jpg[^] as u can see, its pretty basic.. lots of stuff to add :P suggestions and criticism are welcome.. :)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      V.G wrote:

      suggestions and criticism are welcome

      You're making work for yourself. VB6 is crap, and it's unsupported ( you should put VB6 in your subject line if you're using it, b/c hardly anyone does ). VB.NET has a media player control you just drop into a form and it works.

      Christian Graus Driven to the arms of OSX by Vista.

      V 1 Reply Last reply
      0
      • C Christian Graus

        V.G wrote:

        suggestions and criticism are welcome

        You're making work for yourself. VB6 is crap, and it's unsupported ( you should put VB6 in your subject line if you're using it, b/c hardly anyone does ). VB.NET has a media player control you just drop into a form and it works.

        Christian Graus Driven to the arms of OSX by Vista.

        V Offline
        V Offline
        V G
        wrote on last edited by
        #3

        yes i know how that works, but im doing this for my college and they require VB 6. anything you can suggest regarding my problem..?

        D 1 Reply Last reply
        0
        • V V G

          yes i know how that works, but im doing this for my college and they require VB 6. anything you can suggest regarding my problem..?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          V.G wrote:

          but im doing this for my college and they require VB 6.

          I'd start looking for a new university to go to. Something that doesn't teach you to use technology that's long been dead now. Notifications come to you through window messages. You have to override the message handler (WndProc in a VB.NET app) and pick out the MCI message you get. VB6 and VB.NET will not automagically do this for you and create an event out of something it knows nothing about. So, you have to write the code to catch the message and generate the event. Sorry, I don't have any VB6 examples of this. I stopped using VB6 7 years ago. I did manage to find this example[^] that might help you do this...

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          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