Remote CE Spy shipped with Visual Studio 2005 fails to intercept windows messages: Check the solution here!
====>SiteMap of this Blog<===
Remote CE Spy shipped with Visual Studio 2005 fails to intercept windows messages: Check the solution here!
Remote CE Spy is Windows Mobile programmer's buddy if there is a need to inspect the windows currently opened in a Windows Mobile device, or intercept the messages sent to a particular window in real-time. It might not be useful if you are writing simple UI and know for sure what messages to process. However, if you need to find out what is going on with a program written by other people, need to inject messages into the message queue of a program (or to be technically right, a window), or want to find the ID of a window control, Remote CE Spy is an indispensable tool.
CE Spy shipped with Embedded Visual Tools 4 (along with Pocket PC 2003 SDK and Smartphone 2003 SDK) works perfectly, always able to list all the windows, and reliably capture the messages of any window's message queue. However, the one shipped with Visual Studio 2005 is broken. It might list all the windows, but sometimes it doesn't. Worse, when capturing messages sent to a particular window, it grossly misses messages.
Quite some users reported various issues and Microsoft acknowledged it:
- http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=58908&SiteID=1
- http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=17401&SiteID=1
- http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=12630&SiteID=1
- http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=319056&SiteID=1
- http://groups.google.com/group/microsoft.public.pocketpc.developer/browse_thread
/thread/13dc59c942299c34/2c31c0c768f21722 - http://groups.google.com/group/microsoft.public.pocketpc.developer/browse_thread/
thread/2ca5adc86877ca3a/c4e504353719e397 - http://groups.google.com/group/microsoft.public.pocketpc.developer/browse_thread/
thread/3eabee13724fe80d/0f9e22d7c69e0b16 - http://groups.google.com/group/microsoft.public.pocketpc.developer/browse_thread/
thread/6705c8793e6f4e51/340654e349c75a6f - http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/
browse_thread/thread/3b51d271fa8c7583/b07ff4a4696d8185
Basically those posts are saying that CE Spy is broken in Visual Studio Beta 2. I also found it out when I was using Beta 2. The real trouble is that I am using the RTM version of Visual Studio 2005 (8.0.50727.42, see below). CE Spy still missed capturing messages.
I did a search on my hard drive, and found three version of cespy under "\Program Files". Looks like one of them can work with Windows Mobile 5.0 device.
Version 5.0.1.1400 works!
The following one works without any issue:
C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\bin\wce500\cespy.exe
The catch is: After 5.0 device is ActiveSync'ed, this tool won't list Pocket PC 5.0 as a target platform. Just simply choose Pocket PC 2003, the tool can make the connection, list windows and intercept messages correctly!
Version 5.0.1.1400
The window below shows the messages capture by ceSpy.exe 5.0.1.1400 when I clicked the "Send/Receive" menu item of Pocket Outlook. It reports 12 messages. Keep reading on, and you'll be surprised how many messages the "broken" spy is reporting.
Version 5.1.1651.0 (shipped with Visual Studio 2005 RTM and appearing under the start menu "Visual Studio Remote Tools => Remote Spy" does not work
Version 5.1.1651.0 seems to be the on shipped with Visual Studio 2005 and is put under start menu "Visual Studio Remote Tools => Remote Spy":
C:\Program Files\CE Remote Tools\5.01\bin\ccspy.exe (Notice the name is called ccspy.exe, not cespy.exe)
It has no problem connecting to 5.0 device, but messages are grossly missing. Do not use it!
The window below shows the messages capture by ccSpy.exe when I clicked the "Send/Receive" menu item of Pocket Outlook. Only two messages are captured. Compared to the messages intercepted by the good version 5.0.1.1400. This guy fails to report 10 messages!
Version 4.10.1.908 (shipped with Embedded Visual Tools) does not work with 5.0 device, but is the ideal choice to work with 2003 device
The one installed with Embedded Visual Tools does not work against Windows Mobile 5.0 device:
C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\bin
This is anticipated, as it is supposed to work with Pocket PC 2003 device and Smartphone 2003 device.
If you ActiveSync'ed a device and try connect, you will get the following error message.
Wrap Up
When you need to use Remote CE Spy to watch windows or messages in a Pocket PC 5.0 device or Smartphone 5.0 device, do not use the one put into the start menu by Visual Studio 2005. Instead, search your hard drive, and locate the one with version 5.0.1.1400.
Please do not ask me why if you cannot find the good guy in your hard drive. I have no idea why I have two different 5.0 versions of them.