Catalin

Catalin

  • NA
  • 10
  • 8.1k

Send key to JUMP TO FILE winamp window

Feb 11 2012 1:13 PM

Hi,
I'm trying to send key stroke to winamp Jump to File window, using c#, when is not in foreground but I don't know how.
So far I managed to send keys to winamp like "c" key to toggle play/pause using this example (this example work even when winamp is minimized):


using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace WindowsFormsApplication1
{
    class Test
    {
  
        [DllImport("User32.Dll", EntryPoint = "PostMessageA")]
        static extern bool PostMessage(IntPtr hWnd, uint msg, int wParam, int lParam);

        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        public static extern IntPtr FindWindow([MarshalAs(UnmanagedType.LPTStr)] string lpClassName,
                                                [MarshalAs(UnmanagedType.LPTStr)] string lpWindowName);

      
       public static void com()
        {
            IntPtr hwnd = FindWindow("Winamp v1.x", null);
            PostMessage(hwnd, 0x100, 0x43, 0);
        }
    }
}

0x43 is the Virtual-Key Code for „C" key.

Can someone help me with this problem and give me an example of haw I can send keys to Jump to File window in winamp?


Answers (6)