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