. NET Compact framework BASICS (7)

Source: Internet
Author: User
Tags compact

Today's articleArticleThe topic is how to obtain the MRU (recently opened file list) in a windows mobile device)

 

There are two methods for obtaining MRU.

First, we will introduce how to use. Net to develop --- access the registry.

In the Registry: [HKEY_CURRENT_USER \ Software \ Microsoft \ shell \ taskswitch], information in all MRU is stored. There may be many accesses, but when Windows Mobile displays, it only displays items starting from 0 (usually 5 items ).

 

CodeDemo effect:

MRU displayed on Wm

 

ProgramObtained MRU information:

 

Note that the 0 items are the same as the calculator with the first MRU, and the absolute path is saved in the registry. You can enable the process for direct access.

How to enable a process:

1 Process xxx =   New Process ();
2 Xxx. startinfo. filename =   " Path + file name " ;
3 Xxx. startinfo. Arguments = Parameters;

 

How to access the registry:

1 Private   Void Menuitem1_click ( Object Sender, eventargs E)
2 {
3 String Strregpath =   @" SOFTWARE \ Microsoft \ shell \ taskswitch " ;
4 Registrykey regcurrentuser = Registry. currentuser. opensubkey (strregpath );
5 String [] Strlist = Regcurrentuser. getvaluenames ();
6
7 String Strkeyvalue =   "" ;
8 Foreach ( String Strkey In Strlist)
9 {
10 Strkeyvalue =   "" ;
11 Strkeyvalue = Regcurrentuser. getvalue (strkey, "" ). Tostring ();
12 Listbox1.items. Add ( String . Format ( " {0}-{1} " , Strkey, strkeyvalue ));
13 }
14 Regcurrentuser. Close ();
15 }

Remember to close the registry.

 

Note:

When you see this, you think, since you can get the corresponding value, can you modify it, and then you can control it yourself?

Unfortunately, the MRU list will not change even if you modify the value. (It depends on other places. I haven't found it yet)

 

Method 2: Use C ++:

Refer:Support for the latest file list in the MFC framework

 

The following describes how to obtain the number of unread text messages and the number of emails on the WM interface.

The count of the registry [HKEY_CURRENT_USER \ System \ state \ messages \ totalemail \ unread] indicates the number of unread mails.

The count of the registry [HKEY_CURRENT_USER \ System \ state \ messages \ SMS \ unread] indicates the number of unread messages.

 

Finally, I would like to add a tips on how to read the remote computer registry.

Use the Remote Registry Editor tool under remote tools in vs2005 or vs2008.

You can connect to the WM device to view its registry key value.

 

Download Code:Devicemrudemo.rar

 

Author: appleseeker

Date: 2008-08-21

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.