Discussion:
Receiveing MCE remote mesages in a service
(too old to reply)
Janiv Ratson
2007-04-16 17:09:49 UTC
Permalink
Hello,
I want to write a win32 service (c++) and receive MCE remote messages into
it.
the messages I want to receive are based on the MCE remote document:
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_topic5

Thanks in advance,
J.
Janiv Ratson
2007-04-19 07:25:04 UTC
Permalink
Help?
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages into
it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_topic5
Thanks in advance,
J.
Janiv Ratson
2007-04-22 07:32:30 UTC
Permalink
Help?
Help?
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages
into it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_topic5
Thanks in advance,
J.
Anthony Park [MVP]
2007-04-25 03:48:02 UTC
Permalink
Janiv,

If you really want to capture these messages before they are sent to Media
Center, I think the only way to do this would be to install a Windows Hook to
the Media Center messaging window procedure. Take a look at the
SetWindowsHookEx API.

This is a pretty dangerous activity, meaning that you could cause some major
stability issues if you do not handle things correctly. Before doing this,
please carefully consider why you are doing this and perhaps think of another
way to accomplish a similar function.
--
Thanks,
Anthony Park
Microsoft MVP (Media Center)
http://www.anpark.com
Help?
Help?
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages
into it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_topic5
Thanks in advance,
J.
Janiv Ratson
2007-04-25 08:01:44 UTC
Permalink
Hello and thanks.
I want my service to run and receive the MCE remote control messages.
According to the received messages I'll do some user defined actions.
Will I be able to capture WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN using the
SetWindowsHookEx API?
Thanks again,
Janiv.
Post by Anthony Park [MVP]
Janiv,
If you really want to capture these messages before they are sent to Media
Center, I think the only way to do this would be to install a Windows Hook to
the Media Center messaging window procedure. Take a look at the
SetWindowsHookEx API.
This is a pretty dangerous activity, meaning that you could cause some major
stability issues if you do not handle things correctly. Before doing this,
please carefully consider why you are doing this and perhaps think of another
way to accomplish a similar function.
--
Thanks,
Anthony Park
Microsoft MVP (Media Center)
http://www.anpark.com
Help?
Help?
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages
into it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_topic5
Thanks in advance,
J.
Janiv Ratson
2007-04-25 08:04:55 UTC
Permalink
Hello Joseph and thanks,
I do not handle a message pump within my service.
How do I do it ? How do I register to raw input? Does raw input includes:
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw input
from the device?
joe
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages into
it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_topic5
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Janiv Ratson
2007-04-26 08:07:38 UTC
Permalink
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw input
from the device?
joe
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages into
it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_topic5
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Drew
2007-04-26 15:49:26 UTC
Permalink
Does this help?
http://msdn2.microsoft.com/en-us/library/aa468212.aspx

Drew
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw input
from the device?
joe
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages into
it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_topic5
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Gary Chanson
2007-04-26 19:16:30 UTC
Permalink
Be aware that there are some mistakes in this article, but it's close
enough to get you started.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Drew
Does this help?
http://msdn2.microsoft.com/en-us/library/aa468212.aspx
Drew
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw input
from the device?
joe
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages into
it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_to
pic5
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Janiv Ratson
2007-04-29 10:57:33 UTC
Permalink
Thanks you all.
All my work is based on this article.
The problem is that I don't know how to implement the explained issue within
a Win32 service.
How do I catch all the inputs (WM_APPCOMMAND, WM_INPUT, and WM_KEYDOWN) into
my win32 service.
Thanks again,
J.
Post by Gary Chanson
Be aware that there are some mistakes in this article, but it's close
enough to get you started.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Drew
Does this help?
http://msdn2.microsoft.com/en-us/library/aa468212.aspx
Drew
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
How do I do it ? How do I register to raw input? Does raw input
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw
input
Post by Drew
Post by Janiv Ratson
from the device?
joe
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote messages into
it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_to
pic5
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Gary Chanson
2007-04-29 19:17:16 UTC
Permalink
I don't think you can. I have not been able to intercept any of the
WM_INPUT messages with hooks. You might be able to incept the WM_APPCOMMAND
messages with a global hook but I haven't tried it yet.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Janiv Ratson
Thanks you all.
All my work is based on this article.
The problem is that I don't know how to implement the explained issue within
a Win32 service.
How do I catch all the inputs (WM_APPCOMMAND, WM_INPUT, and WM_KEYDOWN) into
my win32 service.
Thanks again,
J.
Post by Gary Chanson
Be aware that there are some mistakes in this article, but it's close
enough to get you started.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Drew
Does this help?
http://msdn2.microsoft.com/en-us/library/aa468212.aspx
Drew
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
How do I do it ? How do I register to raw input? Does raw input
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw
input
Post by Drew
Post by Janiv Ratson
from the device?
joe
On Mon, 16 Apr 2007 19:09:49 +0200, "Janiv Ratson"
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote
messages
Post by Janiv Ratson
Post by Gary Chanson
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
into
it.
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_t
o
Post by Janiv Ratson
Post by Gary Chanson
pic5
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Janiv Ratson
2007-04-30 12:38:03 UTC
Permalink
Thanks,
And how Do I catch the WM_INPUT commands, and the WM_KEYDOWN?
Has anyone tried to catch any of those messages in Win32 services?
Thanks again,
Janiv.
Post by Gary Chanson
I don't think you can. I have not been able to intercept any of the
WM_INPUT messages with hooks. You might be able to incept the
WM_APPCOMMAND
messages with a global hook but I haven't tried it yet.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Janiv Ratson
Thanks you all.
All my work is based on this article.
The problem is that I don't know how to implement the explained issue
within
Post by Janiv Ratson
a Win32 service.
How do I catch all the inputs (WM_APPCOMMAND, WM_INPUT, and WM_KEYDOWN)
into
Post by Janiv Ratson
my win32 service.
Thanks again,
J.
Post by Gary Chanson
Be aware that there are some mistakes in this article, but it's close
enough to get you started.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Drew
Does this help?
http://msdn2.microsoft.com/en-us/library/aa468212.aspx
Drew
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
How do I do it ? How do I register to raw input? Does raw input
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw
input
Post by Drew
Post by Janiv Ratson
from the device?
joe
On Mon, 16 Apr 2007 19:09:49 +0200, "Janiv Ratson"
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote
messages
Post by Janiv Ratson
Post by Gary Chanson
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
into
it.
the messages I want to receive are based on the MCE remote
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_t
o
Post by Janiv Ratson
Post by Gary Chanson
pic5
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
KM
2007-05-10 06:15:24 UTC
Permalink
Janiv,

I have implemented a MCE hook-up agent that keeps monitoring the Media Center app on a complex of things - messages, windows,
positions, etc. - including WM_INPUT (raw input messages), keyboard and mouse messages and etc.
A piece of advice - if you are playing with MCE on Vista, try to stay away from a service implementation for your app. On Vista,
services are running in a separate, isolated Windows session (session 0) and it may take you an effort to implement the
cross-session interface between your hook into MCE and the service. (not impossible but just overcomplicates the implementation)

Anthony,
Despite the fact that the SetWindowsHookEx approach (or any other Dll-inject method supported - better say possible - in Win32
space) is fairly dangerous, this is pretty much the only way you can try and fix some 2/10 foot UI issues within MCE, especially on
Vista.

I wish some things in MCE app could have more control via Group Policy or some registry entries or INI/XML settings. It would make
it much easer to do MCE app customizations to meet some customer needs.
--
=========
Regards,
KM
Post by Anthony Park [MVP]
Thanks,
And how Do I catch the WM_INPUT commands, and the WM_KEYDOWN?
Has anyone tried to catch any of those messages in Win32 services?
Thanks again,
Janiv.
Post by Gary Chanson
I don't think you can. I have not been able to intercept any of the
WM_INPUT messages with hooks. You might be able to incept the WM_APPCOMMAND
messages with a global hook but I haven't tried it yet.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Janiv Ratson
Thanks you all.
All my work is based on this article.
The problem is that I don't know how to implement the explained issue
within
Post by Janiv Ratson
a Win32 service.
How do I catch all the inputs (WM_APPCOMMAND, WM_INPUT, and WM_KEYDOWN)
into
Post by Janiv Ratson
my win32 service.
Thanks again,
J.
Post by Gary Chanson
Be aware that there are some mistakes in this article, but it's close
enough to get you started.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Drew
Does this help?
http://msdn2.microsoft.com/en-us/library/aa468212.aspx
Drew
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
How do I do it ? How do I register to raw input? Does raw input
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw
input
Post by Drew
Post by Janiv Ratson
from the device?
joe
On Mon, 16 Apr 2007 19:09:49 +0200, "Janiv Ratson"
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote
messages
Post by Janiv Ratson
Post by Gary Chanson
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
into
it.
the messages I want to receive are based on the MCE remote
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_t
o
Post by Janiv Ratson
Post by Gary Chanson
pic5
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Janiv Ratson
2007-05-17 16:28:18 UTC
Permalink
Thanks for the answer.
Can I get a code sample or something?
Thanks,
J.
Post by Anthony Park [MVP]
Janiv,
I have implemented a MCE hook-up agent that keeps monitoring the Media
Center app on a complex of things - messages, windows, positions, etc. -
including WM_INPUT (raw input messages), keyboard and mouse messages and
etc.
A piece of advice - if you are playing with MCE on Vista, try to stay away
from a service implementation for your app. On Vista, services are running
in a separate, isolated Windows session (session 0) and it may take you an
effort to implement the cross-session interface between your hook into MCE
and the service. (not impossible but just overcomplicates the
implementation)
Anthony,
Despite the fact that the SetWindowsHookEx approach (or any other
Dll-inject method supported - better say possible - in Win32 space) is
fairly dangerous, this is pretty much the only way you can try and fix
some 2/10 foot UI issues within MCE, especially on Vista.
I wish some things in MCE app could have more control via Group Policy or
some registry entries or INI/XML settings. It would make it much easer to
do MCE app customizations to meet some customer needs.
--
=========
Regards,
KM
Post by Anthony Park [MVP]
Thanks,
And how Do I catch the WM_INPUT commands, and the WM_KEYDOWN?
Has anyone tried to catch any of those messages in Win32 services?
Thanks again,
Janiv.
Post by Gary Chanson
I don't think you can. I have not been able to intercept any of the
WM_INPUT messages with hooks. You might be able to incept the WM_APPCOMMAND
messages with a global hook but I haven't tried it yet.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Janiv Ratson
Thanks you all.
All my work is based on this article.
The problem is that I don't know how to implement the explained issue
within
Post by Janiv Ratson
a Win32 service.
How do I catch all the inputs (WM_APPCOMMAND, WM_INPUT, and WM_KEYDOWN)
into
Post by Janiv Ratson
my win32 service.
Thanks again,
J.
Post by Gary Chanson
Be aware that there are some mistakes in this article, but it's close
enough to get you started.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Drew
Does this help?
http://msdn2.microsoft.com/en-us/library/aa468212.aspx
Drew
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
How do I do it ? How do I register to raw input? Does raw input
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw
input
Post by Drew
Post by Janiv Ratson
from the device?
joe
On Mon, 16 Apr 2007 19:09:49 +0200, "Janiv Ratson"
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote
messages
Post by Janiv Ratson
Post by Gary Chanson
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
into
it.
the messages I want to receive are based on the MCE remote
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_t
o
Post by Janiv Ratson
Post by Gary Chanson
pic5
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
KM
2007-05-18 08:12:09 UTC
Permalink
Janiv,

Sorry, I can't post samples of my code in public newsgroup.

There is lots of Dll injection code samples posted on the Web. E.g., search CodeProject.com.
Windows system hooks are relatively well documented in MSDN.
--
=========
Regards,
KM
Post by Janiv Ratson
Thanks for the answer.
Can I get a code sample or something?
Thanks,
J.
Post by Anthony Park [MVP]
Janiv,
I have implemented a MCE hook-up agent that keeps monitoring the Media Center app on a complex of things - messages, windows,
positions, etc. - including WM_INPUT (raw input messages), keyboard and mouse messages and etc.
A piece of advice - if you are playing with MCE on Vista, try to stay away from a service implementation for your app. On Vista,
services are running in a separate, isolated Windows session (session 0) and it may take you an effort to implement the
cross-session interface between your hook into MCE and the service. (not impossible but just overcomplicates the implementation)
Anthony,
Despite the fact that the SetWindowsHookEx approach (or any other Dll-inject method supported - better say possible - in Win32
space) is fairly dangerous, this is pretty much the only way you can try and fix some 2/10 foot UI issues within MCE, especially
on Vista.
I wish some things in MCE app could have more control via Group Policy or some registry entries or INI/XML settings. It would
make it much easer to do MCE app customizations to meet some customer needs.
--
=========
Regards,
KM
Post by Anthony Park [MVP]
Thanks,
And how Do I catch the WM_INPUT commands, and the WM_KEYDOWN?
Has anyone tried to catch any of those messages in Win32 services?
Thanks again,
Janiv.
Post by Gary Chanson
I don't think you can. I have not been able to intercept any of the
WM_INPUT messages with hooks. You might be able to incept the WM_APPCOMMAND
messages with a global hook but I haven't tried it yet.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Janiv Ratson
Thanks you all.
All my work is based on this article.
The problem is that I don't know how to implement the explained issue
within
Post by Janiv Ratson
a Win32 service.
How do I catch all the inputs (WM_APPCOMMAND, WM_INPUT, and WM_KEYDOWN)
into
Post by Janiv Ratson
my win32 service.
Thanks again,
J.
Post by Gary Chanson
Be aware that there are some mistakes in this article, but it's close
enough to get you started.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Post by Drew
Does this help?
http://msdn2.microsoft.com/en-us/library/aa468212.aspx
Drew
Help?
Post by Janiv Ratson
Hello Joseph and thanks,
I do not handle a message pump within my service.
How do I do it ? How do I register to raw input? Does raw input
WM_INPUT, WM_APPCOMMAND and WM_KEYDOWN?
That is my greatest problem.
Thanks again,
J.
Since services do not connect to devices in general, it may not be
possible at all. But
did you bulid a service with a message pump, and register for raw
input
Post by Drew
Post by Janiv Ratson
from the device?
joe
On Mon, 16 Apr 2007 19:09:49 +0200, "Janiv Ratson"
Post by Janiv Ratson
Hello,
I want to write a win32 service (c++) and receive MCE remote
messages
Post by Janiv Ratson
Post by Gary Chanson
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
into
it.
the messages I want to receive are based on the MCE remote
http://msdn2.microsoft.com/en-us/library/ms867196.aspx#remote_control_t
o
Post by Janiv Ratson
Post by Gary Chanson
pic5
Post by Drew
Post by Janiv Ratson
Post by Janiv Ratson
Thanks in advance,
J.
Joseph M. Newcomer [MVP]
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Loading...