版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
刚刚解决的问题:wince 5中用EVC 写应用程序自己调用显示忙状态的沙漏.
我发的相关帖子的地址:http://topic.csdn.net/u/20090203/09/1b4bda94-deea-4b62-b78b-4739bbd5167e.html
第一种情况:如下,在初始化时显示沙漏持续5s钟,实际效果是,我双击打开应用程序,什么也看不到,如果我点击下屏幕,就会显示出沙漏,如果笔不点击屏幕,沙漏就立刻消失.好像只有在点击屏幕是才会有沙漏出现.
BOOL CHourGlassDlg::OnInitDialog() { CDialog::OnInitDialog();// Set the icon for this dialog. The framework does this automatically// when the application's main window is not a dialog SetIcon(m_hIcon, TRUE);// Set big icon SetIcon(m_hIcon, FALSE);// Set small icon CenterWindow(GetDesktopWindow());// center to the hpc screen SetCursor(::WCE_FCTN(LoadCursor)(NULL,IDC_WAIT)); Sleep(5000); SetCursor(NULL);return TRUE;// return TRUE unless you set the focus to a control}
第二种情况:如下,在按钮按下事件中调用显示沙漏5秒钟,结果是我点击按钮,沙漏图标会出现,但沙漏不动,没有漏沙的效果,当点击一下屏幕就会出现漏沙的效果,不点击屏幕则没有漏沙的效果.
void CHourGlassDlg::OnHourglass() {// TODO: Add your control notification handler code here SetCursor(AfxGetApp()->LoadCursor(IDC_WAIT)); Sleep(5000); SetCursor(NULL); }
我把上面同一个应用程序放到win mobile的系统里,沙漏的效果都很正常,初始化时和点击按钮都会出现动画的沙漏.这好像和wince系统有关系了.
有网友提出,在sleep(5000)的时候,窗口不处理任何消息.我把上面的 函数中的 Sleep(5000);和SetCursor(NULL);去掉,沙漏同样不能正常显示.所以问题不在这里.况且同样的程序在win mobile上沙漏效果是正常的.
通过搜索,国外的网友有很多同样的问题:现摘录部分如下:http://www.pocketpcjunkies.com/Uwe/Forum.aspx/wince-pb/11133/Hourglass-Needs-tappingHourglass: Needs tapping
Tarun
This happens when I open up folders, or change view options, that may
take some time :
It looks like the hourglass in the square box is actually there, but I
can't see it.
I can see it if I touch the screen while it should be displayed.
If I touch the screen while my application is working the hourglass is
being displayed
and it is turning around with every touch on the screen.
So I'm wondering what am I missing in my platform to show this box
without
having to
touch the screen?
Has anyone experienced the same problem?
Please HELP
-T@N
anonymous
I have the problem, but it requires both SYSGEN_TOUCH and SYSGEN_MOUSE to be
set, so that the mouseandtouchcursor option is used.
It is a bug in microsoft's private code. So far, I've not been able to get
it fixed. I've opened a case and had it called a 'nuisance' in which they
won't fix it. I have a suggested fix, and I can't find the correct way to
communicate it to someone that cares.
I'd love to see it get fixed. Its a one line fix.
> This happens when I open up folders, or change view options, that may
> take some time :
[quoted text clipped - 16 lines]
>
> -T@N
Tarun
Hi there...
"I'd love to see it get fixed."
u already have this fix, or you dont have it??
"Its a one line fix. "
If you have a fix already, this would probably be the right place to
post it, in order to help others :)
-T@N
Tarun
I got the fix...
removing the SYSGEN_CURSOR (mouse) component from the OS design
resolved this.
Thanks "anonymous", you gave me a good pointer!
-T@N
还有:
Displaying hourglass cursor
abcd
Hi All,
I have a WinCE.NET 4.2 CDialog app that is to display a hourglass when
downloading data.
I tried using various methods such as the LoadCursor,
SetCursor(LoadCursor(NULL, IDC_WAIT)) and then ShowCursor. I also tried
the "CWaitCursor wait" method.
However, the cursor won't show up until I tagged on the screen, the
moment the stylus left the screen, it disappeared.
Is there a trick or way to make the cursor stayed without having to
touch the screen?
Or the problem OEM dependent on the device vendors?
TIA.
显然,上面的Tarun已经给出了解决办法,即
removing the SYSGEN_CURSOR (mouse) component from the OS design.
所以我也想把mouse去掉,
先是在PB里删除MOUSE 组件,但是提示不能直接删除,因为有相关的依赖关系存在.
我又在BSP目录下的PB5x_Cmd_Line_Bld_Env_Vars.bat文件里添加
set SYSGEN_CURSOR= ,结果依然没有改进.
最后在
C:/WINCE500/PLATFORM/ZYLONITE_MHL下的cebasecesysgen_cebase.bat 文件里加上set SYSGEN_CURSOR=. 结果沙漏就正常显示了.
WINCE 命令行编译时,不知道在哪里调用了cebasecesysgen_cebase.bat 这个文件.命令行编译的顺序是怎么样的还不太清楚,要学习下.