Announcement

Collapse
No announcement yet.

Small App: WinampHelper

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Small App: WinampHelper

    Intro
    This app sits in the background. When your computer goes into Hibernation or Standby, the App kills all instances of Winamp (up to 32 instances) and starts Winamp again when the computer comes out of Standby / Hibernate.

    This is useful for people running Winamp with:

    -Markus's Parallel Port LCD Winamp Plugin
    --If you suspend or hibernate windows, the parallel port needs to be reinitialised and the LCD plugin doesn't do this. Winamp usually crashes.

    -KX Drivers for Sound Blaster Live! / Audigy / Emu10k series SPUs
    --If you suspend or hibernate while the SPU is doing something, as Windows resumes the SPU will not have the previous DSP data loaded and makes Windows freeze.

    Both of these can be worked around by killing Winamp and restarting it as the computer comes out of hibernation / suspend.

    The application also hooks DirectInput, and watches if you push Numlock+0+Enter on the numeric keypad. If you push this key combination, the app does a soft forced reboot, which is pretty useful

    Usage:
    WinampHelper c:\progra~1\winamp\winamp.exe
    (replace c:\progra~1\winamp\winamp.exe with your path to winamp in short filename form)

    Long tech detail:
    The App's written in VB6 SP5 and requires the VB6 SP5 runtime dll.
    If you hit DirectInput keys 0x45, 0x4A and 0x52 the app calls ExitWindowsEx ByVal EWX_FORCE Or EWX_REBOOT, ByVal 0&.

    When the application starts it subclasses the main form and traps for WM_POWERBROADCAST and WM_POWER. It then sets the current thread's execution state to ES_SYSTEM_REQUIRED Or ES_CONTINUOUS so the messages are sent to the app. It will also adjust the application access token to give the application permissions to instruct Win2k / XP to reboot.

    If WM_POWERBROADCAST is received, if wParam is PBT_APMQUERYSUSPEND or PBT_APMQUERYSTANDBY the app calls FindWindow with Winamp's class name "Winamp v1.x", and will send WM_CLOSE to any windows with that class name (up to 32 times and stops after that in case something's wrong). The app then sleeps for 3 seconds to ensure the sound driver has enough time to unhook the card.

    The app also will watch if wParam is PBT_APMQUERYSUSPENDFAILED, PBT_APMQUERYSTANDBYFAILED, PBT_APMRESUMESUSPEND, PBT_APMRESUMESTANDBY or PBT_APMRESUMECRITICAL and will start winamp if this message is sent (should be sent when windows comes out of suspend / hibernate).


    Source code:

    Available on request.
    Attached Files

  • #2
    Sounds cool
    Co-Developer of A.I.M.E.E
    www.aimee.cc

    Comment


    • #3
      Great job, a golden star for you!
      -
      My cars
      -

      Comment


      • #4
        YOU ROCK!!!

        FYI, the problem you describe with Markus' plugin is not unique to the parallel port driver, it happens to me using a Matrix Orbital compatible serial lcd as well.

        I'm going to try this out tomorrow Hibernation is the only thing on my system that is not working as I planned.

        Comment


        • #5
          that was close

          That was close..

          After tuning for hours my "new" system I manage to make it boot from hibernation in a mere 14 secs. nice . But all this work was done using the onscreen lcd emulation. And guess what append when I finished the real installation?? Winamp froze.

          Lucky me that this little marvel arrived just in time. It's installed and working just fine.

          Thanks a lot for such a great life saver.

          Bravellir
          Ikea Case. Epia M10000.M1-ATX. 512 Mb. 2,5" 80 GB HDD. 7" Lilliput. BU-303 GPS. Sony Joystick.
          Status -->
          Lilliput Installed (not indash yet..)
          BraveCar 2.5

          Comment


          • #6
            I experienced the symptoms described in the first post here, with the program as the remedy. However, when using this program, sometimes when i start playing a song it just freezes the whole system and repeats a couple secs of the song over and over. Every time i try to goto standby or i think any other shutdown procedure, it also hangs.

            I have a shortcut to winamphelper.exe with the path of winamp in its command line in the "startup" folder of my xp install. Is this how i am supposed to run it? I am using mediacar by the way. Wasnt sure how to make it run this program instead of winamp in the config.

            Comment


            • #7
              Hi, the app only works for Winamp, it won't work for other applications (due to the way it's coded: it only looks for windows with a class name that's the same as winamp)..

              I might support other apps later on, but don't have time right now.. maybe in a few weeks.

              Comment

              Working...
              X