Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1092135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:38:14+00:00 2026-05-16T23:38:14+00:00

Hey, I am using C# to try to send key commands to windows media

  • 0

Hey, I am using C# to try to send key commands to windows media center in windows 7.

Currently I can send keys like 4 and see the number 4 appears on the windows media center.

The problem is any key combination like Ctrl+p (to pause a movie) does not seem to have any effects on the media center.

Any help would be greatly appreciated. Here is my code snippet.

    // Get a handle to an application window.
    [DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
    public static extern IntPtr FindWindow(string lpClassName,
    string lpWindowName);

    // Activate an application window.
    [DllImport("USER32.DLL")]
    public static extern bool SetForegroundWindow(IntPtr hWnd);


    String HandleClass = "eHome Render Window";
    String HandleWindow = "Windows Media Center";

    private bool SendKeyCommand()
    {
        bool success = true;
        IntPtr PrgHandle = FindWindow(HandleClass, HandleWindow);
        if (PrgHandle == IntPtr.Zero)
        {
            MessageBox.Show(HandleWindow + " is not running");
            return false;
        }
        SetForegroundWindow(PrgHandle);
        SendKeys.SendWait("^p");
        return success;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:38:15+00:00Added an answer on May 16, 2026 at 11:38 pm

    I was actually able to finally find a solution that worked on this website:

    http://michbex.com/wordpress/?p=3

    I ended up using his VK Class and Remote Sender Class methods to solve this problem. Windows media center must have lower level key hooks and you must implement a keyup/keydown sending solution to exploited the hooks.

    I can finally pause a movie! I will clean up the code and post it later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I am currently using the following code Dim flickr As New Flickr(apikey) Dim
Hey guys I'm trying to see where my pairs of keys stop, I have
Hey, I am using iBATIS with SQL Server Compact Edition 3.5 and try to
Hey, I am creating a game using openGL in c++ when I try and
Hey there, I'm using the tutorial at http://www.jamesfairhurst.co.uk/posts/view/uploading_files_and_images_with_cakephp to try to get myself up
Hey, im doing a little app for my smart phone, using Windows Mobile 6.
hey there i'm using mysql in hebrew , but when i try to preview
Hey there I'm using a binary search method to find a number in an
Hey so I am using Rails PJAX for my web application with twitter bootstrap
hey i want to display a loading progress using ProgressDialog on my aplication, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.