Windows Mobile shields the Start Menu

Source: Internet
Author: User

MyProgramIs A Wm full screen program that runs automatically upon startup. I have shielded all PDA buttons (except power keys), that is, the user cannot exit my program. But when the user shuts down (long press the power button), it will pop up "..., whether to shut down the dialog box, which will display the "Start" menu. If a user clicks any item in the Start Menu, he will jump out of my program.

I always thought this function could not be implemented, but when I played a full-screen RPG Game one day, I found that after I pressed the shut-down key, I clicked the "Start" and didn't respond, so I wanted to implement this function.

How can I prevent users from clicking the Start menu?

In the Windows Mobile section of msdn: http://social.microsoft.com/Forums/zh-CN/1729/thread/3b2495d5-a4a5-43b8-9080-242e1e3514cc

Windows Mobile in csdn: http://topic.csdn.net/u/20090702/11/e6417a27-30fe-469e-9977-bc219d028ff5.html

I have asked this question, and I have read a lot of Chinese characters. I cannot find a proper solution in English documents. Please help me.

Again, it indicates profit.

Finally, thank you.

Change Certificate ----------------------------------------------------------------------------------------------------------------------------------------------

According to a few friends on csdn, there are two solutions:

Two solutions:
1. If you can intercept messages by pressing the power key, you can directly hide the hhtaskbar.

[Dllimport ( " Coredll. dll " )]
Public   Extern   Static Intptr findwindow ( String Lpclassname, String Lpwindowname );

[Dllimport ("Coredll. dll")]
Public Extern Static BoolEnablewindow (intptr hwnd,BoolBenable );

Public   Static   Bool Hidebar ( Bool Enable)
{
Intptr hwnd;
Hwnd = Findwindow ( " Hhtaskbar " , "" );
Return Enablewindow (hwnd, enable );
}
Public Form1 ()
{
Initializecomponent ();
Hidebar ( False );
}

 

2. The service program intercepts the message at the position where the user clicks start and directly break it to block it.

 

Lresult wndproc (hwnd, uint nmessage, wparam, lparam)
{
Switch (Nmessage)
{
Case Wm_lbuttondown:
MessageBox (null, _ T ( " Small, just escape " ), _ T ( " Tip " ), Mb_ OK );
Return   0 ;
}
Return Defwindowproc (hwnd, nmessage, wparam, lparam );
}

VoidCevcdlg: onbutton1 ()
{
Hwnd=: Findwindow (text ("Hhtaskbar"), Text (""));
If(Hwnd! =Null)
{
Setwindowlong (hwnd, gwl_wndproc ,(Long) Wndproc );

}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.