Controlling foobar2000 with Asus multimedia keys

From about two months I’m a happy owner of Asus G73SW. In this model with four media keys, which in fact are keyboard shortcuts, you can control multimedia apps. However, with standard software shipped with notebook you are able to control just two of them: Roxio Cineplayer and Windows Media Player. Unfortunately, there’s no support for other multimedia applications. As I don’t use none of these I wanted to make multimedia keys work with foobar2000. In effect I’ve developed a small application, which allows you control foobar with Asus multimedia keyboard shortcuts. I’ve tested it only with Asus G73SW, ATKHotkey and foobar2000 1.1.5. On my machine it works just fine, and I think there’s still chance to make it work with other Asus notebooks models (feel free to add a comment if this solution worked for you).

Download link: [ATKMediaInterceptor]
Source: [ATKMediaInterceptor source]

To make it work (or better say, to try make it work) perform following steps:
1. Download application from the first link given above.
2. Open task manager, find process named DMedia.exe and terminate it.
3. Unpack zip file, and copy files to ATK Media installation folder. For example, on my machine it’s C:\Program Files (x86)\ASUS\ATK Package\ATK Media. You have to copy both files there and overwrite existing executable named DMedia.exe. Better solution is to change old executable name (to DMedia.exe.old for example) and keep it in case you will want back to it someday.
4. Now you just need to restart your machine.

If everything went as should, from now you should be able to control foobar with your media shortcuts:
Fn + Down arrow – Play/Pause
Fn + Up arrow – Stop
Fn + Left arrow – Previous track
Fn + Right arrow – Next track
Each of them also launch player if it wasn’t started yet.

Configuration file icpt.conf keeps two configuration options. First is window class name used by WinAPI FindWindow function to find foobar2000 window, second is path to application that will be executed in case the player window wasn’t found.

62 thoughts on “Controlling foobar2000 with Asus multimedia keys

  1. Hey, tried this on my Asus X5QSF (same as N5SF) and this is exactly the solution I was looking for! Works like a charm :D
    Thanks for the great work, I’ll recommend it to others!

    1. In the current version there’s no way to make it work globally. But if you want to control any other media app (e.g. AIMP) you need to replace the window_class option in the conf file. You can get the window class name using an appropriate tool – I can recommend Window Detective.

      1. @SHA da Vinci: Thanks for the hint. Yes, in some cases SednInput would be better (if not only) choice, but it’s a bit more complicated. I don’t see a reason for using this in such a simple app, but I’m not a WinAPI ninja though :)

    2. Hey, got it working for Winamp as well! Very nice, thanks again for the instructions :D
      Found with Window Detective what the windowclass should be, now works great!
      For others who want to let it work with WInamp, this is what my icpt.conf looks like now:

      application_path=C:\Program Files (x86)\Winamp\winamp.exe

  2. By the way – what IDE/compiler do you use?

    Already tried good ol’ Dev-C++ but when including winuser.h (necessary for sendinput function) header it doesn’t work (compiler finds some errors in winuser header – if it’s possible). Would porting this code to VS C++ project be hard?

    1. I use both – cl from Visual Studio and gcc. The linked app was compiled with gcc 4.5.2 (so the only dll dependency is msvcrt.dll). The code is pretty ugly, but no changes are required to compile this in VS, just checked :) Although you may need to change some project options.

  3. That’s how it works with MusicBee:
    application_path=C:\Program Files (x86)\MusicBee\MusicBee.exe
    Finally Fn keys work properly. Thanks, dude, great work!

  4. Nice! works great with my Asus G50VT-X1 and Winamp, thank you so much! and thanks to René for the information about the modification.

  5. Sadly, but haven’t worked for me. Now It’s only opens foobar. Doesn’t play/pause, stop or anything.
    Is there any chance you will fix that?
    I run ASUS ROG G53SX-IX154V and foobar 1.1.11.

    1. 1) run Spy++ (can be found in Internet)
      2) get Foobar window class id (in my case: {97E27FAA-C0B3-4b8e-A693-ED7881E99FC1} )
      3) put Id in icpt.conf (next to DMedia.exe above) and save.

  6. For those, who have problems with controlling foobar. If you have done all above and foobar2000 doesn`t obey you, do next:
    1) run Spy++ (can be found in Internet)
    2) get Foobar window class id (in my case: {97E27FAA-C0B3-4b8e-A693-ED7881E99FC1} )
    3) put Id in icpt.conf (next to DMedia.exe above) and save.
    Now foobar will abey you :)

  7. I managed to make Winamp works by editing the „icpt.conf” file with this content:

    window_class=Winamp v1.x
    application_path=C:\Program Files (x86)\Winamp\winamp.exe

  8. This worked great for me on my N55SL. However, since I didn’t need the ability to start a program (Win + 4, Win +5 for the pinned MPC-HC and foobar2000 shortcuts work fine) and I’d rather that the media keys work for all programs, I butchered your wonderful program:

    I compiled using MinGW: gcc -mwindows -Wall -march=native -O2 -s ATKMediaInterceptor.c -o DMedia.exe

    Thank you!

  9. Thank you! You really saved my day here >.>
    I still have one problem though, the FN key is still (unknown) when I set the shortcuts, and any command I use with just do Pause/Play.
    And also whenever I use the command the foobar window pops up, is there a way for me to manage it in the background? (very useful when running games).

    I hope this tread is still active! D:

    1. I wanted to did the same (with AIMP) but I can’t save the config file because Notepad is saying it might be open in an other program. The problem is I can’t find which one. Did you experience the same issue ?

  10. Actually this doesnt work very well, as there are several „qWidget” classes. Is there anyway this can work with .exe file name or the window title?

  11. its works pretty good with Media Player Classic Home cinema
    here what you need to write for use MPC

    application_path=C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mpc-hc.exe

    but I have one problem when I switch the DMedia in the rar at the original I cannot use the shortcut for the Calculator (Fn+ enter (in the numpad)), it open the MPC
    any help?

    thanks and sorry for my english :(

    1. I found a workaround. First of all I found out with the Task Manager that when pressing Fn + Enter it executed „SimAppExec.exe” instead of the Calculator. I found this file in the path „C:\Program Files (x86)\ASUS\ATK Package\ATK Hotkey”, so I deleted it and searched through the Windows folder for „calc.exe” and found the two necessary files to run the Calculator („calc.exe” and „calc.exe.mui”, there are many pairs, just choose one). Then I copied „calc.exe” into the „ATK Hotkey” folder and renamed it into „SimAppExec.exe”, and the same with „calc.exe.mui” into „SimAppExec.exe.mui”, and finally I moved the latter into a new folder called „es-ES” (which depends on the language of your system, hint: when searching for „calc.exe” you have to look the name of the folder that contains „calc.exe.mui”).

  12. Still Working ! , Asus A43SV with Windows 8.1 , ATK from Windows 7 64 Bit ,
    Work with Zune (Not Xbox Music)

    window_class=UIX Render Window
    application_path=C:\Program Files\Zune\Zune.exe

  13. You are so awesome! I do not suppose I’ve read
    through a single thing like this before. So good to find someone with some genuine thoughts on this subject.
    Seriously.. thank you for starting this up. This site is
    one thing that’s needed on the web, someone with a bit of originality!

  14. I found out how to see MusicBee window_class. By using Autohotkey Window Spy:

    ahk_class is the window_class.

    PS: Your file is offline

      1. There is no „DMedia.exe” file in zip folder. Should i rename „ATKMedia.exe” to DMedia.exe after copying files to ATK Media installation folder?

  15. Doesn’t work on Asus N56VV. Changed window class id and still, your program acts like it isn’t running at all (but it is) and keys still work only with WMP just as before (even without running original DMedia.exe). I am on Windows 8.1. I’ll gladly send more info you want to.

  16. If this totally doesn’t work for somebody there is also program called MediaKeys, which allows you to define new keyboard shortcuts for media controls, but you can’t use Fn+key. Alt+arrow works pretty well there.

  17. Hello! I’ve tried your program but it did not work for me (Win 8.1 x64). I’ve tried make it work with MusicBee and Foobar, changed for each of them class (obtained with the help of winlister and corrected path to executable file of player. I just don’t know what am I doing wrong?
    Can you please provide me aome advice?

  18. Attractive component to content. I just stumbled upon your
    weblog and in accession capital to claim that I acquire actually
    enjoyed account your weblog posts. Anyway I’ll be subscribing to your augment and even I fulfillment you access persistently rapidly.

Dodaj komentarz

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:


Komentujesz korzystając z konta Log Out / Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Log Out / Zmień )

Facebook photo

Komentujesz korzystając z konta Facebook. Log Out / Zmień )

Google+ photo

Komentujesz korzystając z konta Google+. Log Out / Zmień )

Connecting to %s