Hello, I was directed here from another forum after i posted a question for help.. here it is:
After purchasing my new pc last weekend, I had a choice between Vista and WinXP Media Center Edition. After reading a ton of reviews online, i decided to hold back on Vista, until spring-time anyway.
So i fired up MCE, and start fiddeling around with the remote control that came with it (specialized for video playback, but has 3 programmable buttons on the top). It definitely is a nice add-on, but i need some assistance in programming it.
Under the settings tab, I can input a command, pretty much anything "Run" in windows would execute. When the specified button is pushed on the remote, the command is executed. So simply typing in calc would open the MS Calculator, msnmsgr would open up MSN Messenger, etc.
Whether it be an application opening, or as i've tried, as simple as "switching users" on my pc. I came across this command on google
%windir%\System32\rundll32.exe user32.dll,LockWorkStation
which allows me to "lock" my account with the push of a button on the remote.
One of the most obvious controls, which i'm surprised the remote lacks, is the Windows key, or Ctrl+Esc (opening up the start menu)..
I'm wondering if someone here could help me in possibly finding a command which would execute such a simple task?
I have absolutely no experience in programming, so if this task isn't worth the trouble, please advise me kindly.
Thank you
The following code would open the Start menu. If you have VB6 installed you could compile that into an EXE and run that when the button on the remote control is pressed.
Code:
Private Declare Sub keybd_event Lib "user32.dll" ( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long _
)
Public Sub Main()
Const VK_LWIN As Long = &H5B
Const KEYEVENTF_KEYUP As Long = &H2
keybd_event VK_LWIN, 0, 0, 0
keybd_event VK_LWIN, 0, KEYEVENTF_KEYUP, 0
End Sub
Last edited by Joacim Andersson; Dec 20th, 2007 at 09:11 AM.
Just in case you don't have VB, I've compiled the above mentioned code into an exe for you. People around here are usually a bit paranoid (with all right) about downloading EXE files, but I asure you that this exe only contains the above code and nothing else .
The Media Center handles it. It has a feature that allows you to specify which program that should run when you press one of the programmable remote control buttons.
Glad you got it, and I learned a couple of things as well.
If you consider this resolved, you could help us out by pulling down the Thread Tools menu and clicking the Mark Thread Resolved menu item. That will let everyone know that you have your answer.