wince 5 沙漏(Hourglass)顯示問題

來源:互聯網
上載者:User

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 這個檔案.命令列編譯的順序是怎麼樣的還不太清楚,要學習下.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.