from:http://blog.csdn.net/AlicePeter/article/details/3862059
剛剛解決的問題: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-tapping
Hourglass: Needs tapping
Tarun - 01 Mar 2006 12:10 GMTThis happens when I open up folders, or change view options, that maytake some time :It looks like the hourglass in the square box is actually there, but Ican'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 isbeing displayedand it is turning around with every touch on the screen.So I'm wondering what am I missing in my platform to show this boxwithouthaving totouch the screen?Has anyone experienced the same problem? Please HELP-T@NReply to this Message anonymous - 01 Mar 2006 15:17 GMTI 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@NReply to this Message Tarun - 02 Mar 2006 10:03 GMTHi 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 topost it, in order to help others :)-T@NReply to this Message Tarun - 02 Mar 2006 10:32 GMTI got the fix...removing the SYSGEN_CURSOR (mouse) component from the OS designresolved this.Thanks "anonymous", you gave me a good pointer!-T@NReply to this Message
還有:
Displaying hourglass cursor
abcd - 04 Oct 2005 01:21 GMTHi 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 這個檔案.命令列編譯的順序是怎麼樣的還不太清楚,要學習下.